drivers/gpu/drm/openchrome/via_crtc.c |   82 +++++++++++++++++-----------------
 drivers/gpu/drm/openchrome/via_drv.c  |    2 
 2 files changed, 42 insertions(+), 42 deletions(-)

New commits:
commit f09a57691ad92060d4f6d44019eac232101ed72c
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Sat Aug 5 08:03:03 2017 -0700

    Removed drm_vblank_pre/post_modeset
    
    Got the implementation idea from commit
    8ff64c17f3bec8cdafc68461532e273babe2a605.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_crtc.c 
b/drivers/gpu/drm/openchrome/via_crtc.c
index a1c2ed969015..1d3608a84b03 100644
--- a/drivers/gpu/drm/openchrome/via_crtc.c
+++ b/drivers/gpu/drm/openchrome/via_crtc.c
@@ -1059,9 +1059,6 @@ via_iga1_crtc_dpms(struct drm_crtc *crtc, int mode)
     case DRM_MODE_DPMS_SUSPEND:
     case DRM_MODE_DPMS_STANDBY:
     case DRM_MODE_DPMS_OFF:
-        if (crtc->dev->num_crtcs)
-            drm_vblank_pre_modeset(crtc->dev, iga->index);
-
         /* turn off CRT screen (IGA1) */
         svga_wseq_mask(VGABASE, 0x01, BIT(5), BIT(5));
 
@@ -1070,9 +1067,6 @@ via_iga1_crtc_dpms(struct drm_crtc *crtc, int mode)
         break;
 
     case DRM_MODE_DPMS_ON:
-        if (crtc->dev->num_crtcs)
-            drm_vblank_post_modeset(crtc->dev, iga->index);
-
         /* turn on CRT screen (IGA1) */
         svga_wseq_mask(VGABASE, 0x01, 0x00, BIT(5));
 
@@ -1110,6 +1104,8 @@ via_iga1_crtc_prepare(struct drm_crtc *crtc)
     /* Turn off the cursor */
     via_hide_cursor(crtc);
 
+    drm_crtc_vblank_off(crtc);
+
     /* Blank the screen */
     if (crtc->enabled)
         via_iga1_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
@@ -1125,6 +1121,8 @@ via_iga1_crtc_commit(struct drm_crtc *crtc)
     /* Turn on the cursor */
     via_show_cursor(crtc);
 
+    drm_crtc_vblank_on(crtc);
+
     /* Turn on the monitor */
     if (crtc->enabled)
         via_iga1_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
@@ -1343,9 +1341,6 @@ via_iga2_crtc_dpms(struct drm_crtc *crtc, int mode)
     case DRM_MODE_DPMS_SUSPEND:
     case DRM_MODE_DPMS_STANDBY:
     case DRM_MODE_DPMS_OFF:
-        if (crtc->dev->num_crtcs)
-            drm_vblank_pre_modeset(crtc->dev, iga->index);
-
         /* turn off CRT screen (IGA2) */
         svga_wcrt_mask(VGABASE, 0x6B, BIT(2), BIT(2));
 
@@ -1354,9 +1349,6 @@ via_iga2_crtc_dpms(struct drm_crtc *crtc, int mode)
         break;
 
     case DRM_MODE_DPMS_ON:
-        if (crtc->dev->num_crtcs)
-            drm_vblank_post_modeset(crtc->dev, iga->index);
-
         /* turn on CRT screen (IGA2) */
         svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(2));
 
@@ -1394,6 +1386,8 @@ via_iga2_crtc_prepare(struct drm_crtc *crtc)
     /* Turn off the cursor */
     via_hide_cursor(crtc);
 
+    drm_crtc_vblank_off(crtc);
+
     /* Blank the screen */
     if (crtc->enabled)
         via_iga2_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
@@ -1409,6 +1403,8 @@ via_iga2_crtc_commit(struct drm_crtc *crtc)
     /* Turn on the cursor */
     via_show_cursor(crtc);
 
+    drm_crtc_vblank_on(crtc);
+
     /* Turn on the monitor */
     if (crtc->enabled)
         via_iga2_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
commit 9e40a3adb35258b481bcf646e2f1984d37397ae0
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Sat Aug 5 07:36:55 2017 -0700

    Changes to the input parameters when directly calling gamma_set member
    
    Commit 7ea7728387820a21a89a7c3845dbe60926f82dc4 made this change,
    so our side needs to change as well.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_crtc.c 
b/drivers/gpu/drm/openchrome/via_crtc.c
index 8bd22bc90842..a1c2ed969015 100644
--- a/drivers/gpu/drm/openchrome/via_crtc.c
+++ b/drivers/gpu/drm/openchrome/via_crtc.c
@@ -1042,8 +1042,8 @@ drm_mode_crtc_load_lut(struct drm_crtc *crtc)
         r_base = crtc->gamma_store;
         g_base = r_base + size;
         b_base = g_base + size;
-        crtc->funcs->gamma_set(crtc, r_base, g_base, b_base, 0,
-                crtc->gamma_size);
+        crtc->funcs->gamma_set(crtc, r_base, g_base, b_base,
+                                crtc->gamma_size, NULL);
     }
 }
 
commit 1dfc3b7499019c0966aae23e022a0f1051dfb7f6
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Sat Aug 5 07:25:47 2017 -0700

    Made updates to via_iga2_gamma_set
    
    Commit 7ea7728387820a21a89a7c3845dbe60926f82dc4 made this change,
    so our side needs to change as well.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_crtc.c 
b/drivers/gpu/drm/openchrome/via_crtc.c
index f0f1f3c12ebf..8bd22bc90842 100644
--- a/drivers/gpu/drm/openchrome/via_crtc.c
+++ b/drivers/gpu/drm/openchrome/via_crtc.c
@@ -362,16 +362,17 @@ via_iga1_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, 
u16 *b,
     return 0;
 }
 
-static void
-via_iga2_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
-                    u16 *blue, uint32_t start, uint32_t size)
+static int
+via_iga2_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
+                    uint32_t size,
+                    struct drm_modeset_acquire_ctx *ctx)
 {
     struct via_device *dev_priv = crtc->dev->dev_private;
-    int end = (start + size > 256) ? 256 : start + size, i;
+    int end = (size > 256) ? 256 : size, i;
     u8 sr1a = vga_rseq(VGABASE, 0x1A);
 
     if (!crtc->enabled || !crtc->primary->fb)
-        return;
+        return -EINVAL;
 
     if (crtc->primary->fb->format->cpp[0] * 8 == 8) {
         /* Change Shadow to Secondary Display's LUT */
@@ -386,13 +387,13 @@ via_iga2_gamma_set(struct drm_crtc *crtc, u16 *red, u16 
*green,
             enable_second_display_channel(VGABASE);
 
         /* Fill in IGA2's LUT */
-        for (i = start; i < end; i++) {
+        for (i = 0; i < end; i++) {
             /* Bit mask of palette */
             vga_w(VGABASE, VGA_PEL_MSK, 0xFF);
             vga_w(VGABASE, VGA_PEL_IW, i);
-            vga_w(VGABASE, VGA_PEL_D, red[i] >> 8);
-            vga_w(VGABASE, VGA_PEL_D, green[i] >> 8);
-            vga_w(VGABASE, VGA_PEL_D, blue[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, r[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, g[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, b[i] >> 8);
         }
         /* Disable gamma in case it was enabled previously */
         svga_wcrt_mask(VGABASE, 0x6A, 0x00, BIT(1));
@@ -431,17 +432,19 @@ via_iga2_gamma_set(struct drm_crtc *crtc, u16 *red, u16 
*green,
             enable_second_display_channel(VGABASE);
 
         /* Fill in IGA2's gamma */
-        for (i = start; i < end; i++) {
+        for (i = 0; i < end; i++) {
             /* bit mask of palette */
             vga_w(VGABASE, VGA_PEL_MSK, 0xFF);
             vga_w(VGABASE, VGA_PEL_IW, i);
-            vga_w(VGABASE, VGA_PEL_D, red[i] >> 8);
-            vga_w(VGABASE, VGA_PEL_D, green[i] >> 8);
-            vga_w(VGABASE, VGA_PEL_D, blue[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, r[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, g[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, b[i] >> 8);
         }
         /* access Primary Display's LUT */
         vga_wseq(VGABASE, 0x1A, sr1a);
     }
+
+    return 0;
 }
 
 static void
commit ceecb03e687a2589b26a2ffa4b5857569f0347c8
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Sat Aug 5 07:16:30 2017 -0700

    Made updates to via_iga1_gamma_set
    
    Commit 7ea7728387820a21a89a7c3845dbe60926f82dc4 made this change,
    so our side needs to change as well.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_crtc.c 
b/drivers/gpu/drm/openchrome/via_crtc.c
index 0dec4bb564f5..f0f1f3c12ebf 100644
--- a/drivers/gpu/drm/openchrome/via_crtc.c
+++ b/drivers/gpu/drm/openchrome/via_crtc.c
@@ -306,16 +306,17 @@ via_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
     return 0;
 }
 
-static void
-via_iga1_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
-                    u16 *blue, uint32_t start, uint32_t size)
+static int
+via_iga1_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
+                    uint32_t size,
+                    struct drm_modeset_acquire_ctx *ctx)
 {
     struct via_device *dev_priv = crtc->dev->dev_private;
-    int end = (start + size > 256) ? 256 : start + size, i;
+    int end = (size > 256) ? 256 : size, i;
     u8 val, sr1a = vga_rseq(VGABASE, 0x1A);
 
     if (!crtc->enabled || !crtc->primary->fb)
-        return;
+        return -EINVAL;
 
     if (crtc->primary->fb->format->cpp[0] * 8 == 8) {
         /* Prepare for initialize IGA1's LUT: */
@@ -327,13 +328,13 @@ via_iga1_gamma_set(struct drm_crtc *crtc, u16 *red, u16 
*green,
         vga_wcrt(VGABASE, 0x67, val);
 
         /* Fill in IGA1's LUT */
-        for (i = start; i < end; i++) {
+        for (i = 0; i < end; i++) {
             /* Bit mask of palette */
             vga_w(VGABASE, VGA_PEL_MSK, 0xFF);
             vga_w(VGABASE, VGA_PEL_IW, i);
-            vga_w(VGABASE, VGA_PEL_D, red[i] >> 8);
-            vga_w(VGABASE, VGA_PEL_D, green[i] >> 8);
-            vga_w(VGABASE, VGA_PEL_D, blue[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, r[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, g[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, b[i] >> 8);
         }
         /* enable LUT */
         svga_wseq_mask(VGABASE, 0x1B, 0x00, BIT(0));
@@ -347,16 +348,18 @@ via_iga1_gamma_set(struct drm_crtc *crtc, u16 *red, u16 
*green,
         svga_wseq_mask(VGABASE, 0x1A, 0x00, BIT(0));
 
         /* Fill in IGA1's gamma */
-        for (i = start; i < end; i++) {
+        for (i = 0; i < end; i++) {
             /* bit mask of palette */
             vga_w(VGABASE, VGA_PEL_MSK, 0xFF);
             vga_w(VGABASE, VGA_PEL_IW, i);
-            vga_w(VGABASE, VGA_PEL_D, red[i] >> 8);
-            vga_w(VGABASE, VGA_PEL_D, green[i] >> 8);
-            vga_w(VGABASE, VGA_PEL_D, blue[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, r[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, g[i] >> 8);
+            vga_w(VGABASE, VGA_PEL_D, b[i] >> 8);
         }
         vga_wseq(VGABASE, 0x1A, sr1a);
     }
+
+    return 0;
 }
 
 static void
commit fe3fac1174c06b8cea4417e8ef362b68968d5af2
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Sat Aug 5 06:04:08 2017 -0700

    Drop drm_vblank_cleanup
    
    Commit b4164d66c4a2adf7beac7cd5e3f8cc5d06723d57 made this change,
    so our side needs to change as well.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_drv.c 
b/drivers/gpu/drm/openchrome/via_drv.c
index 3fd2bbf28892..2751aa8570f4 100644
--- a/drivers/gpu/drm/openchrome/via_drv.c
+++ b/drivers/gpu/drm/openchrome/via_drv.c
@@ -274,8 +274,6 @@ static void via_driver_unload(struct drm_device *dev)
 
        via_fence_pool_fini(dev_priv->dma_fences);
 
-       drm_vblank_cleanup(dev);
-
        /* destroy work queue. */
        if (dev_priv->wq)
                destroy_workqueue(dev_priv->wq);
_______________________________________________
Openchrome-devel mailing list
Openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel

Reply via email to