OSDN Git Service

minigbm: add GBM_BO_USE_TEXTURING
authorDongseong Hwang <dongseong.hwang@intel.com>
Fri, 23 Jun 2017 23:11:50 +0000 (16:11 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 29 Jun 2017 21:16:37 +0000 (14:16 -0700)
Chromium passes in no flags to gbm_bo_create() to indicate the buffer will be
used as a texture. This convention has caused confusion in the past.

CL:448251 introduced BO_USE_TEXTURE, so it makes sense to match the more
explicit internal semantics.

TEST=run mapped_texture_test -f NV12 of drm-tests package on amd64-generic
BUG=chromium:683347

Change-Id: I40782763d125e640b4bb6a157035b17ebc32cc8c
Reviewed-on: https://chromium-review.googlesource.com/546884
Commit-Ready: Dongseong Hwang <dongseong.hwang@intel.com>
Tested-by: Dongseong Hwang <dongseong.hwang@intel.com>
Reviewed-by: Dongseong Hwang <dongseong.hwang@intel.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
gbm.h
gbm_helpers.c

diff --git a/gbm.h b/gbm.h
index 1fb338f..312b098 100644 (file)
--- a/gbm.h
+++ b/gbm.h
@@ -239,6 +239,10 @@ enum gbm_bo_flags {
     * buffer.
     */
    GBM_BO_USE_LINEAR    = (1 << 4),
+   /**
+    * The buffer will be used as a texture that will be sampled from.
+    */
+   GBM_BO_USE_TEXTURING    = (1 << 5),
 };
 
 int
index c60a315..2b9ce23 100644 (file)
@@ -22,6 +22,8 @@ uint64_t gbm_convert_flags(uint32_t flags)
                usage |= BO_USE_CURSOR_64X64;
        if (flags & GBM_BO_USE_RENDERING)
                usage |= BO_USE_RENDERING;
+       if (flags & GBM_BO_USE_TEXTURING)
+               usage |= BO_USE_TEXTURE;
        if (flags & GBM_BO_USE_LINEAR)
                usage |= BO_USE_LINEAR;