diff options
author | Jesse Barnes <[email protected]> | 2012-02-21 12:53:09 -0800 |
---|---|---|
committer | Jesse Barnes <[email protected]> | 2012-02-22 09:41:40 -0800 |
commit | 8de5c355fa2bf0f30df2c7cf39aee01e793284bf (patch) | |
tree | 4001a8ba5a618e607626610532a67fe080f7d8f4 /src/mesa/drivers/dri/radeon | |
parent | d35d3d612acef1612aaab9a923b8814d4dbb4d9c (diff) |
gbm: track buffer format through DRI drivers
GBM needs the buffer format in order to communicate with DRM and clients
for things like scanout.
So track the DRI format requested in the various back ends and use it to
return the DRI format back to GBM when requested. GBM will then map
this into the GBM surface type (which is in turn based on the DRM fb
format list).
Signed-off-by: Jesse Barnes <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 1f60f2ae43f..85cfe17ad76 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -314,6 +314,8 @@ radeon_create_image(__DRIscreen *screen, if (image == NULL) return NULL; + image->dri_format = format; + switch (format) { case __DRI_IMAGE_FORMAT_RGB565: image->format = MESA_FORMAT_RGB565; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h index 1f0f383c683..dd618f5836f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.h +++ b/src/mesa/drivers/dri/radeon/radeon_screen.h @@ -109,6 +109,7 @@ typedef struct radeon_screen { struct __DRIimageRec { struct radeon_bo *bo; GLenum internal_format; + uint32_t dri_format; GLuint format; GLenum data_type; int width, height; /* in pixels */ |