summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharmaine Lee <charmainel@vmware.com>2017-06-01 15:12:14 -0700
committerBrian Paul <brianp@vmware.com>2018-09-05 11:22:42 -0600
commit49678e9e49fd53000b265904ccabca08b64c4583 (patch)
tree55f03c3c242e229471fae855e41a2693e06b6554
parent4310649ccb37481fd0f15ab0c826ed626bf81caa (diff)
svga: sync with upstream changes to surface flags
SVGA device now supports 64 bits surface flags. This patch updates the winsys interface to allow 64 bits surface flags. The linux winsys layer will for now only honor the lower 32 bits of the surface flags. Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--src/gallium/drivers/svga/svga_screen_cache.c2
-rw-r--r--src/gallium/drivers/svga/svga_screen_cache.h2
-rw-r--r--src/gallium/drivers/svga/svga_surface.c4
-rw-r--r--src/gallium/drivers/svga/svga_surface.h2
-rw-r--r--src/gallium/drivers/svga/svga_winsys.h2
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen.h6
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_dri.c2
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_ioctl.c6
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_svga.c7
9 files changed, 19 insertions, 14 deletions
diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c
index 4c923bf8eed..82dd2b2c3a0 100644
--- a/src/gallium/drivers/svga/svga_screen_cache.c
+++ b/src/gallium/drivers/svga/svga_screen_cache.c
@@ -478,7 +478,7 @@ svga_screen_surface_create(struct svga_screen *svgascreen,
if (cachable) {
/* Try to re-cycle a previously freed, cached surface */
if (key->format == SVGA3D_BUFFER) {
- SVGA3dSurface1Flags hint_flag;
+ SVGA3dSurfaceAllFlags hint_flag;
/* For buffers, round the buffer size up to the nearest power
* of two to increase the probability of cache hits. Keep
diff --git a/src/gallium/drivers/svga/svga_screen_cache.h b/src/gallium/drivers/svga/svga_screen_cache.h
index aa8e0c3eff2..a239b761fc2 100644
--- a/src/gallium/drivers/svga/svga_screen_cache.h
+++ b/src/gallium/drivers/svga/svga_screen_cache.h
@@ -60,7 +60,7 @@ struct svga_context;
*/
struct svga_host_surface_cache_key
{
- SVGA3dSurface1Flags flags;
+ SVGA3dSurfaceAllFlags flags;
SVGA3dSurfaceFormat format;
SVGA3dSize size;
uint32_t numFaces:3;
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c
index 98a0cf6ade3..cb74a00c1e0 100644
--- a/src/gallium/drivers/svga/svga_surface.c
+++ b/src/gallium/drivers/svga/svga_surface.c
@@ -151,7 +151,7 @@ struct svga_winsys_surface *
svga_texture_view_surface(struct svga_context *svga,
struct svga_texture *tex,
unsigned bind_flags,
- SVGA3dSurface1Flags flags,
+ SVGA3dSurfaceAllFlags flags,
SVGA3dSurfaceFormat format,
unsigned start_mip,
unsigned num_mip,
@@ -261,7 +261,7 @@ svga_create_surface_view(struct pipe_context *pipe,
struct svga_surface *s;
unsigned layer, zslice, bind;
unsigned nlayers = 1;
- SVGA3dSurface1Flags flags = 0;
+ SVGA3dSurfaceAllFlags flags = 0;
SVGA3dSurfaceFormat format;
struct pipe_surface *retVal = NULL;
diff --git a/src/gallium/drivers/svga/svga_surface.h b/src/gallium/drivers/svga/svga_surface.h
index fc6b333fe7b..6c1e0e72165 100644
--- a/src/gallium/drivers/svga/svga_surface.h
+++ b/src/gallium/drivers/svga/svga_surface.h
@@ -95,7 +95,7 @@ struct svga_winsys_surface *
svga_texture_view_surface(struct svga_context *svga,
struct svga_texture *tex,
unsigned bind_flags,
- SVGA3dSurface1Flags flags,
+ SVGA3dSurfaceAllFlags flags,
SVGA3dSurfaceFormat format,
unsigned start_mip,
unsigned num_mip,
diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h
index a4c4d6a8858..ea7bbb380a8 100644
--- a/src/gallium/drivers/svga/svga_winsys.h
+++ b/src/gallium/drivers/svga/svga_winsys.h
@@ -530,7 +530,7 @@ struct svga_winsys_screen
*/
struct svga_winsys_surface *
(*surface_create)(struct svga_winsys_screen *sws,
- SVGA3dSurface1Flags flags,
+ SVGA3dSurfaceAllFlags flags,
SVGA3dSurfaceFormat format,
unsigned usage,
SVGA3dSize size,
diff --git a/src/gallium/winsys/svga/drm/vmw_screen.h b/src/gallium/winsys/svga/drm/vmw_screen.h
index f21cabb51f9..ea4d2e453be 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen.h
+++ b/src/gallium/winsys/svga/drm/vmw_screen.h
@@ -128,7 +128,7 @@ vmw_ioctl_context_destroy(struct vmw_winsys_screen *vws,
uint32
vmw_ioctl_surface_create(struct vmw_winsys_screen *vws,
- SVGA3dSurfaceFlags flags,
+ SVGA3dSurface1Flags flags,
SVGA3dSurfaceFormat format,
unsigned usage,
SVGA3dSize size,
@@ -137,7 +137,7 @@ vmw_ioctl_surface_create(struct vmw_winsys_screen *vws,
unsigned sampleCount);
uint32
vmw_ioctl_gb_surface_create(struct vmw_winsys_screen *vws,
- SVGA3dSurfaceFlags flags,
+ SVGA3dSurface1Flags flags,
SVGA3dSurfaceFormat format,
unsigned usage,
SVGA3dSize size,
@@ -150,7 +150,7 @@ vmw_ioctl_gb_surface_create(struct vmw_winsys_screen *vws,
int
vmw_ioctl_gb_surface_ref(struct vmw_winsys_screen *vws,
const struct winsys_handle *whandle,
- SVGA3dSurfaceFlags *flags,
+ SVGA3dSurface1Flags *flags,
SVGA3dSurfaceFormat *format,
uint32_t *numMipLevels,
uint32_t *handle,
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_dri.c b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
index 76f29e2aced..4dbac43d314 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_dri.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
@@ -146,7 +146,7 @@ vmw_drm_gb_surface_from_handle(struct svga_winsys_screen *sws,
struct vmw_svga_winsys_surface *vsrf;
struct svga_winsys_surface *ssrf;
struct vmw_winsys_screen *vws = vmw_winsys_screen(sws);
- SVGA3dSurfaceFlags flags;
+ SVGA3dSurface1Flags flags;
uint32_t mip_levels;
struct vmw_buffer_desc desc;
struct pb_manager *provider = vws->pools.gmr;
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
index 99f8f42107e..cb2eb1b4936 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
@@ -131,7 +131,7 @@ vmw_ioctl_context_destroy(struct vmw_winsys_screen *vws, uint32 cid)
uint32
vmw_ioctl_surface_create(struct vmw_winsys_screen *vws,
- SVGA3dSurfaceFlags flags,
+ SVGA3dSurface1Flags flags,
SVGA3dSurfaceFormat format,
unsigned usage,
SVGA3dSize size,
@@ -193,7 +193,7 @@ vmw_ioctl_surface_create(struct vmw_winsys_screen *vws,
uint32
vmw_ioctl_gb_surface_create(struct vmw_winsys_screen *vws,
- SVGA3dSurfaceFlags flags,
+ SVGA3dSurface1Flags flags,
SVGA3dSurfaceFormat format,
unsigned usage,
SVGA3dSize size,
@@ -342,7 +342,7 @@ vmw_ioctl_surface_req(const struct vmw_winsys_screen *vws,
int
vmw_ioctl_gb_surface_ref(struct vmw_winsys_screen *vws,
const struct winsys_handle *whandle,
- SVGA3dSurfaceFlags *flags,
+ SVGA3dSurface1Flags *flags,
SVGA3dSurfaceFormat *format,
uint32_t *numMipLevels,
uint32_t *handle,
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_svga.c b/src/gallium/winsys/svga/drm/vmw_screen_svga.c
index 27a8b070166..9decf0c7053 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_svga.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_svga.c
@@ -170,7 +170,7 @@ vmw_svga_winsys_fence_server_sync(struct svga_winsys_screen *sws,
static struct svga_winsys_surface *
vmw_svga_winsys_surface_create(struct svga_winsys_screen *sws,
- SVGA3dSurfaceFlags flags,
+ SVGA3dSurfaceAllFlags allflags,
SVGA3dSurfaceFormat format,
unsigned usage,
SVGA3dSize size,
@@ -184,6 +184,11 @@ vmw_svga_winsys_surface_create(struct svga_winsys_screen *sws,
struct pb_manager *provider;
uint32_t buffer_size;
+ /* Until the kernel supports 64 bits surface flag, the linux driver
+ * only honors the lower 32 bits of the surface flag.
+ */
+ SVGA3dSurface1Flags flags = (SVGA3dSurface1Flags)allflags;
+
memset(&desc, 0, sizeof(desc));
surface = CALLOC_STRUCT(vmw_svga_winsys_surface);
if(!surface)