aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_screen.c
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-08-07 16:22:16 -0700
committerGurchetan Singh <[email protected]>2019-08-08 16:21:57 -0700
commit3da029ac1a6e159f1e98110beb136d089ff6cf37 (patch)
tree6e9b462615d99e3e8712867f857d3c0a0b599cd7 /src/gallium/drivers/virgl/virgl_screen.c
parentbf0ca99ec708518e7f5242680e52508c8708362c (diff)
virgl: fixup_readback_format --> fixup_formats
This function is generalizable. Suggested-by: Erik Faye-Lund <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_screen.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index 7153383e9a1..3bd6d48091c 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -842,21 +842,19 @@ virgl_destroy_screen(struct pipe_screen *screen)
}
static void
-fixup_readback_format(union virgl_caps *caps)
+fixup_formats(union virgl_caps *caps, struct virgl_supported_format_mask *mask)
{
- const size_t size = ARRAY_SIZE(caps->v2.supported_readback_formats.bitmask);
+ const size_t size = ARRAY_SIZE(mask->bitmask);
for (int i = 0; i < size; ++i) {
- if (caps->v2.supported_readback_formats.bitmask[i] != 0)
+ if (mask->bitmask[i] != 0)
return; /* we got some formats, we definately have a new protocol */
}
/* old protocol used; fall back to considering all sampleable formats valid
* readback-formats
*/
- for (int i = 0; i < size; ++i) {
- caps->v2.supported_readback_formats.bitmask[i] =
- caps->v1.sampler.bitmask[i];
- }
+ for (int i = 0; i < size; ++i)
+ mask->bitmask[i] = caps->v1.sampler.bitmask[i];
}
struct pipe_screen *
@@ -905,7 +903,8 @@ virgl_create_screen(struct virgl_winsys *vws, const struct pipe_screen_config *c
virgl_init_screen_resource_functions(&screen->base);
vws->get_caps(vws, &screen->caps);
- fixup_readback_format(&screen->caps.caps);
+ fixup_formats(&screen->caps.caps,
+ &screen->caps.caps.v2.supported_readback_formats);
screen->refcnt = 1;