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>
This commit is contained in:
Charmaine Lee 2017-06-01 15:12:14 -07:00 committed by Brian Paul
parent 4310649ccb
commit 49678e9e49
9 changed files with 19 additions and 14 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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;

View File

@ -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,

View File

@ -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)