diff options
author | Gurchetan Singh <[email protected]> | 2019-08-06 19:15:58 -0700 |
---|---|---|
committer | Gurchetan Singh <[email protected]> | 2019-08-08 16:21:57 -0700 |
commit | 42759dc986bfabd60ab3c179e9858fac1b0f369c (patch) | |
tree | 73aa368da76fb73cfa56044081b13571e3bb25b5 | |
parent | 3da029ac1a6e159f1e98110beb136d089ff6cf37 (diff) |
virgl: check scanout mask
Otherwise, virgl will report renderable or texturable formats as
also scan-out formats.
v2: drop host feature check (@kusma)
Reviewed-by: Erik Faye-Lund <[email protected]>
-rw-r--r-- | src/gallium/drivers/virgl/virgl_hw.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/virgl/virgl_screen.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_hw.h b/src/gallium/drivers/virgl/virgl_hw.h index 94f5987fe32..e23a6194a9d 100644 --- a/src/gallium/drivers/virgl/virgl_hw.h +++ b/src/gallium/drivers/virgl/virgl_hw.h @@ -399,6 +399,7 @@ struct virgl_caps_v2 { uint32_t max_combined_atomic_counter_buffers; uint32_t host_feature_check_version; struct virgl_supported_format_mask supported_readback_formats; + struct virgl_supported_format_mask scanout; }; union virgl_caps { diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index 3bd6d48091c..f4b7a66003b 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -738,6 +738,11 @@ virgl_is_format_supported( struct pipe_screen *screen, return false; } + if (bind & PIPE_BIND_SCANOUT) { + if (!virgl_format_check_bitmask(format, caps->v2.scanout.bitmask, false)) + return false; + } + /* * All other operations (sampling, transfer, etc). */ @@ -905,6 +910,7 @@ virgl_create_screen(struct virgl_winsys *vws, const struct pipe_screen_config *c vws->get_caps(vws, &screen->caps); fixup_formats(&screen->caps.caps, &screen->caps.caps.v2.supported_readback_formats); + fixup_formats(&screen->caps.caps, &screen->caps.caps.v2.scanout); screen->refcnt = 1; |