st/dri: inline dri2_buffer.h within dri2.c
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 24 Aug 2018 13:05:59 +0000 (14:05 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 3 Oct 2018 12:38:05 +0000 (13:38 +0100)
The header was used only by dri2.c, containing a two-member struct and cast wrapper.
Just inline it where it's used/needed.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/gallium/state_trackers/dri/Makefile.sources
src/gallium/state_trackers/dri/dri2.c
src/gallium/state_trackers/dri/dri2_buffer.h [deleted file]
src/gallium/state_trackers/dri/meson.build

index 36d5d47bb332763d9e9768fb4a6d4622f2baa8f2..a610293bb110b0586cbc9bc9f75ed276f6b0b797 100644 (file)
@@ -11,8 +11,7 @@ common_SOURCES := \
        dri_screen.h
 
 dri2_SOURCES := \
-       dri2.c \
-       dri2_buffer.h
+       dri2.c
 
 drisw_SOURCES := \
        drisw.c
index 2411a369c5d9c0eb3f42ceb71be14e12a9d9a67c..20540e3988143884c70757f1699c5693d1482e7e 100644 (file)
 #include "main/bufferobj.h"
 #include "main/texobj.h"
 
+#include "dri_util.h"
+
 #include "dri_helpers.h"
 #include "dri_drawable.h"
 #include "dri_query_renderer.h"
-#include "dri2_buffer.h"
 
 #ifndef DRM_FORMAT_MOD_INVALID
 #define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)
 #endif
 
+struct dri2_buffer
+{
+   __DRIbuffer base;
+   struct pipe_resource *resource;
+};
+
+static inline struct dri2_buffer *
+dri2_buffer(__DRIbuffer * driBufferPriv)
+{
+   return (struct dri2_buffer *) driBufferPriv;
+}
+
 static const int fourcc_formats[] = {
    __DRI_IMAGE_FOURCC_ARGB2101010,
    __DRI_IMAGE_FOURCC_XRGB2101010,
diff --git a/src/gallium/state_trackers/dri/dri2_buffer.h b/src/gallium/state_trackers/dri/dri2_buffer.h
deleted file mode 100644 (file)
index 0cee4e9..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef DRI2_BUFFER_H
-#define DRI2_BUFFER_H
-
-#include "dri_util.h"
-
-struct pipe_surface;
-
-struct dri2_buffer
-{
-   __DRIbuffer base;
-   struct pipe_resource *resource;
-};
-
-static inline struct dri2_buffer *
-dri2_buffer(__DRIbuffer * driBufferPriv)
-{
-   return (struct dri2_buffer *) driBufferPriv;
-}
-
-#endif
-
-/* vim: set sw=3 ts=8 sts=3 expandtab: */
index dfc37fcd81c54b5dd10cec02905a2d2183c221f4..4bb41157e42cecb4cbb677135bbea334923109f9 100644 (file)
@@ -38,7 +38,7 @@ if with_dri
 endif
 
 if with_dri2
-  files_libdri += files('dri2.c', 'dri2_buffer.h')
+  files_libdri += files('dri2.c')
 endif
 
 libdri_c_args = []