[Mesa-dev] [PATCH 3/4] i965: Make names of DRI image extension functions more consistent

Ander Conselvan de Oliveira conselvan2 at gmail.com
Wed Nov 27 07:52:07 PST 2013


From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>

Prefix everything with intel_dri_image.
---
 src/mesa/drivers/dri/i965/intel_screen.c |  116 +++++++++++++++---------------
 1 file changed, 59 insertions(+), 57 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 00339f9..fe412b5 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -355,9 +355,9 @@ intel_setup_image_from_dimensions(__DRIimage *image)
 }
 
 static __DRIimage *
-intel_create_image_from_name(__DRIscreen *screen,
-			     int width, int height, int format,
-			     int name, int pitch, void *loaderPrivate)
+intel_dri_image_create_from_name(__DRIscreen *screen,
+                                 int width, int height, int format,
+                                 int name, int pitch, void *loaderPrivate)
 {
     struct intel_screen *intelScreen = screen->driverPrivate;
     __DRIimage *image;
@@ -385,8 +385,9 @@ intel_create_image_from_name(__DRIscreen *screen,
 }
 
 static __DRIimage *
-intel_create_image_from_renderbuffer(__DRIcontext *context,
-				     int renderbuffer, void *loaderPrivate)
+intel_dri_image_create_from_renderbuffer(__DRIcontext *context,
+                                         int renderbuffer,
+                                         void *loaderPrivate)
 {
    __DRIimage *image;
    struct brw_context *brw = context->driverPrivate;
@@ -419,11 +420,11 @@ intel_create_image_from_renderbuffer(__DRIcontext *context,
 }
 
 static __DRIimage *
-intel_create_image_from_texture(__DRIcontext *context, int target,
-                                unsigned texture, int zoffset,
-                                int level,
-                                unsigned *error,
-                                void *loaderPrivate)
+intel_dri_image_create_from_texture(__DRIcontext *context, int target,
+                                    unsigned texture, int zoffset,
+                                    int level,
+                                    unsigned *error,
+                                    void *loaderPrivate)
 {
    __DRIimage *image;
    struct brw_context *brw = context->driverPrivate;
@@ -479,17 +480,17 @@ intel_create_image_from_texture(__DRIcontext *context, int target,
 }
 
 static void
-intel_destroy_image(__DRIimage *image)
+intel_dri_image_destroy(__DRIimage *image)
 {
     intel_region_release(&image->region);
     free(image);
 }
 
 static __DRIimage *
-intel_create_image(__DRIscreen *screen,
-		   int width, int height, int format,
-		   unsigned int use,
-		   void *loaderPrivate)
+intel_dri_image_create(__DRIscreen *screen,
+                       int width, int height, int format,
+                       unsigned int use,
+                       void *loaderPrivate)
 {
    __DRIimage *image;
    struct intel_screen *intelScreen = screen->driverPrivate;
@@ -525,7 +526,7 @@ intel_create_image(__DRIscreen *screen,
 }
 
 static GLboolean
-intel_query_image(__DRIimage *image, int attrib, int *value)
+intel_dri_image_query(__DRIimage *image, int attrib, int *value)
 {
    switch (attrib) {
    case __DRI_IMAGE_ATTRIB_STRIDE:
@@ -560,7 +561,7 @@ intel_query_image(__DRIimage *image, int attrib, int *value)
 }
 
 static __DRIimage *
-intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
+intel_dri_image_dup(__DRIimage *orig_image, void *loaderPrivate)
 {
    __DRIimage *image;
 
@@ -588,7 +589,7 @@ intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
 }
 
 static GLboolean
-intel_validate_usage(__DRIimage *image, unsigned int use)
+intel_dri_image_validate_usage(__DRIimage *image, unsigned int use)
 {
    if (use & __DRI_IMAGE_USE_CURSOR) {
       if (image->region->width != 64 || image->region->height != 64)
@@ -599,11 +600,11 @@ intel_validate_usage(__DRIimage *image, unsigned int use)
 }
 
 static __DRIimage *
-intel_create_image_from_names(__DRIscreen *screen,
-                              int width, int height, int fourcc,
-                              int *names, int num_names,
-                              int *strides, int *offsets,
-                              void *loaderPrivate)
+intel_dri_image_create_from_names(__DRIscreen *screen,
+                                  int width, int height, int fourcc,
+                                  int *names, int num_names,
+                                  int *strides, int *offsets,
+                                  void *loaderPrivate)
 {
     struct intel_image_format *f = NULL;
     __DRIimage *image;
@@ -616,10 +617,10 @@ intel_create_image_from_names(__DRIscreen *screen,
     if (f == NULL)
         return NULL;
 
-    image = intel_create_image_from_name(screen, width, height,
-                                         __DRI_IMAGE_FORMAT_NONE,
-                                         names[0], strides[0],
-                                         loaderPrivate);
+    image = intel_dri_image_create_from_name(screen, width, height,
+                                             __DRI_IMAGE_FORMAT_NONE,
+                                             names[0], strides[0],
+                                             loaderPrivate);
 
    if (image == NULL)
       return NULL;
@@ -635,10 +636,10 @@ intel_create_image_from_names(__DRIscreen *screen,
 }
 
 static __DRIimage *
-intel_create_image_from_fds(__DRIscreen *screen,
-                            int width, int height, int fourcc,
-                            int *fds, int num_fds, int *strides, int *offsets,
-                            void *loaderPrivate)
+intel_dri_image_create_from_fds(__DRIscreen *screen,
+                                int width, int height, int fourcc,
+                                int *fds, int num_fds, int *strides,
+                                int *offsets, void *loaderPrivate)
 {
    struct intel_screen *intelScreen = screen->driverPrivate;
    struct intel_image_format *f;
@@ -681,16 +682,16 @@ intel_create_image_from_fds(__DRIscreen *screen,
 }
 
 static __DRIimage *
-intel_create_image_from_dma_bufs(__DRIscreen *screen,
-                                 int width, int height, int fourcc,
-                                 int *fds, int num_fds,
-                                 int *strides, int *offsets,
-                                 enum __DRIYUVColorSpace yuv_color_space,
-                                 enum __DRISampleRange sample_range,
-                                 enum __DRIChromaSiting horizontal_siting,
-                                 enum __DRIChromaSiting vertical_siting,
-                                 unsigned *error,
-                                 void *loaderPrivate)
+intel_dri_image_create_from_dma_bufs(__DRIscreen *screen,
+                                     int width, int height, int fourcc,
+                                     int *fds, int num_fds,
+                                     int *strides, int *offsets,
+                                     enum __DRIYUVColorSpace yuv_color_space,
+                                     enum __DRISampleRange sample_range,
+                                     enum __DRIChromaSiting horizontal_siting,
+                                     enum __DRIChromaSiting vertical_siting,
+                                     unsigned *error,
+                                     void *loaderPrivate)
 {
    __DRIimage *image;
    struct intel_image_format *f = intel_image_format_lookup(fourcc);
@@ -701,9 +702,9 @@ intel_create_image_from_dma_bufs(__DRIscreen *screen,
       return NULL;
    }
 
-   image = intel_create_image_from_fds(screen, width, height, fourcc, fds,
-                                       num_fds, strides, offsets,
-                                       loaderPrivate);
+   image = intel_dri_image_create_from_fds(screen, width, height, fourcc, fds,
+                                           num_fds, strides, offsets,
+                                           loaderPrivate);
 
    /*
     * Invalid parameters and any inconsistencies between are assumed to be
@@ -726,7 +727,8 @@ intel_create_image_from_dma_bufs(__DRIscreen *screen,
 }
 
 static __DRIimage *
-intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
+intel_dri_image_create_from_planar(__DRIimage *parent, int plane,
+                                   void *loaderPrivate)
 {
     int width, height, offset, stride, dri_format, index, cpp;
     struct intel_image_format *f;
@@ -779,18 +781,18 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
 static struct __DRIimageExtensionRec intelImageExtension = {
     .base = { __DRI_IMAGE, 8 },
 
-    .createImageFromName                = intel_create_image_from_name,
-    .createImageFromRenderbuffer        = intel_create_image_from_renderbuffer,
-    .destroyImage                       = intel_destroy_image,
-    .createImage                        = intel_create_image,
-    .queryImage                         = intel_query_image,
-    .dupImage                           = intel_dup_image,
-    .validateUsage                      = intel_validate_usage,
-    .createImageFromNames               = intel_create_image_from_names,
-    .fromPlanar                         = intel_from_planar,
-    .createImageFromTexture             = intel_create_image_from_texture,
-    .createImageFromFds                 = intel_create_image_from_fds,
-    .createImageFromDmaBufs             = intel_create_image_from_dma_bufs
+    .createImageFromName           = intel_dri_image_create_from_name,
+    .createImageFromRenderbuffer   = intel_dri_image_create_from_renderbuffer,
+    .destroyImage                  = intel_dri_image_destroy,
+    .createImage                   = intel_dri_image_create,
+    .queryImage                    = intel_dri_image_query,
+    .dupImage                      = intel_dri_image_dup,
+    .validateUsage                 = intel_dri_image_validate_usage,
+    .createImageFromNames          = intel_dri_image_create_from_names,
+    .fromPlanar                    = intel_dri_image_create_from_planar,
+    .createImageFromTexture        = intel_dri_image_create_from_texture,
+    .createImageFromFds            = intel_dri_image_create_from_fds,
+    .createImageFromDmaBufs        = intel_dri_image_create_from_dma_bufs
 };
 
 static int
-- 
1.7.9.5



More information about the mesa-dev mailing list