[Openchrome-devel] drm-openchrome: Branch 'drm-next-3.19' - 13 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Fri Oct 27 05:43:41 UTC 2017
drivers/gpu/drm/openchrome/crtc_hw.h | 94 ++++++++++++++++++++++++++++
drivers/gpu/drm/openchrome/via_drv.h | 4 -
drivers/gpu/drm/openchrome/via_fp.c | 116 +++++++++++++++++++++++++++++++----
3 files changed, 200 insertions(+), 14 deletions(-)
New commits:
commit ea60dfd59f2fd45a85cfd9f792bd86258c7c3e66
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 22:40:28 2017 -0700
Version bumped to 3.0.51
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_drv.h b/drivers/gpu/drm/openchrome/via_drv.h
index 028fa163adc4..977bffbbc9fb 100644
--- a/drivers/gpu/drm/openchrome/via_drv.h
+++ b/drivers/gpu/drm/openchrome/via_drv.h
@@ -30,11 +30,11 @@
#define DRIVER_AUTHOR "OpenChrome Project"
#define DRIVER_NAME "openchrome"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20171022"
+#define DRIVER_DATE "20171026"
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 50
+#define DRIVER_PATCHLEVEL 51
#include <linux/module.h>
commit 045bbcc98a032eb9acbe3bdc2d76e086d268cf52
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 22:32:34 2017 -0700
Improve CX700 / VX800 / VX855 / VX900 mode setting
Actively set output format and dithering when mode setting
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fp.c b/drivers/gpu/drm/openchrome/via_fp.c
index 43a198f04440..017ade4a5d62 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -819,7 +819,7 @@ via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
/* PCI Device ID */
u16 chipset = encoder->dev->pdev->device;
- DRM_DEBUG_KMS("Entered via_fp_mode_set.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
syncreg |= BIT(6);
@@ -864,9 +864,27 @@ via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
break;
}
+ switch (chipset) {
+ case PCI_DEVICE_ID_VIA_VT3157:
+ case PCI_DEVICE_ID_VIA_VT1122:
+ case PCI_DEVICE_ID_VIA_VX875:
+ case PCI_DEVICE_ID_VIA_VX900_VGA:
+ /* OPENLDI Mode */
+ via_fp_format(dev_priv, enc->di_port, 0x01);
+
+ /* Sequential Mode */
+ via_fp_output_format(dev_priv, enc->di_port, 0x01);
+
+ /* Turn on dithering. */
+ via_fp_dithering(dev_priv, enc->di_port, true);
+ break;
+ default:
+ break;
+ }
+
via_fp_display_source(dev_priv, enc->di_port, iga->index);
- DRM_DEBUG_KMS("Exiting via_fp_mode_set.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void via_fp_disable(struct drm_encoder *encoder)
commit ec9528cad95581900fd5677132aae59ac390e87c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 20:15:39 2017 -0700
Add via_fp_dithering
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fp.c b/drivers/gpu/drm/openchrome/via_fp.c
index b0c57bc1a886..43a198f04440 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -601,6 +601,30 @@ static void via_fp_output_format(struct via_device *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
+static void via_fp_dithering(struct via_device *dev_priv,
+ u32 di_port, bool dithering)
+{
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ switch(di_port) {
+ case VIA_DI_PORT_LVDS1:
+ via_lvds1_set_dithering(VGABASE, dithering);
+ break;
+ case VIA_DI_PORT_LVDS2:
+ via_lvds2_set_dithering(VGABASE, dithering);
+ break;
+ case (VIA_DI_PORT_LVDS1 |
+ VIA_DI_PORT_LVDS2):
+ via_lvds1_set_dithering(VGABASE, dithering);
+ via_lvds2_set_dithering(VGABASE, dithering);
+ break;
+ default:
+ break;
+ }
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
/*
* Sets flat panel display source.
*/
commit 70a2bda5b5dd35af221c009b1aa436d9d9c2be28
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 20:05:56 2017 -0700
Add via_lvds2_set_dithering
This is an inline function.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/crtc_hw.h b/drivers/gpu/drm/openchrome/crtc_hw.h
index 059adaaf87b5..b172846a2e24 100644
--- a/drivers/gpu/drm/openchrome/crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/crtc_hw.h
@@ -907,6 +907,23 @@ via_lvds2_set_output_format(void __iomem *regs, u8 output_format)
}
/*
+ * Sets LVDS2 output color dithering (18-bit color display vs.
+ * 24-bit color display).
+ */
+static inline void
+via_lvds2_set_dithering(void __iomem *regs, bool dithering)
+{
+ /* 3X5.D4[6] - LVDS Channel 2 Output Bits
+ * 0: 24 bits (dithering off)
+ * 1: 18 bits (dithering on) */
+ svga_wcrt_mask(regs, 0xd4,
+ dithering ? BIT(6) : 0x00, BIT(6));
+ DRM_DEBUG_KMS("LVDS2 Color Dithering: %s\n",
+ dithering ?
+ "On (18 bit color)" : "Off (24 bit color)");
+}
+
+/*
* Sets LVDS2 display source.
*/
static inline void
commit cbd96601c4db3baaf9b36f23a892fba7be49d2a8
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 20:02:14 2017 -0700
Add via_lvds1_set_dithering
This is an inline function.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/crtc_hw.h b/drivers/gpu/drm/openchrome/crtc_hw.h
index 7a6175fd45b3..059adaaf87b5 100644
--- a/drivers/gpu/drm/openchrome/crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/crtc_hw.h
@@ -808,6 +808,23 @@ via_lvds1_set_output_format(void __iomem *regs, u8 output_format)
}
/*
+ * Sets LVDS1 output color dithering (18-bit color display vs.
+ * 24-bit color display).
+ */
+static inline void
+via_lvds1_set_dithering(void __iomem *regs, bool dithering)
+{
+ /* 3X5.88[0] - LVDS Channel 1 Output Bits
+ * 0: 24 bits (dithering off)
+ * 1: 18 bits (dithering on) */
+ svga_wcrt_mask(regs, 0x88,
+ dithering ? BIT(0) : 0x00, BIT(0));
+ DRM_DEBUG_KMS("LVDS1 Color Dithering: %s\n",
+ dithering ?
+ "On (18 bit color)" : "Off (24 bit color)");
+}
+
+/*
* Sets LVDS1 display source.
*/
static inline void
commit 0e8f0d96c9a5716217d2d640a67e5615534cb627
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 16:31:03 2017 -0700
Add via_fp_output_format
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fp.c b/drivers/gpu/drm/openchrome/via_fp.c
index 7373e1f0c44f..b0c57bc1a886 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -575,6 +575,32 @@ static void via_fp_format(struct via_device *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
+static void via_fp_output_format(struct via_device *dev_priv,
+ u32 di_port, u8 output_format)
+{
+ u8 temp = output_format & 0x01;
+
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ switch(di_port) {
+ case VIA_DI_PORT_LVDS1:
+ via_lvds1_set_output_format(VGABASE, temp);
+ break;
+ case VIA_DI_PORT_LVDS2:
+ via_lvds2_set_output_format(VGABASE, temp);
+ break;
+ case (VIA_DI_PORT_LVDS1 |
+ VIA_DI_PORT_LVDS2):
+ via_lvds1_set_output_format(VGABASE, temp);
+ via_lvds2_set_output_format(VGABASE, temp);
+ break;
+ default:
+ break;
+ }
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
/*
* Sets flat panel display source.
*/
commit 2c21a076460b07e960a76359c2167aecd8d4c70d
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 16:28:58 2017 -0700
Add via_fp_format
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fp.c b/drivers/gpu/drm/openchrome/via_fp.c
index 5b0a323cf601..7373e1f0c44f 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -549,6 +549,31 @@ static void via_fp_io_pad_setting(struct via_device *dev_priv, u32 di_port, bool
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
+static void via_fp_format(struct via_device *dev_priv,
+ u32 di_port, u8 format)
+{
+ u8 temp = format & 0x01;
+
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ switch(di_port) {
+ case VIA_DI_PORT_LVDS1:
+ via_lvds1_set_format(VGABASE, temp);
+ break;
+ case VIA_DI_PORT_LVDS2:
+ via_lvds2_set_format(VGABASE, temp);
+ break;
+ case (VIA_DI_PORT_LVDS1 |
+ VIA_DI_PORT_LVDS2):
+ via_lvds1_set_format(VGABASE, temp);
+ via_lvds2_set_format(VGABASE, temp);
+ break;
+ default:
+ break;
+ }
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
/*
* Sets flat panel display source.
commit 318a8e9e8daa6d66ae5ce82b4309e141b549af09
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 16:07:47 2017 -0700
Add via_lvds2_set_output_format
This is an inline function.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/crtc_hw.h b/drivers/gpu/drm/openchrome/crtc_hw.h
index ca1f1965d79f..7a6175fd45b3 100644
--- a/drivers/gpu/drm/openchrome/crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/crtc_hw.h
@@ -875,6 +875,21 @@ via_lvds2_set_format(void __iomem *regs, u8 format)
}
/*
+ * Sets LVDS2 output format (rotation or sequential mode).
+ */
+static inline void
+via_lvds2_set_output_format(void __iomem *regs, u8 output_format)
+{
+ /* 3X5.D4[7] - LVDS Channel 2 Output Format
+ * 0: Rotation
+ * 1: Sequential */
+ svga_wcrt_mask(regs, 0xd4, output_format << 7, BIT(7));
+ DRM_DEBUG_KMS("LVDS2 Output Format: %s\n",
+ (output_format & BIT(0)) ?
+ "Sequential" : "Rotation");
+}
+
+/*
* Sets LVDS2 display source.
*/
static inline void
commit 641f95f2710c1448c6340ead223c5eae026880cc
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 16:06:14 2017 -0700
Add via_lvds2_set_format
This is an inline function.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/crtc_hw.h b/drivers/gpu/drm/openchrome/crtc_hw.h
index bf02aa9a3955..ca1f1965d79f 100644
--- a/drivers/gpu/drm/openchrome/crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/crtc_hw.h
@@ -861,6 +861,20 @@ via_lvds2_set_io_pad_setting(void __iomem *regs, u8 io_pad_state)
}
/*
+ * Sets LVDS2 format.
+ */
+static inline void
+via_lvds2_set_format(void __iomem *regs, u8 format)
+{
+ /* 3X5.D2[0] - LVDS Channel 2 Format Selection
+ * 0: SPWG Mode
+ * 1: OPENLDI Mode */
+ svga_wcrt_mask(regs, 0xd2, format, BIT(0));
+ DRM_DEBUG_KMS("LVDS2 Format: %s\n",
+ (format & BIT(0)) ? "OPENLDI" : "SPWG");
+}
+
+/*
* Sets LVDS2 display source.
*/
static inline void
commit 87307d795f12c387e3b02eeba0641d006957969c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Oct 26 15:52:24 2017 -0700
Add via_lvds1_set_output_format
This is an inline function.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/crtc_hw.h b/drivers/gpu/drm/openchrome/crtc_hw.h
index 9dd92dde51bc..bf02aa9a3955 100644
--- a/drivers/gpu/drm/openchrome/crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/crtc_hw.h
@@ -792,6 +792,22 @@ via_lvds1_set_format(void __iomem *regs, u8 format)
}
/*
+ * Sets LVDS1 output format (rotation or sequential mode).
+ */
+static inline void
+via_lvds1_set_output_format(void __iomem *regs, u8 output_format)
+{
+ /* 3X5.88[6] - LVDS Channel 1 Output Format
+ * 0: Rotation
+ * 1: Sequential */
+ svga_wcrt_mask(regs, 0x88,
+ output_format << 6, BIT(6));
+ DRM_DEBUG_KMS("LVDS1 Output Format: %s\n",
+ (output_format & BIT(0)) ?
+ "Sequential" : "Rotation");
+}
+
+/*
* Sets LVDS1 display source.
*/
static inline void
commit c51a81d98ec73ccfda2f9555a1648dcd276c7257
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Oct 25 19:43:05 2017 -0700
Add via_lvds1_set_format
This is an inline function.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/crtc_hw.h b/drivers/gpu/drm/openchrome/crtc_hw.h
index 130cdc133098..9dd92dde51bc 100644
--- a/drivers/gpu/drm/openchrome/crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/crtc_hw.h
@@ -777,6 +777,21 @@ via_lvds1_set_io_pad_setting(void __iomem *regs, u8 io_pad_state)
}
/*
+ * Sets LVDS1 format.
+ */
+static inline void
+via_lvds1_set_format(void __iomem *regs, u8 format)
+{
+ /* 3X5.D2[1] - LVDS Channel 1 Format Selection
+ * 0: SPWG Mode
+ * 1: OPENLDI Mode */
+ svga_wcrt_mask(regs, 0xd2,
+ format << 1, BIT(1));
+ DRM_DEBUG_KMS("LVDS1 Format: %s\n",
+ (format & BIT(0)) ? "OPENLDI" : "SPWG");
+}
+
+/*
* Sets LVDS1 display source.
*/
static inline void
commit a1bdc6a1fe393c2f19fda8bada45be6b62d96a18
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun Oct 22 21:39:06 2017 -0500
Tweaks to via_fp_dpms
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fp.c b/drivers/gpu/drm/openchrome/via_fp.c
index 7736fba5b14b..5b0a323cf601 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -618,8 +618,8 @@ static void via_fp_dpms(struct drm_encoder *encoder, int mode)
via_fp_power(dev_priv, chipset, enc->di_port, true);
via_fp_io_pad_setting(dev_priv, enc->di_port, true);
break;
- case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_SUSPEND:
+ case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_OFF:
via_fp_power(dev_priv, chipset, enc->di_port, false);
via_fp_io_pad_setting(dev_priv, enc->di_port, false);
commit 64a3cf92c9e7f84cdb02711266735128defbb7a0
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun Oct 22 21:25:29 2017 -0500
Rename via_fp_io_pad_state to via_fp_io_pad_setting
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fp.c b/drivers/gpu/drm/openchrome/via_fp.c
index 7d91f06b2dc6..7736fba5b14b 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -507,10 +507,9 @@ via_fp_power(struct via_device *dev_priv, unsigned short device,
/*
* Sets flat panel I/O pad state.
*/
-static void
-via_fp_io_pad_state(struct via_device *dev_priv, u32 di_port, bool io_pad_on)
+static void via_fp_io_pad_setting(struct via_device *dev_priv, u32 di_port, bool io_pad_on)
{
- DRM_DEBUG_KMS("Entered via_fp_io_pad_state.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
switch(di_port) {
case VIA_DI_PORT_DVP0:
@@ -547,7 +546,7 @@ via_fp_io_pad_state(struct via_device *dev_priv, u32 di_port, bool io_pad_on)
DRM_DEBUG_KMS("FP I/O Pad: %s\n", io_pad_on ? "On": "Off");
- DRM_DEBUG_KMS("Exiting via_fp_io_pad_state.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -617,13 +616,13 @@ static void via_fp_dpms(struct drm_encoder *encoder, int mode)
switch (mode) {
case DRM_MODE_DPMS_ON:
via_fp_power(dev_priv, chipset, enc->di_port, true);
- via_fp_io_pad_state(dev_priv, enc->di_port, true);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, true);
break;
case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_OFF:
via_fp_power(dev_priv, chipset, enc->di_port, false);
- via_fp_io_pad_state(dev_priv, enc->di_port, false);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, false);
break;
default:
break;
@@ -710,7 +709,7 @@ static void via_fp_prepare(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Entered %s.", __func__);
via_fp_power(dev_priv, chipset, enc->di_port, false);
- via_fp_io_pad_state(dev_priv, enc->di_port, false);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -728,7 +727,7 @@ static void via_fp_commit(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Entered %s.", __func__);
via_fp_power(dev_priv, chipset, enc->di_port, true);
- via_fp_io_pad_state(dev_priv, enc->di_port, true);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, true);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -808,7 +807,7 @@ static void via_fp_disable(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Entered %s.", __func__);
via_fp_power(dev_priv, chipset, enc->di_port, false);
- via_fp_io_pad_state(dev_priv, enc->di_port, false);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
More information about the Openchrome-devel
mailing list