[Openchrome-devel] drm-openchrome: Branch 'drm-next-4.13' - 13 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Fri Oct 27 20:46:36 UTC 2017


 drivers/gpu/drm/openchrome/crtc_hw.h |   94 ++++++++++++++++++++++++++++
 drivers/gpu/drm/openchrome/via_drv.h |    2 
 drivers/gpu/drm/openchrome/via_fp.c  |  116 +++++++++++++++++++++++++++++++----
 3 files changed, 199 insertions(+), 13 deletions(-)

New commits:
commit b4ca2845b82a2baee94f4fe9ee8bc42ff6922b45
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:39:13 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 a29409192937..371aee96f6ae 100644
--- a/drivers/gpu/drm/openchrome/via_drv.h
+++ b/drivers/gpu/drm/openchrome/via_drv.h
@@ -34,7 +34,7 @@
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		0
-#define DRIVER_PATCHLEVEL	50
+#define DRIVER_PATCHLEVEL	51
 
 #include <linux/module.h>
 
commit 3c95e4064c59188fa4537c9b32a1dc8dc691e842
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:37:04 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 21466dca7187..8c9c2ced8f5b 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 8bbac60c271e533526e504c947e3e2ffb0ab6e23
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:34:31 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 b55c08b74712..21466dca7187 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 cb11d9268cb69ff1d4c706693576d88a16581c03
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:32:37 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 db46bd7871c2bc66f0268ec4dda408075e246ce1
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:30:10 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 f4cc44aedcfc9b906c9c83f5cc6af7285755643e
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:27:58 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 dd8d8efd4ff6..b55c08b74712 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 4e1e44e828f5c5cce90df421451a2fe5bdcf1d56
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:25:14 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 ba9f0e3ff54b..dd8d8efd4ff6 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 c3c4bb45751a19005a2a3053730e5a854b81b6eb
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:23:44 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 46bedb88deaf78d89bba45990ae14d2582c68201
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:20:33 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 0c39a9bf97502d4c54a512392fb9520203ab7cca
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:19:02 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 c86786215d92d75bef37a5eca8405361b0244079
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:17:26 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 77240f2eb37a523be8cca3e4c689edb884688bc5
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:14:01 2017 -0700

    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 d2fbe6689368..ba9f0e3ff54b 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 59d1d18e05f1187fb815d35f622ee58635daff1f
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 27 13:12:10 2017 -0700

    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 8df2ffecdf84..d2fbe6689368 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