[PATCH 06/30] viafb: Determine type of 2D engine and store it in chip_info

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan Corbet
Date: Wednesday, April 28, 2010 - 3:17 pm

From: Harald Welte <laforge@gnumonks.org>

This will help us for the upcoming support for 2D acceleration using
the M1 engine.

[jc: fixed merge conflicts]
Signed-off-by: Harald Welte <HaraldWelte@viatech.com>
---
 drivers/video/via/chip.h |    8 ++++++++
 drivers/video/via/hw.c   |   15 +++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/video/via/chip.h b/drivers/video/via/chip.h
index 8c06bd3..d9b6e06 100644
--- a/drivers/video/via/chip.h
+++ b/drivers/video/via/chip.h
@@ -121,9 +121,17 @@ struct lvds_chip_information {
 	int i2c_port;
 };
 
+/* The type of 2D engine */
+enum via_2d_engine {
+	VIA_2D_ENG_H2,
+	VIA_2D_ENG_H5,
+	VIA_2D_ENG_M1,
+};
+
 struct chip_information {
 	int gfx_chip_name;
 	int gfx_chip_revision;
+	enum via_2d_engine twod_engine;
 	struct tmds_chip_information tmds_chip_info;
 	struct lvds_chip_information lvds_chip_info;
 	struct lvds_chip_information lvds_chip_info2;
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index c94bcce..ae664fb 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -2016,6 +2016,21 @@ static void init_gfx_chip_info(struct pci_dev *pdev,
 				CX700_REVISION_700;
 		}
 	}
+
+	/* Determine which 2D engine we have */
+	switch (viaparinfo->chip_info->gfx_chip_name) {
+	case UNICHROME_VX800:
+	case UNICHROME_VX855:
+		viaparinfo->chip_info->twod_engine = VIA_2D_ENG_M1;
+		break;
+	case UNICHROME_K8M890:
+	case UNICHROME_P4M900:
+		viaparinfo->chip_info->twod_engine = VIA_2D_ENG_H5;
+		break;
+	default:
+		viaparinfo->chip_info->twod_engine = VIA_2D_ENG_H2;
+		break;
+	}
 }
 
 static void init_tmds_chip_info(void)
-- 
1.7.0.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] Second OLPC Viafb series, v2, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 02/30] viafb: use proper pci config API, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 04/30] viafb: Retain GEMODE reserved bits, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 05/30] viafb: Unify duplicated set_bpp() code, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 06/30] viafb: Determine type of 2D engine and store ..., Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 12/30] viafb: Move core stuff into via-core.c, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 13/30] viafb: Separate global and fb-specific data, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 14/30] viafb: add a driver for GPIO lines, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 15/30] viafb: package often used basic io functions, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 19/30] viafb: Introduce viafb_find_i2c_adapter(), Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 20/30] via: Rationalize vt1636 detection, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 22/30] viafb: Add a simple VX855 DMA engine driver, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 25/30] viafb: unify modesetting functions, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 27/30] viafb: replace inb/outb, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 28/30] viafb: improve misc register handling, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 29/30] viafb: fix proc entry removal, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 30/30] viafb: make procfs entries optional, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
Re: [RFC] Second OLPC Viafb series, v2, Bruno Prémont, (Thu Apr 29, 10:26 am)
Re: [RFC] Second OLPC Viafb series, v2, Jonathan Corbet, (Fri Apr 30, 8:39 am)
Re: [PATCH 13/30] viafb: Separate global and fb-specific data, Florian Tobias Schan ..., (Fri Apr 30, 11:07 am)
Re: [PATCH 13/30] viafb: Separate global and fb-specific data, Jonathan Corbet, (Fri Apr 30, 11:22 am)
Re: [PATCH 13/30] viafb: Separate global and fb-specific data, Florian Tobias Schan ..., (Fri Apr 30, 11:43 am)
Re: [PATCH 02/30] viafb: use proper pci config API, Florian Tobias Schan ..., (Sat May 1, 7:01 am)
Re: [PATCH 12/30] viafb: Move core stuff into via-core.c, Florian Tobias Schan ..., (Sat May 1, 8:02 am)
Re: [PATCH 12/30] viafb: Move core stuff into via-core.c, Jonathan Corbet, (Sat May 1, 8:08 am)
Re: [PATCH 12/30] viafb: Move core stuff into via-core.c, Florian Tobias Schan ..., (Sat May 1, 8:29 am)
Re: [RFC] Second OLPC Viafb series, v2, Florian Tobias Schan ..., (Sat May 1, 2:28 pm)
Re: [RFC] Second OLPC Viafb series, v2, Jonathan Corbet, (Sat May 1, 3:57 pm)
Re: [PATCH 24/30] viafb: Add a driver for the video captur ..., Florian Tobias Schan ..., (Sat May 1, 6:18 pm)
Re: [PATCH 02/30] viafb: use proper pci config API, Jonathan Corbet, (Mon May 3, 7:37 pm)