[openchrome-devel] xf86-video-openchrome: 2 commits - src/via_driver.c

Kevin Brace kevinbrace at kemper.freedesktop.org
Mon Jan 13 22:20:17 UTC 2020


 src/via_driver.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 09d9f03c93009d86af37880aa64d837cf5800938
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Jan 13 15:43:19 2020 -0600

    Call screen->ModifyPixmapHeader() only at one location when resizing
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index e3d5545..a6690b8 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -718,10 +718,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
         goto fail;
     }
 
-    if (!pVia->shadowFB) {
-        screen->ModifyPixmapHeader(ppix, width, height, -1, -1,
-                                    pitch, new_pixels);
-    } else {
+    if (pVia->shadowFB) {
         new_pixels = malloc(scrn->displayWidth * scrn->virtualY *
                             ((scrn->bitsPerPixel + 7) >> 3));
         if (!new_pixels) {
@@ -730,11 +727,11 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 
         free(pVia->ShadowPtr);
         pVia->ShadowPtr = new_pixels;
-        screen->ModifyPixmapHeader(ppix, width, height, -1, -1,
-                                    pitch, pVia->ShadowPtr);
-
     }
 
+    screen->ModifyPixmapHeader(ppix, width, height, -1, -1,
+                                width * cpp, new_pixels);
+
     xf86DrvMsg(scrn->scrnIndex, X_INFO,
                 "Allocated a new frame buffer: %dx%d\n",
                 width, height);
commit eec9af1c0e28d697b9c99247d9dec5f211b99140
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Jan 13 15:29:28 2020 -0600

    Preserve displayWidth member of ScrnInfoRec struct when resizing
    
    The preserved value is used only when the original setting is being
    restored due to an error.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index dc87deb..e3d5545 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -660,7 +660,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
     Bool ret;
     ScreenPtr screen;
     uint32_t old_fb_id;
-    int i, pitch, old_width, old_height, old_pitch;
+    int i, pitch, old_width, old_height, old_displayWidth;
     int cpp = (scrn->bitsPerPixel + 7) / 8;
     PixmapPtr ppix;
     void *new_pixels;
@@ -684,7 +684,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
      * be restored. */
     old_width = scrn->virtualX;
     old_height = scrn->virtualY;
-    old_pitch = drmmode->front_bo->pitch;
+    old_displayWidth = scrn->displayWidth;
     old_fb_id = drmmode->fb_id;
     old_front = drmmode->front_bo;
 
@@ -788,7 +788,7 @@ fail:
 
     scrn->virtualX = old_width;
     scrn->virtualY = old_height;
-    scrn->displayWidth = old_pitch / cpp;
+    scrn->displayWidth = old_displayWidth;
     drmmode->fb_id = old_fb_id;
     drmmode->front_bo = old_front;
 


More information about the openchrome-devel mailing list