[Openchrome-devel] drm-openchrome: 10 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Thu Mar 30 07:42:57 UTC 2017
drivers/gpu/drm/via/crtc_hw.h | 91 ++++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/via/via_display.c | 17 +++----
drivers/gpu/drm/via/via_drv.h | 4 -
drivers/gpu/drm/via/via_tmds.c | 75 +++++++++++++++----------------
4 files changed, 139 insertions(+), 48 deletions(-)
New commits:
commit c321fd0786cda0ffc2910e298dab5ebf5cad8203
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Mar 30 00:41:08 2017 -0700
Version bumped to 3.0.25
This version adds initial support for CX700 / VX700 and VX800 chipsets'
integrated TMDS (DVI) transmitter.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 5968ad003cb..781d2a5572e 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -30,11 +30,11 @@
#define DRIVER_AUTHOR "The OpenChrome Project"
#define DRIVER_NAME "via"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20170302"
+#define DRIVER_DATE "20170329"
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 24
+#define DRIVER_PATCHLEVEL 25
#include <linux/module.h>
commit 59afeeb741393b0348bf13f347ae7cc941d772d4
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Mar 30 00:39:24 2017 -0700
Updating copyright notice of via_tmds.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 31399a3fb88..d5f244acb7b 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2016-2017 Kevin Brace
* Copyright © 2013 James Simmons
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -21,6 +22,7 @@
* DEALINGS IN THE SOFTWARE.
*
* Authors:
+ * Kevin Brace <kevinbrace at gmx.com>
* James Simmons <jsimmons at infradead.org>
*/
commit c7e4f1e122e8497d900cd53da83d8a4e9dd72a7f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Mar 30 00:36:29 2017 -0700
Fix for CX700 / VX700 and VX800 integrated TMDS (DVI) transmitter
There were number of issues related to correctly initializing CX700 /
VX700 and VX800 chipsets’ integrated TMDS (DVI) transmitter.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/via_display.c b/drivers/gpu/drm/via/via_display.c
index 236470a2e4a..b40109cb267 100644
--- a/drivers/gpu/drm/via/via_display.c
+++ b/drivers/gpu/drm/via/via_display.c
@@ -532,20 +532,21 @@ via_modeset_init(struct drm_device *dev)
via_lvds_init(dev);
switch (dev->pdev->device) {
- /* CX700 can support HDMI and non HDMI based DVI ports */
+ /* Only CX700 / VX700 and VX800 have an integrated TMDS (DVI)
+ * transmitter. */
case PCI_DEVICE_ID_VIA_VT3157:
- if (!via_tmds_init(dev))
- break;
-
- /* Newer platforms use HDMI encoder */
case PCI_DEVICE_ID_VIA_VT1122:
- case PCI_DEVICE_ID_VIA_VX875:
+ via_tmds_init(dev);
+ break;
+ default:
+ break;
+ }
+
+ switch (dev->pdev->device) {
case PCI_DEVICE_ID_VIA_VX900_VGA:
via_hdmi_init(dev, DISP_DI_NONE);
break;
-
default:
- via_tmds_init(dev);
break;
}
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 3ea1b187932..31399a3fb88 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -150,7 +150,7 @@ via_tmds_init(struct drm_device *dev)
struct via_device *dev_priv = dev->dev_private;
struct via_connector *con;
struct via_encoder *enc;
- int i2c_port = 0x3D;
+ int i2c_port = 0x31;
if (!(vga_rseq(VGABASE, 0x3E) & BIT(5))) {
DRM_INFO("Internal DVI not detected\n");
@@ -178,18 +178,6 @@ via_tmds_init(struct drm_device *dev)
drm_connector_helper_add(&con->base, &via_dvi_connector_helper_funcs);
drm_connector_register(&con->base);
- switch (dev->pdev->device) {
- case PCI_DEVICE_ID_VIA_VT1122:
- if (dev_priv->revision < VX800_REVISION_B1)
- break;
-
- case PCI_DEVICE_ID_VIA_VX875:
- case PCI_DEVICE_ID_VIA_VX900_VGA:
- i2c_port = 0x31;
- break;
- default:
- break;
- }
con->ddc_bus = via_find_ddc_bus(i2c_port);
con->base.doublescan_allowed = false;
con->base.interlace_allowed = true;
commit f28a7cb1f91f2ee87da1dc844bd08cfc91a81e9b
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Mar 30 00:35:16 2017 -0700
Added viaTMDSPower
This function was added to via_tmds.c. Also, via_tmds_dpms callback
function's code was updated to utilize viaTMDSPower function.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index d325860ca73..3ea1b187932 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -26,6 +26,34 @@
#include "via_drv.h"
+static void
+viaTMDSPower(struct via_device *dev_priv,
+ bool powerState)
+{
+ DRM_DEBUG("Entered viaTMDSPower.\n");
+
+ if (powerState) {
+ /* Software control for LVDS1 power sequence. */
+ viaLVDS1SetPowerSeq(VGABASE, true);
+
+ viaLVDS1SetSoftDisplayPeriod(VGABASE, true);
+ viaLVDS1SetSoftData(VGABASE, true);
+ viaTMDSSetPower(VGABASE, true);
+ } else {
+ /* Software control for LVDS1 power sequence. */
+ viaLVDS1SetPowerSeq(VGABASE, true);
+
+ viaTMDSSetPower(VGABASE, false);
+ viaLVDS1SetSoftData(VGABASE, false);
+ viaLVDS1SetSoftDisplayPeriod(VGABASE, false);
+ }
+
+ DRM_INFO("Integrated TMDS (DVI) Power: %s\n",
+ powerState ? "On" : "Off");
+
+ DRM_DEBUG("Exiting viaTMDSPower.\n");
+}
+
/*
* Routines for controlling stuff on the TMDS port
*/
@@ -39,28 +67,23 @@ via_tmds_dpms(struct drm_encoder *encoder, int mode)
{
struct via_device *dev_priv = encoder->dev->dev_private;
+ DRM_DEBUG("Entered via_tmds_dpms.\n");
+
switch (mode) {
case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_OFF:
- svga_wcrt_mask(VGABASE, 0xD2, BIT(4), BIT(4));
- svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(0));
-
- /* Internal TMDS only use DFP_L */
- /* Turn on DVI panel path(Only for internal),
- * otherwise, the screen of DVI will be black. */
- svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(7));
- /* Power on TMDS */
- svga_wcrt_mask(VGABASE, 0xD2, 0x00, BIT(3));
+ viaTMDSPower(dev_priv, false);
break;
-
case DRM_MODE_DPMS_ON:
- default:
- svga_wcrt_mask(VGABASE, 0x91, BIT(7), BIT(7));
- /* Power off TMDS */
- svga_wcrt_mask(VGABASE, 0xD2, BIT(3), BIT(3));
+ viaTMDSPower(dev_priv, true);
break;
+ default:
+ DRM_ERROR("Bad DPMS mode.");
+ break;
}
+
+ DRM_DEBUG("Exiting via_tmds_dpms.\n");
}
/* Pass our mode to the connectors and the CRTC to give them a chance to
commit b7b9182da83906e06ca611bc5ca3f9b9373cc024
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Mar 30 00:15:04 2017 -0700
Added viaTMDSSetPower
This inline function was added to crtc_hw.h.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/crtc_hw.h b/drivers/gpu/drm/via/crtc_hw.h
index b3868392344..a893f516486 100644
--- a/drivers/gpu/drm/via/crtc_hw.h
+++ b/drivers/gpu/drm/via/crtc_hw.h
@@ -149,6 +149,21 @@ viaLVDS1SetSoftDisplayPeriod(void __iomem *regs, bool softOn)
softOn ? "On" : "Off");
}
+/*
+ * Sets CX700 / VX700 and VX800 chipsets' TMDS (DVI) power state.
+ */
+static inline void
+viaTMDSSetPower(void __iomem *regs, bool powerState)
+{
+ /* Set TMDS (DVI) power state. */
+ /* 3X5.D2[3] - Power Down (Active High) for DVI
+ * 0: TMDS power on
+ * 1: TMDS power down */
+ svga_wcrt_mask(regs, 0xD2, powerState ? 0 : BIT(3), BIT(3));
+ DRM_DEBUG("TMDS (DVI) Power State: %s\n",
+ powerState ? "On" : "Off");
+}
+
extern void load_register_tables(void __iomem *regbase, struct vga_registers *regs);
extern void load_value_to_registers(void __iomem *regbase, struct vga_registers *regs,
commit 98144190b9e8ae6fae8a6433b8e7145536af2988
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Mar 29 20:32:37 2017 -0700
Added viaLVDS1SetSoftDisplayPeriod
This inline function was added to crtc_hw.h.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/crtc_hw.h b/drivers/gpu/drm/via/crtc_hw.h
index 1d96a10c6ad..b3868392344 100644
--- a/drivers/gpu/drm/via/crtc_hw.h
+++ b/drivers/gpu/drm/via/crtc_hw.h
@@ -132,6 +132,23 @@ viaLVDS1SetSoftVdd(void __iomem *regs, bool softOn)
softOn ? "On" : "Off");
}
+/*
+ * Sets CX700 or later single chipset's LVDS1 software controlled
+ * display period.
+ */
+static inline void
+viaLVDS1SetSoftDisplayPeriod(void __iomem *regs, bool softOn)
+{
+ /* Set LVDS1 software controlled display period state. */
+ /* 3X5.91[7] - Software Direct On / Off Display Period
+ * in the Panel Path
+ * 0: On
+ * 1: Off */
+ svga_wcrt_mask(regs, 0x91, softOn ? 0 : BIT(7), BIT(7));
+ DRM_DEBUG("LVDS1 Software Controlled Display Period: %s\n",
+ softOn ? "On" : "Off");
+}
+
extern void load_register_tables(void __iomem *regbase, struct vga_registers *regs);
extern void load_value_to_registers(void __iomem *regbase, struct vga_registers *regs,
commit a3e4b914d69327e8c5a2afc1e4d5134d30e404d3
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Mar 29 20:28:58 2017 -0700
Added viaLVDS1SetSoftVdd
This inline function was added to crtc_hw.h.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/crtc_hw.h b/drivers/gpu/drm/via/crtc_hw.h
index 7cc9c964d66..1d96a10c6ad 100644
--- a/drivers/gpu/drm/via/crtc_hw.h
+++ b/drivers/gpu/drm/via/crtc_hw.h
@@ -117,6 +117,21 @@ viaLVDS1SetSoftData(void __iomem *regs, bool softOn)
softOn ? "On" : "Off");
}
+/*
+ * Sets CX700 or later single chipset's LVDS1 software controlled Vdd.
+ */
+static inline void
+viaLVDS1SetSoftVdd(void __iomem *regs, bool softOn)
+{
+ /* Set LVDS1 software controlled Vdd. */
+ /* 3X5.91[4] - Software VDD On
+ * 0: Off
+ * 1: On */
+ svga_wcrt_mask(regs, 0x91, softOn ? BIT(4) : 0, BIT(4));
+ DRM_DEBUG("LVDS1 Software Controlled Vdd: %s\n",
+ softOn ? "On" : "Off");
+}
+
extern void load_register_tables(void __iomem *regbase, struct vga_registers *regs);
extern void load_value_to_registers(void __iomem *regbase, struct vga_registers *regs,
commit 63968f990353dc5775529398401b791b619f4a37
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Mar 29 20:11:30 2017 -0700
Added viaLVDS1SetSoftData
This inline function was added to crtc_hw.h.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/crtc_hw.h b/drivers/gpu/drm/via/crtc_hw.h
index c5b5e233fa8..7cc9c964d66 100644
--- a/drivers/gpu/drm/via/crtc_hw.h
+++ b/drivers/gpu/drm/via/crtc_hw.h
@@ -101,6 +101,22 @@ viaLVDS1SetPowerSeq(void __iomem *regs, bool softCtrl)
softCtrl ? "Software" : "Hardware");
}
+/*
+ * Sets CX700 or later single chipset's LVDS1 software controlled
+ * data path state.
+ */
+static inline void
+viaLVDS1SetSoftData(void __iomem *regs, bool softOn)
+{
+ /* Set LVDS1 software controlled data path state. */
+ /* 3X5.91[3] - Software Data On
+ * 0: Off
+ * 1: On */
+ svga_wcrt_mask(regs, 0x91, softOn ? BIT(3) : 0, BIT(3));
+ DRM_DEBUG("LVDS1 Software Controlled Data Path: %s\n",
+ softOn ? "On" : "Off");
+}
+
extern void load_register_tables(void __iomem *regbase, struct vga_registers *regs);
extern void load_value_to_registers(void __iomem *regbase, struct vga_registers *regs,
commit 35ee89b502902d1750f7a8d6811dc8d286752beb
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Mar 29 19:52:00 2017 -0700
Added viaLVDS1SetPowerSeq
This inline function was added to crtc_hw.h. Also, included drm/drmP.h
in order to utilize DRM_DEBUG macro.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/crtc_hw.h b/drivers/gpu/drm/via/crtc_hw.h
index 1dd31f3b873..c5b5e233fa8 100644
--- a/drivers/gpu/drm/via/crtc_hw.h
+++ b/drivers/gpu/drm/via/crtc_hw.h
@@ -27,6 +27,8 @@
#include <video/vga.h>
+#include <drm/drmP.h>
+
struct vga_regset {
u16 ioport;
@@ -77,6 +79,29 @@ static inline void svga_wcrt_mask(void __iomem *regbase, u8 index, u8 data, u8 m
vga_wcrt(regbase, index, (data & mask) | (vga_rcrt(regbase, index) & ~mask));
}
+
+/***********************************************************************
+
+ VIA Technologies Chrome IGP Register Access Helper Functions
+
+***********************************************************************/
+
+/*
+ * Sets CX700 or later single chipset's LVDS1 power sequence type.
+ */
+static inline void
+viaLVDS1SetPowerSeq(void __iomem *regs, bool softCtrl)
+{
+ /* Set LVDS1 power sequence type. */
+ /* 3X5.91[0] - LVDS1 Hardware or Software Control Power Sequence
+ * 0: Hardware Control
+ * 1: Software Control */
+ svga_wcrt_mask(regs, 0x91, softCtrl ? BIT(0) : 0, BIT(0));
+ DRM_DEBUG("LVDS1 Power Sequence: %s Control\n",
+ softCtrl ? "Software" : "Hardware");
+}
+
+
extern void load_register_tables(void __iomem *regbase, struct vga_registers *regs);
extern void load_value_to_registers(void __iomem *regbase, struct vga_registers *regs,
unsigned int value);
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 28fc8d456ed..d325860ca73 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -26,20 +26,6 @@
#include "via_drv.h"
-
-static inline void
-viaLVDS1SetPowerSeq(void __iomem *regs, bool softCtrl)
-{
- /* Set LVDS1 power sequence type. */
- /* 3X5.91[0] - LVDS1 Hardware or Software Control Power Sequence
- * 0: Hardware Control
- * 1: Software Control */
- svga_wcrt_mask(regs, 0x91, softCtrl ? BIT(0) : 0, BIT(0));
-
- DRM_DEBUG("LVDS1 Power Sequence: %s Control\n",
- softCtrl ? "Software" : "Hardware");
-}
-
/*
* Routines for controlling stuff on the TMDS port
*/
commit e46ea357203c42cb4d59dfe25de8c6ff746b363c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Mar 29 18:33:43 2017 -0700
Including video/vga.h inside crtc_hw.h
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/crtc_hw.h b/drivers/gpu/drm/via/crtc_hw.h
index a04b4693f56..1dd31f3b873 100644
--- a/drivers/gpu/drm/via/crtc_hw.h
+++ b/drivers/gpu/drm/via/crtc_hw.h
@@ -25,6 +25,9 @@
#ifndef __CRTC_HW_H__
#define __CRTC_HW_H__
+#include <video/vga.h>
+
+
struct vga_regset {
u16 ioport;
u8 io_addr;
More information about the Openchrome-devel
mailing list