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

Kevin Brace kevinbrace at kemper.freedesktop.org
Sat Nov 4 05:02:48 UTC 2017


 drivers/gpu/drm/openchrome/via_display.c |    2 
 drivers/gpu/drm/openchrome/via_display.h |    2 
 drivers/gpu/drm/openchrome/via_drv.h     |    2 
 drivers/gpu/drm/openchrome/via_fp.c      |  216 +++----------------------------
 4 files changed, 30 insertions(+), 192 deletions(-)

New commits:
commit 29915eb9e23df6ea30ac5133de148f9b442ac307
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Nov 3 21:58:01 2017 -0700

    drm/openchrome: Version bumped to 3.0.55
    
    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 c426c885acd4..ff8928be7147 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	54
+#define DRIVER_PATCHLEVEL	55
 
 #include <linux/module.h>
 
commit 8ead00caf42e930329531a72fd7022b5306786b7
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Nov 3 21:50:54 2017 -0700

    drm/openchrome: Remove old FP power on / off code
    
    The new code works much better than this old code.
    
    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 ecf0c00fb9b6..ac1f415685cf 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -28,9 +28,6 @@
 
 #include "via_drv.h"
 
-/* Encoder flags for LVDS */
-#define LVDS_DUAL_CHANNEL	1
-
 #define TD0 200
 #define TD1 25
 #define TD2 0
@@ -77,168 +74,6 @@ via_centering_timing(const struct drm_display_mode *mode,
 }
 
 static void
-via_enable_internal_lvds(struct drm_encoder *encoder)
-{
-	struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
-	struct via_device *dev_priv = encoder->dev->dev_private;
-	struct drm_device *dev = encoder->dev;
-
-	/* Turn on LCD panel */
-	if ((enc->di_port & VIA_DI_PORT_DFPL) || (enc->di_port == VIA_DI_PORT_DVP1)) {
-		if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
-		    (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)) {
-			/* Software control power sequence ON */
-			svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(7));
-			svga_wcrt_mask(VGABASE, 0x91, BIT(0), BIT(0));
-			/* Delay td0 msec. */
-			mdelay(200);
-			/* VDD ON */
-			svga_wcrt_mask(VGABASE, 0x91, BIT(4), BIT(4));
-			/* Delay td1 msec. */
-			mdelay(25);
-			/* DATA ON */
-			svga_wcrt_mask(VGABASE, 0x91, BIT(3), BIT(3));
-			/* VEE ON (unused on vt3353) */
-			svga_wcrt_mask(VGABASE, 0x91, BIT(2), BIT(2));
-			/* Delay td3 msec. */
-			mdelay(250);
-			/* Back-Light ON */
-			svga_wcrt_mask(VGABASE, 0x91, BIT(1), BIT(1));
-		} else {
-			/* Use first power sequence control: *
-			 * Use hardware control power sequence. */
-			svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(0));
-			/* Turn on back light and panel path. */
-			svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(7) | BIT(6));
-			/* Turn on hardware power sequence. */
-			svga_wcrt_mask(VGABASE, 0x6A, BIT(3), BIT(3));
-		}
-	}
-
-	if (enc->di_port & VIA_DI_PORT_DFPH) {
-		if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
-		    (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)) {
-			/* Software control power sequence ON */
-			svga_wcrt_mask(VGABASE, 0xD4, 0x00, BIT(1));
-			svga_wcrt_mask(VGABASE, 0xD3, BIT(0), BIT(0));
-			/* Delay td0 msec. */
-			mdelay(200);
-			/* VDD ON */
-			svga_wcrt_mask(VGABASE, 0xD3, BIT(4), BIT(4));
-			/* Delay td1 msec. */
-			mdelay(25);
-			/* DATA ON */
-			svga_wcrt_mask(VGABASE, 0xD3, BIT(3), BIT(3));
-			/* VEE ON (unused on vt3353) */
-			svga_wcrt_mask(VGABASE, 0xD3, BIT(2), BIT(2));
-			/* Delay td3 msec. */
-			mdelay(250);
-			/* Back-Light ON */
-			svga_wcrt_mask(VGABASE, 0xD3, BIT(1), BIT(1));
-		} else {
-            /* Turn on panel path. */
-            svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(5));
-            /* Turn on back light. */
-            svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(6));
-			/* Use hardware control power sequence. */
-			svga_wcrt_mask(VGABASE, 0xD3, 0x00, BIT(0));
-			/* Turn on back light and panel path. */
-			svga_wcrt_mask(VGABASE, 0xD3, 0x00, BIT(7) | BIT(6));
-			/* Turn on hardware power sequence. */
-			svga_wcrt_mask(VGABASE, 0xD4, BIT(1), BIT(1));
-		}
-	}
-
-	/* Power on LVDS channel. */
-	if (enc->flags & LVDS_DUAL_CHANNEL) {
-		/* For high resolution LCD (internal),
-		 * power on both LVDS0 and LVDS1 */
-		svga_wcrt_mask(VGABASE, 0xD2, 0x00, BIT(7) | BIT(6));
-	} else {
-		if (enc->di_port & VIA_DI_PORT_DFPL)
-			svga_wcrt_mask(VGABASE, 0xD2, 0x00, BIT(7));
-		else if (enc->di_port & VIA_DI_PORT_DFPH)
-			svga_wcrt_mask(VGABASE, 0xD2, 0x00, BIT(6));
-	}
-}
-
-static void
-via_disable_internal_lvds(struct drm_encoder *encoder)
-{
-	struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
-	struct via_device *dev_priv = encoder->dev->dev_private;
-	struct drm_device *dev = encoder->dev;
-
-	/* Turn off LCD panel */
-	if ((enc->di_port & VIA_DI_PORT_DFPL) || (enc->di_port == VIA_DI_PORT_DVP1)) {
-		/* Set LCD software power sequence off */
-		if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
-		    (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)) {
-			/* Back-Light OFF */
-			svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(1));
-			/* Delay td3 msec. */
-			mdelay(250);
-			/* VEE OFF (unused on vt3353) */
-			svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(2));
-			/* DATA OFF */
-			svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(3));
-			/* Delay td1 msec. */
-			mdelay(25);
-			/* VDD OFF */
-			svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(4));
-		} else {
-			/* Use first power sequence control: *
-			 * Turn off power sequence. */
-			svga_wcrt_mask(VGABASE, 0x6A, 0x00, BIT(3));
-
-			/* Turn off back light and panel path. */
-			svga_wcrt_mask(VGABASE, 0x91, 0xC0, BIT(7) | BIT(6));
-		}
-	}
-
-	if (enc->di_port & VIA_DI_PORT_DFPH) {
-		/* Set LCD software power sequence off */
-		if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
-		    (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)) {
-			/* Back-Light OFF */
-			svga_wcrt_mask(VGABASE, 0xD3, 0x00, BIT(1));
-			/* Delay td3 msec. */
-			mdelay(250);
-			/* VEE OFF */
-			svga_wcrt_mask(VGABASE, 0xD3, 0x00, BIT(2));
-			/* DATA OFF */
-			svga_wcrt_mask(VGABASE, 0xD3, 0x00, BIT(3));
-			/* Delay td1 msec. */
-			mdelay(25);
-			/* VDD OFF */
-			svga_wcrt_mask(VGABASE, 0xD3, 0x00, BIT(4));
-		} else {
-			/* Use second power sequence control: *
-			 * Turn off power sequence. */
-			svga_wcrt_mask(VGABASE, 0xD4, 0x00, BIT(1));
-			/* Turn off back light and panel path. */
-			svga_wcrt_mask(VGABASE, 0xD3, 0xC0, BIT(7) | BIT(6));
-            /* Turn off back light. */
-            svga_wcrt_mask(VGABASE, 0x91, BIT(6), BIT(6));
-            /* Turn off panel path. */
-            svga_wcrt_mask(VGABASE, 0x91, BIT(5), BIT(5));
-		}
-	}
-
-	/* Power off LVDS channel. */
-	if (enc->flags & LVDS_DUAL_CHANNEL) {
-		/* For high resolution LCD (internal) we
-		 * power off both LVDS0 and LVDS1 */
-		svga_wcrt_mask(VGABASE, 0xD2, 0xC0, BIT(7) | BIT(6));
-	} else {
-		if (enc->di_port & VIA_DI_PORT_DFPL)
-			svga_wcrt_mask(VGABASE, 0xD2, BIT(7), BIT(7));
-		else if (enc->di_port & VIA_DI_PORT_DFPH)
-			svga_wcrt_mask(VGABASE, 0xD2, BIT(6), BIT(6));
-	}
-}
-
-static void
 via_fp_castle_rock_soft_power_seq(struct via_device *dev_priv,
 					bool power_state)
 {
@@ -1453,7 +1288,6 @@ void via_fp_probe(struct drm_device *dev)
 void via_fp_init(struct drm_device *dev)
 {
 	struct via_device *dev_priv = dev->dev_private;
-	bool dual_channel = false;
 	struct via_connector *con;
 	struct via_encoder *enc;
 
@@ -1506,9 +1340,6 @@ void via_fp_init(struct drm_device *dev)
 		enc->di_port = VIA_DI_PORT_NONE;
 	}
 
-	if (dual_channel)
-		enc->flags |= LVDS_DUAL_CHANNEL;
-
 	/* Put it all together */
 	drm_mode_connector_attach_encoder(&con->base, &enc->base);
 exit:
commit f6731874fea9b23ec81fc1b28c3846901abd3bf7
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Nov 3 21:49:30 2017 -0700

    drm/openchrome: Replace via_lcd* labels with via_fp*
    
    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 f9f553013cd3..ecf0c00fb9b6 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -1014,7 +1014,7 @@ exit:
 	return ret;
 }
 
-struct drm_connector_funcs via_lcd_connector_funcs = {
+struct drm_connector_funcs via_fp_connector_funcs = {
 	.dpms = drm_helper_connector_dpms,
 	.detect = via_fp_detect,
 	.fill_modes = drm_helper_probe_single_connector_modes,
@@ -1023,7 +1023,7 @@ struct drm_connector_funcs via_lcd_connector_funcs = {
 };
 
 static int
-via_lcd_get_modes(struct drm_connector *connector)
+via_fp_get_modes(struct drm_connector *connector)
 {
 	struct via_connector *con = container_of(connector, struct via_connector, base);
 	struct drm_device *dev = connector->dev;
@@ -1183,7 +1183,7 @@ via_lcd_get_modes(struct drm_connector *connector)
 }
 
 static int
-via_lcd_mode_valid(struct drm_connector *connector,
+via_fp_mode_valid(struct drm_connector *connector,
 			struct drm_display_mode *mode)
 {
 	struct drm_property *prop = connector->dev->mode_config.scaling_mode_property;
@@ -1231,9 +1231,9 @@ via_lcd_mode_valid(struct drm_connector *connector,
 	return MODE_OK;
 }
 
-struct drm_connector_helper_funcs via_lcd_connector_helper_funcs = {
-	.get_modes = via_lcd_get_modes,
-	.mode_valid = via_lcd_mode_valid,
+struct drm_connector_helper_funcs via_fp_connector_helper_funcs = {
+	.get_modes = via_fp_get_modes,
+	.mode_valid = via_fp_mode_valid,
 	.best_encoder = via_best_encoder,
 };
 
@@ -1470,9 +1470,9 @@ void via_fp_init(struct drm_device *dev)
 	con = &enc->cons[0];
 	INIT_LIST_HEAD(&con->props);
 
-	drm_connector_init(dev, &con->base, &via_lcd_connector_funcs,
+	drm_connector_init(dev, &con->base, &via_fp_connector_funcs,
 				DRM_MODE_CONNECTOR_LVDS);
-	drm_connector_helper_add(&con->base, &via_lcd_connector_helper_funcs);
+	drm_connector_helper_add(&con->base, &via_fp_connector_helper_funcs);
 	drm_connector_register(&con->base);
 
 	if (dev_priv->int_fp1_presence) {
commit 49817ccdbadb771dbbbad59b4099188f7448c315
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Nov 3 21:48:42 2017 -0700

    drm/openchrome: Replace via_lcd_detect with via_fp_detect
    
    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 ca2ba71d8372..f9f553013cd3 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -918,20 +918,27 @@ const struct drm_encoder_funcs via_lvds_enc_funcs = {
 	.destroy = via_encoder_cleanup,
 };
 
-/* detect this connector connect status */
+/* Detect FP presence. */
 static enum drm_connector_status
-via_lcd_detect(struct drm_connector *connector,  bool force)
+via_fp_detect(struct drm_connector *connector,  bool force)
 {
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
+	struct via_device *dev_priv = connector->dev->dev_private;
 	enum drm_connector_status ret = connector_status_disconnected;
 	struct i2c_adapter *i2c_bus;
 	struct edid *edid = NULL;
+	u8 mask;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	drm_mode_connector_update_edid_property(connector, edid);
 
+	if (machine_is_olpc()) {
+		ret = connector_status_connected;
+		goto exit;
+	}
+
 	if (con->i2c_bus & VIA_I2C_BUS2) {
 		i2c_bus = via_find_ddc_bus(0x31);
 	} else if (con->i2c_bus & VIA_I2C_BUS3) {
@@ -949,19 +956,19 @@ via_lcd_detect(struct drm_connector *connector,  bool force)
 			ret = connector_status_connected;
 		}
 	} else {
-		struct via_device *dev_priv = connector->dev->dev_private;
-		u8 mask = BIT(1);
-
-		if (connector->dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)
+		if (connector->dev->pdev->device ==
+			PCI_DEVICE_ID_VIA_CLE266) {
 			mask = BIT(3);
+		} else {
+			mask = BIT(1);
+		}
 
-		if (vga_rcrt(VGABASE, 0x3B) & mask)
-			ret = connector_status_connected;
-
-		if (machine_is_olpc())
+		if (vga_rcrt(VGABASE, 0x3B) & mask) {
 			ret = connector_status_connected;
+		}
 	}
 
+exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
 }
@@ -1009,7 +1016,7 @@ exit:
 
 struct drm_connector_funcs via_lcd_connector_funcs = {
 	.dpms = drm_helper_connector_dpms,
-	.detect = via_lcd_detect,
+	.detect = via_fp_detect,
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.set_property = via_fp_set_property,
 	.destroy = via_connector_destroy,
commit fce635e8b9e04e5e0cf3542bae8320d3ab356b7f
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Nov 3 21:46:32 2017 -0700

    drm/openchrome: Rename via_lvds_init to via_fp_init
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_display.c b/drivers/gpu/drm/openchrome/via_display.c
index 95eb322ab641..6a0b76b3cf1e 100644
--- a/drivers/gpu/drm/openchrome/via_display.c
+++ b/drivers/gpu/drm/openchrome/via_display.c
@@ -506,7 +506,7 @@ via_modeset_init(struct drm_device *dev)
 
 	via_analog_init(dev);
 
-	via_lvds_init(dev);
+	via_fp_init(dev);
 
 	switch (dev->pdev->device) {
 	case PCI_DEVICE_ID_VIA_VX900_VGA:
diff --git a/drivers/gpu/drm/openchrome/via_display.h b/drivers/gpu/drm/openchrome/via_display.h
index fde38d90416f..7281c22797d6 100644
--- a/drivers/gpu/drm/openchrome/via_display.h
+++ b/drivers/gpu/drm/openchrome/via_display.h
@@ -186,7 +186,7 @@ extern void via_fp_probe(struct drm_device *dev);
 
 extern void via_hdmi_init(struct drm_device *dev, u32 di_port);
 extern void via_analog_init(struct drm_device *dev);
-extern void via_lvds_init(struct drm_device *dev);
 extern void via_tmds_init(struct drm_device *dev);
+extern void via_fp_init(struct drm_device *dev);
 
 #endif
diff --git a/drivers/gpu/drm/openchrome/via_fp.c b/drivers/gpu/drm/openchrome/via_fp.c
index 3f4c11ba1315..ca2ba71d8372 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -1443,7 +1443,7 @@ void via_fp_probe(struct drm_device *dev)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-void via_lvds_init(struct drm_device *dev)
+void via_fp_init(struct drm_device *dev)
 {
 	struct via_device *dev_priv = dev->dev_private;
 	bool dual_channel = false;


More information about the Openchrome-devel mailing list