[Piglit] [PATCH] utils: Move DRM_FORMATS defines to piglit_drm_dma_buf.h.

Vinson Lee vlee at freedesktop.org
Mon Oct 3 21:58:23 UTC 2016


This patch fixes this build error.

transcode-nv12-as-r8-gr88.c: In function ‘create_textures’:
transcode-nv12-as-r8-gr88.c:178:7: error: ‘DRM_FORMAT_R8’ undeclared (first use in this function)
       DRM_FORMAT_R8, r8_pixels);
       ^

Fixes: 0222f5db00fd ("dmabuf: fix YUV tests for drivers other than intel")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/util/piglit-framework-gl/piglit_drm_dma_buf.c | 15 ---------------
 tests/util/piglit-framework-gl/piglit_drm_dma_buf.h | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index a0a2fc42f483..c3225c3990c6 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -40,21 +40,6 @@
 #include <drm.h>
 #include <unistd.h>
 
-/* These definitions were added in libdrm 2.4.68, since that's still pretty
- * recent defined these to allow older libdrm to continue working.
- */
-#ifndef DRM_FORMAT_R8
-#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
-#endif
-
-#ifndef DRM_FORMAT_RG88
-#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8')
-#endif
-
-#ifndef DRM_FORMAT_GR88
-#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8')
-#endif
-
 #define ALIGN(value, alignment) (((value) + alignment - 1) & ~(alignment - 1))
 
 struct piglit_drm_driver {
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
index 5872df93c460..36777a835a7c 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
@@ -23,6 +23,23 @@
 #ifndef PIGLIT_DRM_DMA_BUF_H
 #define PIGLIT_DRM_DMA_BUF_H
 
+#include "drm_fourcc.h"
+
+/* These definitions were added in libdrm 2.4.68, since that's still pretty
+ * recent defined these to allow older libdrm to continue working.
+ */
+#ifndef DRM_FORMAT_R8
+#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
+#endif
+
+#ifndef DRM_FORMAT_RG88
+#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8')
+#endif
+
+#ifndef DRM_FORMAT_GR88
+#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8')
+#endif
+
 struct piglit_dma_buf {
 	unsigned w;
 	unsigned h;
-- 
2.7.4



More information about the Piglit mailing list