[Mesa-dev] [PATCH 05/11 v4] gbm dri backend: add YUYV support

Zhao Halley halley.zhao at intel.com
Wed Jun 27 00:52:22 PDT 2012


---
 src/gbm/backends/dri/gbm_dri.c |    9 +++++++++
 src/gbm/main/gbm.h             |    5 ++++-
 2 files changed, 13 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 src/gbm/backends/dri/gbm_dri.c
 mode change 100644 => 100755 src/gbm/main/gbm.h

diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
old mode 100644
new mode 100755
index e5ddfb6..9e2bd83
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -280,6 +280,9 @@ gbm_dri_is_format_supported(struct gbm_device *gbm,
       if (usage & GBM_BO_USE_SCANOUT)
          return 0;
       break;
+  case GBM_BO_FORMAT_YUYV:
+  case GBM_FORMAT_YUYV:
+     break;
    default:
       return 0;
    }
@@ -331,6 +334,9 @@ gbm_dri_to_gbm_format(uint32_t dri_format)
    case __DRI_IMAGE_FORMAT_ABGR8888:
       ret = GBM_FORMAT_ABGR8888;
       break;
+  case __DRI_IMAGE_FORMAT_YUYV:
+     ret = GBM_FORMAT_YUYV;
+     break;
    default:
       ret = 0;
       break;
@@ -428,6 +434,9 @@ gbm_dri_bo_create(struct gbm_device *gbm,
    case GBM_FORMAT_ABGR8888:
       dri_format = __DRI_IMAGE_FORMAT_ABGR8888;
       break;
+  case GBM_FORMAT_YUYV:
+     dri_format = __DRI_IMAGE_FORMAT_YUYV;
+     break;
    default:
       return NULL;
    }
diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h
old mode 100644
new mode 100755
index af5dc5a..b2a0aa3
--- a/src/gbm/main/gbm.h
+++ b/src/gbm/main/gbm.h
@@ -73,7 +73,10 @@ enum gbm_bo_format {
    /** RGB with 8 bits per channel in a 32 bit value */
    GBM_BO_FORMAT_XRGB8888, 
    /** ARGB with 8 bits per channel in a 32 bit value */
-   GBM_BO_FORMAT_ARGB8888
+   GBM_BO_FORMAT_ARGB8888, 
+   /** YUYV: packed YUV format with 422 subsampling*/
+   GBM_BO_FORMAT_YUYV,
+   
 };
 
 #define __gbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
-- 
1.7.5.4



More information about the mesa-dev mailing list