[Openchrome-devel] drm-openchrome: 2 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Tue Nov 29 02:45:13 UTC 2016


 drivers/gpu/drm/via/via_crtc.c |   71 ++++++++++++++++++++++++++++++-----------
 drivers/gpu/drm/via/via_drv.h  |    4 +-
 2 files changed, 55 insertions(+), 20 deletions(-)

New commits:
commit eaa5af7662d4a776ad616e6f6544a0735f5130df
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Nov 28 18:44:18 2016 -0800

    Version bumped to 3.0.2
    
    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 49deb8c..8c77b39 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -27,11 +27,11 @@
 #define DRIVER_AUTHOR       "The OpenChrome Project"
 #define DRIVER_NAME         "via"
 #define DRIVER_DESC         "VIA Technologies UniChrome / Chrome9"
-#define DRIVER_DATE         "20160927"
+#define DRIVER_DATE         "20161128"
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		0
-#define DRIVER_PATCHLEVEL	1
+#define DRIVER_PATCHLEVEL	2
 
 #include <linux/module.h>
 
commit 4642b14bc80e03d88bbb36f46f360d5bc073ea81
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Nov 28 18:41:32 2016 -0800

    Added viaIGA2SetColorDepth
    
    viaIGA2SetColorDepth function sets the color depth for IGA2.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 5d959e0..4594f8b 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -93,6 +93,49 @@ viaIGA1SetColorDepth(struct drm_via_private *dev_priv,
 }
 
 static void
+viaIGA2SetColorDepth(struct drm_via_private *dev_priv,
+			u8 depth)
+{
+	u8 value;
+
+	DRM_DEBUG("Entered viaIGA2SetColorDepth.\n");
+
+	value = 0x00;
+
+	/* Set the color depth for IGA2. */
+	switch (depth) {
+	case 8:
+		break;
+	case 16:
+		value = BIT(6);
+		break;
+	case 24:
+	case 32:
+		value = BIT(7) | BIT(6);
+		break;
+	default:
+		break;
+	}
+
+	if ((depth == 8)
+		|| (depth == 16)
+		|| (depth == 24)
+		|| (depth == 32)) {
+		/* 3X5.67[7:6] - Display Color Depth Select
+		*               00: 8bpp
+		*               01: 16bpp
+		*               10: 30bpp
+		*               11: 32bpp */
+		svga_wcrt_mask(VGABASE, 0x67, value, 0xC0);
+		DRM_INFO("IGA2 Color Depth: %d bit\n", depth);
+	} else {
+		DRM_ERROR("Unsupported IGA2 Color Depth: %d bit\n", depth);
+	}
+
+	DRM_DEBUG("Exiting viaIGA2SetColorDepth.\n");
+}
+
+static void
 via_hide_cursor(struct drm_crtc *crtc)
 {
 	struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
@@ -1292,7 +1335,16 @@ via_iga2_mode_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 	struct drm_via_private *dev_priv = crtc->dev->dev_private;
 	struct drm_gem_object *obj = fb->helper_private;
 	struct ttm_buffer_object *bo = ttm_gem_mapping(obj);
-	u8 value;
+
+	if ((fb->depth != 8)
+		&& (fb->depth != 16)
+		&& (fb->depth != 24)
+		&& (fb->depth != 32)) {
+		DRM_ERROR("Unsupported IGA2 Color Depth: %d bit\n", fb->depth);
+		return -EINVAL;
+	}
+
+	viaIGA2SetColorDepth(dev_priv, fb->depth);
 
 	/* Set the framebuffer offset */
 	addr = round_up(bo->offset + pitch, 16);
@@ -1312,23 +1364,6 @@ via_iga2_mode_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 	pitch = ALIGN(fb->pitches[0], 16);
 	load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
 
-	/* Load color depth registers */
-	switch (fb->depth) {
-	case 8:
-		value = 0x00;
-		break;
-	case 16:
-		value = BIT(6);
-		break;
-	case 24:
-	case 32:
-		value = BIT(7) | BIT(6);
-		break;
-	default:
-		DRM_ERROR("Unsupported depth: %d\n", fb->depth);
-		return -EINVAL;
-	}
-	svga_wcrt_mask(VGABASE, 0x67, value, BIT(7) | BIT(6));
 	return 0;
 }
 


More information about the Openchrome-devel mailing list