[PATCH 13/14] viafb: Determine type of 2D engine and store it in chip_info
From: Harald Welte <hidden>
Date: 2009-05-23 09:50:38
Subsystem:
framebuffer layer, the rest · Maintainers:
Helge Deller, Linus Torvalds
From: Harald Welte <laforge@gnumonks.org> This will help us for the upcoming support for 2D acceleration using the M1 engine. Signed-off-by: Harald Welte <redacted> Acked-by: Krzysztof Helt <redacted> --- drivers/video/via/chip.h | 8 ++++++++ drivers/video/via/hw.c | 15 +++++++++++++++ drivers/video/via/viafbdev.c | 3 +-- 3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/drivers/video/via/chip.h b/drivers/video/via/chip.h
index 03e90cf..7f4bf73 100644
--- a/drivers/video/via/chip.h
+++ b/drivers/video/via/chip.h@@ -122,10 +122,18 @@ 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; int chip_on_slot; + 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 e06d6b7..e14b852 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c@@ -2092,6 +2092,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)
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 7d0c8ee..1357034 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c@@ -214,8 +214,7 @@ static int viafb_check_var(struct fb_var_screeninfo *var, if (!info->par) return -1; p_viafb_par = (struct viafb_par *)info->par; - if (p_viafb_par->chip_info->gfx_chip_name == UNICHROME_VX800 || - p_viafb_par->chip_info->gfx_chip_name == UNICHROME_VX855) + if (p_viafb_par->chip_info->twod_engine == VIA_2D_ENG_M1) var->accel_flags = 0; return 0;
--
1.6.2.4
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com