[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 7 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Sat Apr 8 00:37:15 UTC 2023


 drivers/gpu/drm/via/via_crtc.c |  132 ++++++++++++++++++++---------------------
 drivers/gpu/drm/via/via_dac.c  |    3 
 drivers/gpu/drm/via/via_drv.h  |    4 -
 drivers/gpu/drm/via/via_lvds.c |   35 +++-------
 drivers/gpu/drm/via/via_tmds.c |    6 -
 5 files changed, 80 insertions(+), 100 deletions(-)

New commits:
commit 8ce5bb858db868107c2debeee9d644661d37af24
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Apr 7 17:30:08 2023 -0700

    drm/via: Version bumped to 3.6.5
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index bcc0a75a0002..83f2d05c7fe8 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		6
-#define DRIVER_PATCHLEVEL	4
+#define DRIVER_PATCHLEVEL	5
 #define DRIVER_NAME		"via"
 #define DRIVER_DESC		"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE		"20230224"
+#define DRIVER_DATE		"20230407"
 #define DRIVER_AUTHOR		"OpenChrome Project"
 
 
commit 32747efa49262b344a0fa20b566d5905ee08940b
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Apr 7 17:26:25 2023 -0700

    drm/via: Adjust CRTC pitch calculation and indentation
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 0db78cf0ea98..e5d1fa742a6a 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1929,8 +1929,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
 		vga_wcrt(VGABASE, 0x34, (addr >> 16) & 0xFF);
 
 		/* Load fetch count registers */
-		pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0],
-				16);
+		pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0],	16);
 		load_value_to_registers(VGABASE, &iga->fetch, pitch >> 4);
 
 		/* Set the primary pitch */
@@ -1956,7 +1955,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
 		svga_wcrt_mask(VGABASE, 0xA3, ((addr >> 26) & 0x07), 0x07);
 
 		/* Load fetch count registers */
-		pitch = ALIGN(crtc->mode.hdisplay * (fb->format->cpp[0] * 8) >> 3, 16);
+		pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0], 16);
 		load_value_to_registers(VGABASE, &iga->fetch, pitch >> 4);
 
 		/* Set secondary pitch */
commit 22828197acd329f3a4a7a2ec345d2f3c4d331e66
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Apr 7 17:25:49 2023 -0700

    drm/via: Modify via_iga*_set_color_depth() parameters
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 8a4db7ef585a..0db78cf0ea98 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -106,86 +106,78 @@ static void via_iga_common_init(struct drm_device *dev)
 }
 
 static void via_iga1_set_color_depth(struct drm_device *dev,
-					u8 depth)
+					u8 cpp, u8 depth)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-	u8 value;
+	u8 data;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	value = 0x00;
+	data = 0x00;
 
 	/* Set the color depth for IGA1. */
-	switch (depth) {
-	case 8:
+	switch (cpp) {
+	case 1:
+		data |= BIT(4);
 		break;
-	case 16:
-		/* Bit 4 is for 555 (15-bit) / 565 (16-bit) color selection. */
-		value |= BIT(4) | BIT(2);
+	case 2:
+		data = (depth == 15) ? BIT(2) : BIT(4) | BIT(2);
 		break;
-	case 24:
-		value |= BIT(3) | BIT(2);
+	case 4:
+		data = (depth == 30) ? BIT(3) : BIT(3) | BIT(2);
+		data |= BIT(4);
 		break;
 	default:
 		break;
 	}
 
-	if ((depth == 8) || (depth == 16) || (depth == 24)) {
-		/* 3C5.15[4]   - Hi Color Mode Select
-		 *               0: 555
-		 *               1: 565
-		 * 3C5.15[3:2] - Display Color Depth Select
-		 *               00: 8bpp
-		 *               01: 16bpp
-		 *               10: 30bpp
-		 *               11: 32bpp */
-		svga_wseq_mask(VGABASE, 0x15, value,
-				BIT(4) | BIT(3) | BIT(2));
-		DRM_INFO("IGA1 Color Depth: %d bit\n", depth);
-	} else {
-		DRM_ERROR("Unsupported IGA1 Color Depth: %d bit\n",
-				depth);
-	}
+	/*
+	 * 3C5.15[4]   - Hi Color Mode Select
+	 *               0: 555
+	 *               1: 565
+	 * 3C5.15[3:2] - Display Color Depth Select
+	 *               00: 8bpp
+	 *               01: 16bpp
+	 *               10: 30bpp
+	 *               11: 32bpp
+	 */
+	svga_wseq_mask(VGABASE, 0x15, data, BIT(4) | BIT(3) | BIT(2));
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
 static void via_iga2_set_color_depth(struct drm_device *dev,
-					u8 depth)
+					u8 cpp, u8 depth)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-	u8 value;
+	u8 data;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	value = 0x00;
+	data = 0x00;
 
 	/* Set the color depth for IGA2. */
 	switch (depth) {
-	case 8:
+	case 1:
 		break;
-	case 16:
-		value = BIT(6);
+	case 2:
+		data = BIT(6);
 		break;
-	case 24:
-		value = BIT(7) | BIT(6);
+	case 4:
+		data = (depth == 30) ? BIT(7) : BIT(7) | BIT(6);
 		break;
 	default:
 		break;
 	}
 
-	if ((depth == 8) || (depth == 16) || (depth == 24)) {
-		/* 3X5.67[7:6] - Display Color Depth Select
-		 *               00: 8bpp
-		 *               01: 16bpp
-		 *               10: 30bpp
-		 *               11: 32bpp */
-		svga_wcrt_mask(VGABASE, 0x67, value, 0xC0);
-		DRM_INFO("IGA2 Color Depth: %d bit\n", depth);
-	} else {
-		DRM_ERROR("Unsupported IGA2 Color Depth: %d bit\n",
-				depth);
-	}
+	/*
+	 * 3X5.67[7:6] - Display Color Depth Select
+	 *               00: 8bpp
+	 *               01: 16bpp
+	 *               10: 30bpp
+	 *               11: 32bpp
+	 */
+	svga_wcrt_mask(VGABASE, 0x67, data, BIT(7) | BIT(6));
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -1922,7 +1914,9 @@ void via_primary_atomic_update(struct drm_plane *plane,
 	bo = to_ttm_bo(ttm_bo);
 
 	if (!iga->index) {
-		via_iga1_set_color_depth(dev, fb->format->depth);
+		via_iga1_set_color_depth(dev,
+						fb->format->cpp[0],
+						fb->format->depth);
 
 		/* Set the framebuffer offset */
 		addr = round_up((ttm_bo->resource->start << PAGE_SHIFT) +
@@ -1946,7 +1940,9 @@ void via_primary_atomic_update(struct drm_plane *plane,
 		 * second adapter */
 		load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
 	} else {
-		via_iga2_set_color_depth(dev, fb->format->depth);
+		via_iga2_set_color_depth(dev,
+						fb->format->cpp[0],
+						fb->format->depth);
 
 		/* Set the framebuffer offset */
 		addr = round_up((ttm_bo->resource->start << PAGE_SHIFT) +
commit eba57c28919a9f0a6e0615132cdb54fd9438d555
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Apr 7 17:24:32 2023 -0700

    drm/via: Modify via_iga*_display_fifo_regs() input parameter
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index b74667e2acc8..8a4db7ef585a 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -398,12 +398,12 @@ static void via_load_vpit_regs(struct via_drm_priv *dev_priv)
 }
 
 static int via_iga1_display_fifo_regs(struct drm_device *dev,
-					struct via_drm_priv *dev_priv,
 					struct via_crtc *iga,
 					struct drm_display_mode *mode,
 					struct drm_framebuffer *fb)
 {
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u32 reg_value;
 	unsigned int fifo_max_depth = 0;
 	unsigned int fifo_threshold = 0;
@@ -800,12 +800,12 @@ exit:
 }
 
 static int via_iga2_display_fifo_regs(struct drm_device *dev,
-					struct via_drm_priv *dev_priv,
 					struct via_crtc *iga,
 					struct drm_display_mode *mode,
 					struct drm_framebuffer *fb)
 {
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u32 reg_value;
 	unsigned int fifo_max_depth = 0;
 	unsigned int fifo_threshold = 0;
@@ -1745,9 +1745,8 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
 		via_iga1_set_hsync_shift(VGABASE, 0x05);
 
 		/* Load display FIFO. */
-		ret = via_iga1_display_fifo_regs(dev, dev_priv,
-						iga, adjusted_mode,
-						crtc->primary->fb);
+		ret = via_iga1_display_fifo_regs(dev, iga, adjusted_mode,
+							crtc->primary->fb);
 		if (ret) {
 			goto exit;
 		}
@@ -1774,9 +1773,8 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
 					DRM_MODE_FLAG_INTERLACE);
 
 		/* Load display FIFO. */
-		ret = via_iga2_display_fifo_regs(dev, dev_priv,
-						iga, adjusted_mode,
-						crtc->primary->fb);
+		ret = via_iga2_display_fifo_regs(dev, iga, adjusted_mode,
+							crtc->primary->fb);
 		if (ret) {
 			goto exit;
 		}
commit 7aee8496bb5c280b3623c48086cef3f2cddc92ee
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Apr 7 17:24:31 2023 -0700

    drm/via: Modify via_iga*_set_color_depth() input parameter
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 5cfa94ace7f4..b74667e2acc8 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -105,9 +105,10 @@ static void via_iga_common_init(struct drm_device *dev)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_iga1_set_color_depth(struct via_drm_priv *dev_priv,
+static void via_iga1_set_color_depth(struct drm_device *dev,
 					u8 depth)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 value;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -149,9 +150,10 @@ static void via_iga1_set_color_depth(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_iga2_set_color_depth(struct via_drm_priv *dev_priv,
+static void via_iga2_set_color_depth(struct drm_device *dev,
 					u8 depth)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 value;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1922,7 +1924,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
 	bo = to_ttm_bo(ttm_bo);
 
 	if (!iga->index) {
-		via_iga1_set_color_depth(dev_priv, fb->format->depth);
+		via_iga1_set_color_depth(dev, fb->format->depth);
 
 		/* Set the framebuffer offset */
 		addr = round_up((ttm_bo->resource->start << PAGE_SHIFT) +
@@ -1946,7 +1948,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
 		 * second adapter */
 		load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
 	} else {
-		via_iga2_set_color_depth(dev_priv, fb->format->depth);
+		via_iga2_set_color_depth(dev, fb->format->depth);
 
 		/* Set the framebuffer offset */
 		addr = round_up((ttm_bo->resource->start << PAGE_SHIFT) +
commit fdae8f923bf70f43360bb8ca16f120a9bb2c96f5
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Apr 7 17:24:30 2023 -0700

    drm/via: Modify via_iga_common_init() input parameters
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index f1002daef297..5cfa94ace7f4 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -65,8 +65,11 @@ static struct vga_regset vpit_table[] = {
 	{VGA_GFX_I, 0x08, 0xFF, 0xFF }
 };
 
-static void via_iga_common_init(struct pci_dev *pdev, void __iomem *regs)
+static void via_iga_common_init(struct drm_device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev->dev);
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	/* Be careful with 3C5.15[5] - Wrap Around Disable.
@@ -77,7 +80,7 @@ static void via_iga_common_init(struct pci_dev *pdev, void __iomem *regs)
 	 * 3C5.15[1]   - Extended Display Mode Enable
 	 *               0: Disable
 	 *               1: Enable */
-	svga_wseq_mask(regs, 0x15, BIT(5) | BIT(1), BIT(5) | BIT(1));
+	svga_wseq_mask(VGABASE, 0x15, BIT(5) | BIT(1), BIT(5) | BIT(1));
 
 	/*
 	 * It was observed on NeoWare CA10 thin client with DVI that not
@@ -85,7 +88,7 @@ static void via_iga_common_init(struct pci_dev *pdev, void __iomem *regs)
 	 * distorted.
 	 */
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
-		svga_wcrt_mask(regs, 0x55, 0x00, BIT(7));
+		svga_wcrt_mask(VGABASE, 0x55, 0x00, BIT(7));
 	}
 
 	/*
@@ -97,7 +100,7 @@ static void via_iga_common_init(struct pci_dev *pdev, void __iomem *regs)
 	 *               0: Disable
 	 *               1: Enable
 	 */
-	svga_wcrt_mask(regs, 0x6B, 0x00, BIT(3));
+	svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -1758,7 +1761,7 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
 			via_set_vclock(crtc, pll_regs);
 		}
 
-		via_iga_common_init(pdev, VGABASE);
+		via_iga_common_init(dev);
 
 		/* Set palette LUT to 8-bit mode. */
 		via_iga1_set_palette_lut_resolution(VGABASE, true);
@@ -1787,7 +1790,7 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
 			via_set_vclock(crtc, pll_regs);
 		}
 
-		via_iga_common_init(pdev, VGABASE);
+		via_iga_common_init(dev);
 
 		/* Set palette LUT to 8-bit mode. */
 		via_iga2_set_palette_lut_resolution(VGABASE, true);
commit 5599e8c80e1683dbe932dcc7c6237529b28455c9
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Apr 7 17:24:29 2023 -0700

    drm/via: Directly reference pdev->device
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index 4be5ca99aa1f..94d0c8311431 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -422,12 +422,11 @@ void via_dac_probe(struct drm_device *dev)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	u16 chipset = pdev->device;
 	u8 sr13, sr5a;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	switch (chipset) {
+	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_UNICHROME_PRO_II:
 	case PCI_DEVICE_ID_VIA_CHROME9_HC3:
 	case PCI_DEVICE_ID_VIA_CHROME9_HCM:
diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index a59a2c78b058..c4efef83d3c5 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -608,20 +608,19 @@ static void via_lvds_dpms(struct drm_encoder *encoder, int mode)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	/* PCI Device ID */
-	u16 chipset = pdev->device;
-
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
-		via_lvds_power(dev_priv, chipset, enc->di_port, true);
+		via_lvds_power(dev_priv, pdev->device, enc->di_port,
+				true);
 		via_lvds_io_pad_setting(dev_priv, enc->di_port, true);
 		break;
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_OFF:
-		via_lvds_power(dev_priv, chipset, enc->di_port, false);
+		via_lvds_power(dev_priv, pdev->device, enc->di_port,
+				false);
 		via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
 		break;
 	default:
@@ -639,12 +638,9 @@ static void via_lvds_prepare(struct drm_encoder *encoder)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	/* PCI Device ID */
-	u16 chipset = pdev->device;
-
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev_priv, chipset, enc->di_port, false);
+	via_lvds_power(dev_priv, pdev->device, enc->di_port, false);
 	via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -658,12 +654,9 @@ static void via_lvds_commit(struct drm_encoder *encoder)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	/* PCI Device ID */
-	u16 chipset = pdev->device;
-
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev_priv, chipset, enc->di_port, true);
+	via_lvds_power(dev_priv, pdev->device, enc->di_port, true);
 	via_lvds_io_pad_setting(dev_priv, enc->di_port, true);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -679,13 +672,10 @@ via_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	/* PCI Device ID */
-	u16 chipset = pdev->device;
-
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	/* Temporary implementation.*/
-	switch (chipset) {
+	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_CHROME9_HC:
 		via_fpdp_low_set_adjustment(VGABASE, 0x08);
 		break;
@@ -693,7 +683,7 @@ via_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 		break;
 	}
 
-	switch (chipset) {
+	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_UNICHROME_PRO_II:
 	case PCI_DEVICE_ID_VIA_CHROME9_HC3:
 	case PCI_DEVICE_ID_VIA_CHROME9_HCM:
@@ -724,12 +714,9 @@ static void via_lvds_disable(struct drm_encoder *encoder)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	/* PCI Device ID */
-	u16 chipset = pdev->device;
-
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev_priv, chipset, enc->di_port, false);
+	via_lvds_power(dev_priv, pdev->device, enc->di_port, false);
 	via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -947,7 +934,6 @@ void via_lvds_probe(struct drm_device *dev)
 	struct drm_connector connector;
 	struct i2c_adapter *i2c_bus;
 	struct edid *edid;
-	u16 chipset = pdev->device;
 	u8 sr12, sr13, sr5a;
 	u8 cr3b;
 
@@ -957,13 +943,12 @@ void via_lvds_probe(struct drm_device *dev)
 	sr13 = vga_rseq(VGABASE, 0x13);
 	cr3b = vga_rcrt(VGABASE, 0x3b);
 
-	DRM_DEBUG_KMS("chipset: 0x%04x\n", chipset);
 	DRM_DEBUG_KMS("sr12: 0x%02x\n", sr12);
 	DRM_DEBUG_KMS("sr13: 0x%02x\n", sr13);
 	DRM_DEBUG_KMS("cr3b: 0x%02x\n", cr3b);
 
 	/* Detect the presence of FPs. */
-	switch (chipset) {
+	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_CLE266_GFX:
 		/*
 		 * 3C5.12[4] - FPD17 pin strapping (DIP1)
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index fdae87f8c2fb..d532c8dfb8db 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -458,13 +458,12 @@ void via_tmds_probe(struct drm_device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-	u16 chipset = pdev->device;
 	u8 sr13, sr5a;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	/* Detect the presence of integrated TMDS transmitter. */
-	switch (chipset) {
+	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_UNICHROME_PRO_II:
 	case PCI_DEVICE_ID_VIA_CHROME9_HC3:
 		sr5a = vga_rseq(VGABASE, 0x5a);
@@ -588,7 +587,6 @@ void via_ext_dvi_probe(struct drm_device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
-	u16 chipset = pdev->device;
 	u8 sr12, sr13;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -635,7 +633,7 @@ void via_ext_dvi_probe(struct drm_device *dev)
 	DRM_DEBUG_KMS("SR13: 0x%02x\n", sr13);
 
 	if (dev_priv->ext_tmds_presence) {
-		switch (chipset) {
+		switch (pdev->device) {
 		case PCI_DEVICE_ID_VIA_CLE266_GFX:
 			/* 3C5.12[5] - FPD18 pin strapping (DIP0)
 			 *             0: DVI


More information about the openchrome-devel mailing list