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

Kevin Brace kevinbrace at kemper.freedesktop.org
Tue Dec 27 03:05:31 UTC 2016


 drivers/gpu/drm/via/via_crtc.c |   58 ++++++++++++++++++++++++++++++++++++-----
 drivers/gpu/drm/via/via_drv.h  |    4 +-
 2 files changed, 54 insertions(+), 8 deletions(-)

New commits:
commit ac37adf54d7a0a6fa87e7483aaf1c7612ccdd9e4
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Dec 26 18:59:32 2016 -0800

    Version bumped to 3.0.6
    
    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 4a4e37b..308aeb5 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         "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE         "20161222"
+#define DRIVER_DATE         "20161226"
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		0
-#define DRIVER_PATCHLEVEL	5
+#define DRIVER_PATCHLEVEL	6
 
 #include <linux/module.h>
 
commit f03eb4067b140d43a0f0aa3b53766c80755eeb63
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Dec 26 18:57:05 2016 -0800

    Added viaIGA2SetPaletteLUTResolution function
    
    This function gets called from via_iga2_mode_set_base_atomic
    callback function.
    
    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 3050584..b403806 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -168,6 +168,18 @@ viaIGA2SetColorDepth(struct drm_via_private *dev_priv,
 }
 
 static inline void
+viaIGA2SetPaletteLUTResolution(void __iomem *regs, bool paletteLUT)
+{
+    /* Set the palette LUT resolution for IGA2. */
+    /* 3X5.6A[5] - IGA2 6 / 8 Bit LUT
+     *             0: 6-bit
+     *             1: 8-bit */
+    svga_wcrt_mask(regs, 0x6A, paletteLUT ? BIT(5) : 0, BIT(5));
+    DRM_INFO("IGA2 Palette LUT Resolution: %s bit\n",
+            paletteLUT ? "8" : "6");
+}
+
+static inline void
 viaIGA2InterlaceMode(void __iomem *regs, bool interlaceMode)
 {
     svga_wcrt_mask(regs, 0x67, interlaceMode ? BIT(5) : 0, BIT(5));
@@ -1435,6 +1447,9 @@ via_iga2_mode_set_base_atomic(struct drm_crtc *crtc,
 
     viaIGACommonInit(VGABASE);
 
+    /* Set palette LUT to 8-bit mode. */
+    viaIGA2SetPaletteLUTResolution(VGABASE, true);
+
     viaIGA2SetColorDepth(dev_priv, fb->depth);
 
     /* Set the framebuffer offset */
commit 425cd92d081f13b835fbf08599471ccdc23f878c
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Dec 26 18:55:27 2016 -0800

    Calling viaIGACommonInit from via_iga2_mode_set_base_atomic
    
    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 db1347c..3050584 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1433,6 +1433,8 @@ via_iga2_mode_set_base_atomic(struct drm_crtc *crtc,
         return -EINVAL;
     }
 
+    viaIGACommonInit(VGABASE);
+
     viaIGA2SetColorDepth(dev_priv, fb->depth);
 
     /* Set the framebuffer offset */
commit 838b4377a09be8036a70f1ee883aa8052c425be7
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Dec 26 18:52:46 2016 -0800

    Moving initialization code inside via_iga1_mode_set_base_atomic
    
    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 d4eaca7..db1347c 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1269,6 +1269,11 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
         return -EINVAL;
     }
 
+    viaIGACommonInit(VGABASE);
+
+    /* Set palette LUT to 8-bit mode. */
+    viaIGA1SetPaletteLUTResolution(VGABASE, true);
+
     viaIGA1SetColorDepth(dev_priv, fb->depth);
 
     /* Set the framebuffer offset */
@@ -1290,10 +1295,6 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
      * second adapter */
     load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
 
-    viaIGACommonInit(VGABASE);
-
-    /* Set palette LUT to 8-bit mode. */
-    viaIGA1SetPaletteLUTResolution(VGABASE, true);
     return 0;
 }
 
commit ae90141b77096625c0a32f50b5bed98f28f5c37d
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Dec 26 18:50:53 2016 -0800

    Added viaIGACommonInit function
    
    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 f798a34..d4eaca7 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -46,6 +46,24 @@ static struct vga_regset vpit_table[] = {
 };
 
 static void
+viaIGACommonInit(void __iomem *regs)
+{
+    DRM_DEBUG("Entered viaIGACommonInit.\n");
+
+    /* Be careful with 3C5.15[5] - Wrap Around Disable.
+     * It must be set to 1 for proper operation. */
+    /* 3C5.15[5]   - Wrap Around Disable
+     *               0: Disable (For Mode 0-13)
+     *               1: Enable
+     * 3C5.15[1]   - Extended Display Mode Enable
+     *               0: Disable
+     *               1: Enable */
+    svga_wseq_mask(regs, 0x15, BIT(5) | BIT(1), BIT(5) | BIT(1));
+
+    DRM_DEBUG("Exiting viaIGACommonInit.\n");
+}
+
+static void
 viaIGA1SetColorDepth(struct drm_via_private *dev_priv,
                         u8 depth)
 {
@@ -1244,7 +1262,6 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
     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)) {
@@ -1273,10 +1290,7 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
      * second adapter */
     load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
 
-    /* Bit 5 enables wrap around
-     * and bit 1 enables extended display mode */
-    value = BIT(5) | BIT(1);
-    svga_wseq_mask(VGABASE, 0x15, value, 0x22);
+    viaIGACommonInit(VGABASE);
 
     /* Set palette LUT to 8-bit mode. */
     viaIGA1SetPaletteLUTResolution(VGABASE, true);
commit 3cc9a655511f4112658a6fd1346b7ba0ef58c558
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Dec 26 18:48:53 2016 -0800

    Added viaIGA1SetPaletteLUTResolution function
    
    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 41804e2..f798a34 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -90,6 +90,18 @@ viaIGA1SetColorDepth(struct drm_via_private *dev_priv,
 }
 
 static inline void
+viaIGA1SetPaletteLUTResolution(void __iomem *regs, bool paletteLUT)
+{
+    /* Set the palette LUT resolution for IGA1. */
+    /* 3C5.15[7] - IGA1 6 / 8 Bit LUT
+     *             0: 6-bit
+     *             1: 8-bit */
+    svga_wseq_mask(regs, 0x15, paletteLUT ? BIT(7) : 0, BIT(7));
+    DRM_INFO("IGA1 Palette LUT Resolution: %s bit\n",
+            paletteLUT ? "8" : "6");
+}
+
+static inline void
 viaIGA1InterlaceMode(void __iomem *regs, bool interlaceMode)
 {
     svga_wcrt_mask(regs, 0x33, interlaceMode ? BIT(6) : 0, BIT(6));
@@ -1261,11 +1273,13 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
      * second adapter */
     load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
 
-    /* Bit 7 set LUT bit size to 8 bit. Bit 5 enables wrap around
+    /* Bit 5 enables wrap around
      * and bit 1 enables extended display mode */
-    value = BIT(7) | BIT(5) | BIT(1);
-    svga_wseq_mask(VGABASE, 0x15, value, 0xA2);
+    value = BIT(5) | BIT(1);
+    svga_wseq_mask(VGABASE, 0x15, value, 0x22);
 
+    /* Set palette LUT to 8-bit mode. */
+    viaIGA1SetPaletteLUTResolution(VGABASE, true);
     return 0;
 }
 


More information about the Openchrome-devel mailing list