[PATCH] modesetting: Use correct datatypes for return values from glamor_name_from_pixmap and glamor_fd_from_pixmap

Robert Ancell robert.ancell at canonical.com
Wed Jul 15 17:26:05 PDT 2015


glamor_name_from_pixmap and glamor_fd_from_pixmap return CARD16 and CARD32 values via pointers.
The current code uses uint16_t and uint32_t which will probably be the same but it's safer to use
the datatypes as specified by the function.

Signed-off-by: Robert Ancell <robert.ancell at canonical.com>
---
 hw/xfree86/drivers/modesetting/dri2.c            | 4 ++--
 hw/xfree86/drivers/modesetting/drmmode_display.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/dri2.c b/hw/xfree86/drivers/modesetting/dri2.c
index 63cb065..0fe420c 100644
--- a/hw/xfree86/drivers/modesetting/dri2.c
+++ b/hw/xfree86/drivers/modesetting/dri2.c
@@ -138,8 +138,8 @@ ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment,
     ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     DRI2Buffer2Ptr buffer;
     PixmapPtr pixmap;
-    uint32_t size;
-    uint16_t pitch;
+    CARD32 size;
+    CARD16 pitch;
     ms_dri2_buffer_private_ptr private;
 
     buffer = calloc(1, sizeof *buffer);
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index ef5b087..6a13660 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -148,8 +148,8 @@ drmmode_bo_for_pixmap(drmmode_ptr drmmode, drmmode_bo *bo, PixmapPtr pixmap)
 {
 #ifdef GLAMOR
     ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn);
-    uint16_t pitch;
-    uint32_t size;
+    CARD16 pitch;
+    CARD32 size;
     int fd;
 
 #ifdef GLAMOR_HAS_GBM
-- 
2.1.4



More information about the xorg-devel mailing list