[Openchrome-devel] drm-openchrome: Branch 'drm-next-3.19' - 3 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Sat Nov 4 04:25:52 UTC 2017
drivers/gpu/drm/openchrome/via_display.h | 5 +
drivers/gpu/drm/openchrome/via_drv.h | 2
drivers/gpu/drm/openchrome/via_fp.c | 152 +++++--------------------------
3 files changed, 35 insertions(+), 124 deletions(-)
New commits:
commit 8a5cd76be87e64d65d0518243955f72a1a97256c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 3 21:18:14 2017 -0700
drm/openchrome: Version bumped to 3.0.56
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 cee17a51103c..e6f63d4a985f 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 55
+#define DRIVER_PATCHLEVEL 56
#include <linux/module.h>
commit 408afaddd74c04fef9f3f3f269193639e1e9ad5f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 3 21:16:50 2017 -0700
drm/openchrome: Remove polarity inversion code for 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 3104c729c4ad..56719a3dc7ed 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -669,47 +669,12 @@ via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
struct via_device *dev_priv = encoder->dev->dev_private;
- u8 syncreg = 0;
/* PCI Device ID */
u16 chipset = encoder->dev->pdev->device;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
- syncreg |= BIT(6);
- if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC)
- syncreg |= BIT(5);
-
- switch (enc->di_port) {
- case VIA_DI_PORT_DVP0:
- svga_wcrt_mask(VGABASE, 0x96, syncreg, BIT(6) | BIT(5));
- break;
-
- case VIA_DI_PORT_DVP1:
- svga_wcrt_mask(VGABASE, 0x9B, syncreg, BIT(6) | BIT(5));
- break;
-
- case VIA_DI_PORT_DFPH:
- svga_wcrt_mask(VGABASE, 0x97, syncreg, BIT(6) | BIT(5));
- break;
-
- case VIA_DI_PORT_DFPL:
- svga_wcrt_mask(VGABASE, 0x99, syncreg, BIT(6) | BIT(5));
- break;
-
- /* For TTL Type LCD */
- case (VIA_DI_PORT_DFPL + VIA_DI_PORT_DVP1):
- svga_wcrt_mask(VGABASE, 0x99, syncreg, BIT(6) | BIT(5));
- svga_wcrt_mask(VGABASE, 0x9B, syncreg, BIT(6) | BIT(5));
- break;
-
- default:
- DRM_ERROR("No DIPort.\n");
- case VIA_DI_PORT_NONE:
- break;
- }
-
/* Temporary implementation.*/
switch (chipset) {
case PCI_DEVICE_ID_VIA_P4M900:
commit 9e67c8aaa0b9efb6f2c1d42076704b9ac2c9fee1
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 3 20:34:15 2017 -0700
drm/openchrome: Add FP native screen resolution information table
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_display.h b/drivers/gpu/drm/openchrome/via_display.h
index 7281c22797d6..e59fb23d2bb8 100644
--- a/drivers/gpu/drm/openchrome/via_display.h
+++ b/drivers/gpu/drm/openchrome/via_display.h
@@ -78,6 +78,11 @@
#define VIA_TMDS_NONE 0x0
#define VIA_TMDS_VT1632 BIT(0)
+typedef struct _via_fp_info {
+ u32 x;
+ u32 y;
+} via_fp_info;
+
struct via_crtc {
struct drm_crtc base;
struct ttm_bo_kmap_obj cursor_kmap;
diff --git a/drivers/gpu/drm/openchrome/via_fp.c b/drivers/gpu/drm/openchrome/via_fp.c
index 72fa3c944d6b..3104c729c4ad 100644
--- a/drivers/gpu/drm/openchrome/via_fp.c
+++ b/drivers/gpu/drm/openchrome/via_fp.c
@@ -33,6 +33,26 @@
#define TD2 0
#define TD3 25
+/* Non-I2C bus FP native screen resolution information table.*/
+static via_fp_info via_fp_info_table[] = {
+ { 640, 480},
+ { 800, 600},
+ {1024, 768},
+ {1280, 768},
+ {1280, 1024},
+ {1400, 1050},
+ {1600, 1200},
+ {1280, 800},
+ { 800, 480},
+ {1024, 768},
+ {1366, 768},
+ {1024, 768},
+ {1280, 768},
+ {1280, 1024},
+ {1400, 1050},
+ {1600, 1200}
+};
+
/* caculate the cetering timing using mode and adjusted_mode */
static void
@@ -911,93 +931,10 @@ via_fp_get_modes(struct drm_connector *connector)
kfree(edid);
}
} else {
- reg_value = (vga_rcrt(VGABASE, 0x3F) & 0x0F);
+ reg_value = (vga_rcrt(VGABASE, 0x3f) & 0x0f);
hdisplay = vdisplay = 0;
-
- switch (reg_value) {
- case 0x00:
- hdisplay = 640;
- vdisplay = 480;
- break;
-
- case 0x01:
- hdisplay = 800;
- vdisplay = 600;
- break;
-
- case 0x02:
- hdisplay = 1024;
- vdisplay = 768;
- break;
-
- case 0x03:
- hdisplay = 1280;
- vdisplay = 768;
- break;
-
- case 0x04:
- hdisplay = 1280;
- vdisplay = 1024;
- break;
-
- case 0x05:
- hdisplay = 1400;
- vdisplay = 1050;
- break;
-
- case 0x06:
- hdisplay = 1440;
- vdisplay = 900;
- break;
-
- case 0x07:
- hdisplay = 1280;
- vdisplay = 800;
- break;
-
- case 0x08:
- hdisplay = 800;
- vdisplay = 480;
- break;
-
- case 0x09:
- hdisplay = 1024;
- vdisplay = 600;
- break;
-
- case 0x0A:
- hdisplay = 1366;
- vdisplay = 768;
- break;
-
- case 0x0B:
- hdisplay = 1600;
- vdisplay = 1200;
- break;
-
- case 0x0C:
- hdisplay = 1280;
- vdisplay = 768;
- break;
-
- case 0x0D:
- hdisplay = 1280;
- vdisplay = 1024;
- break;
-
- case 0x0E:
- hdisplay = 1600;
- vdisplay = 1200;
- break;
-
- case 0x0F:
- hdisplay = 480;
- vdisplay = 640;
- break;
-
- default:
- break;
- }
+ hdisplay = via_fp_info_table[reg_value].x;
+ vdisplay = via_fp_info_table[reg_value].y;
if (hdisplay && vdisplay) {
native_mode = drm_cvt_mode(dev, hdisplay, vdisplay,
@@ -1291,6 +1228,8 @@ void via_fp_init(struct drm_device *dev)
struct via_connector *con;
struct via_encoder *enc;
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
if ((!(dev_priv->int_fp1_presence)) &&
(!(dev_priv->int_fp2_presence))) {
goto exit;
@@ -1298,9 +1237,10 @@ void via_fp_init(struct drm_device *dev)
enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
if (!enc) {
- DRM_INFO("Failed to allocate LVDS output\n");
- return;
+ DRM_ERROR("Failed to allocate FP.\n");
+ goto exit;
}
+
con = &enc->cons[0];
INIT_LIST_HEAD(&con->props);
@@ -1343,5 +1283,6 @@ void via_fp_init(struct drm_device *dev)
/* Put it all together */
drm_mode_connector_attach_encoder(&con->base, &enc->base);
exit:
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return;
}
More information about the Openchrome-devel
mailing list