[Openchrome-devel] drm-openchrome: 4 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Wed Apr 5 01:53:04 UTC 2017
drivers/gpu/drm/via/crtc_hw.h | 14 ++++++++
drivers/gpu/drm/via/via_analog.c | 62 +++++++++++++++++++++++++--------------
drivers/gpu/drm/via/via_drv.h | 4 +-
3 files changed, 57 insertions(+), 23 deletions(-)
New commits:
commit da9b5fa8b949a8dcb49c909dc8f3cb32a36f3dea
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Apr 4 18:52:24 2017 -0700
Version bumped to 3.0.26
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 781d2a5572e..9a84b3312fe 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 "20170329"
+#define DRIVER_DATE "20170404"
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 25
+#define DRIVER_PATCHLEVEL 26
#include <linux/module.h>
commit 1bd4f131566a7b47d8b68d04e9fe1c2953f2242b
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Apr 4 18:51:01 2017 -0700
Rename via_dac_dpms as via_analog_dpms
Also, update the code so that DAC can be turned on / off correctly.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/via_analog.c b/drivers/gpu/drm/via/via_analog.c
index 1263201f977..47ae89766fa 100644
--- a/drivers/gpu/drm/via/via_analog.c
+++ b/drivers/gpu/drm/via/via_analog.c
@@ -49,28 +49,31 @@ static const struct drm_encoder_funcs via_dac_enc_funcs = {
.destroy = via_encoder_cleanup,
};
-/* Manage the power state of the DAC */
+/*
+ * Manage the power state of analog (VGA) DAC.
+ */
static void
-via_dac_dpms(struct drm_encoder *encoder, int mode)
+via_analog_dpms(struct drm_encoder *encoder, int mode)
{
- struct via_device *dev_priv = encoder->dev->dev_private;
- u8 mask = 0;
-
- switch (mode) {
- case DRM_MODE_DPMS_SUSPEND:
- mask = BIT(5); /* VSync off */
- break;
- case DRM_MODE_DPMS_STANDBY:
- mask = BIT(4); /* HSync off */
- break;
- case DRM_MODE_DPMS_OFF:
- mask = (BIT(5) | BIT(4));/* HSync and VSync off */
- break;
- case DRM_MODE_DPMS_ON:
- default:
- break;
- }
- svga_wcrt_mask(VGABASE, 0x36, mask, BIT(5) | BIT(4));
+ struct via_device *dev_priv = encoder->dev->dev_private;
+
+ DRM_DEBUG("Entered via_analog_dpms.\n");
+
+ switch (mode) {
+ case DRM_MODE_DPMS_ON:
+ viaAnalogOutput(dev_priv, true);
+ break;
+ case DRM_MODE_DPMS_SUSPEND:
+ case DRM_MODE_DPMS_STANDBY:
+ case DRM_MODE_DPMS_OFF:
+ viaAnalogOutput(dev_priv, false);
+ break;
+ default:
+ DRM_ERROR("Bad DPMS mode.");
+ break;
+ }
+
+ DRM_DEBUG("Exiting via_analog_dpms.\n");
}
/* Pass our mode to the connectors and the CRTC to give them a chance to
@@ -87,7 +90,7 @@ via_dac_mode_fixup(struct drm_encoder *encoder,
}
static const struct drm_encoder_helper_funcs via_dac_enc_helper_funcs = {
- .dpms = via_dac_dpms,
+ .dpms = via_analog_dpms,
.mode_fixup = via_dac_mode_fixup,
.mode_set = via_set_sync_polarity,
.prepare = via_encoder_prepare,
commit 72d0e69e62adee0798f5379b1e6bc4642f1139bd
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Apr 4 17:48:25 2017 -0700
Added viaAnalogOutput
This function was added to via_analog.c.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/via_analog.c b/drivers/gpu/drm/via/via_analog.c
index 8c150b45157..1263201f977 100644
--- a/drivers/gpu/drm/via/via_analog.c
+++ b/drivers/gpu/drm/via/via_analog.c
@@ -24,6 +24,23 @@
* James Simmons <jsimmons at infradead.org>
*/
#include "via_drv.h"
+#include "crtc_hw.h"
+
+
+/*
+ * Enables or disables analog (VGA) output.
+ */
+static void
+viaAnalogOutput(struct via_device *dev_priv, bool outputState)
+{
+ DRM_DEBUG("Entered viaAnalogOutput.\n");
+
+ viaAnalogSetDACOutput(VGABASE, outputState);
+ DRM_INFO("Analog (VGA) Output: %s\n", outputState ? "On" : "Off");
+
+ DRM_DEBUG("Exiting viaAnalogOutput.\n");
+}
+
/*
* Routines for controlling stuff on the analog port
commit 5286df24ca47bf61babe54f83614a1bbde26ff5c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Apr 4 17:38:14 2017 -0700
Added viaAnalogSetDACOutput
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 a893f516486..adc737b2e71 100644
--- a/drivers/gpu/drm/via/crtc_hw.h
+++ b/drivers/gpu/drm/via/crtc_hw.h
@@ -87,6 +87,20 @@ static inline void svga_wcrt_mask(void __iomem *regbase, u8 index, u8 data, u8 m
***********************************************************************/
/*
+ * Sets analog (VGA) DAC output state.
+ */
+static inline void
+viaAnalogSetDACOutput(void __iomem *regs, bool outputState)
+{
+ /* Set analog (VGA) DAC output state. */
+ /* 3X5.47[2] - DACOFF Backdoor Register
+ * 0: DAC on
+ * 1: DAC off */
+ svga_wcrt_mask(regs, 0x47, outputState ? 0x00 : BIT(2), BIT(2));
+ DRM_DEBUG("Analog (VGA) DAC Output: %s\n", outputState ? "On" : "Off");
+}
+
+/*
* Sets CX700 or later single chipset's LVDS1 power sequence type.
*/
static inline void
More information about the Openchrome-devel
mailing list