diff options
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_screen.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_screen.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 120e404fa41..9879a4db174 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -113,9 +113,25 @@ vc4_screen_destroy(struct pipe_screen *pscreen) ralloc_free(pscreen); } +static bool +vc4_has_feature(struct vc4_screen *screen, uint32_t feature) +{ + struct drm_vc4_get_param p = { + .param = feature, + }; + int ret = vc4_ioctl(screen->fd, DRM_IOCTL_VC4_GET_PARAM, &p); + + if (ret != 0) + return false; + + return p.value; +} + static int vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) { + struct vc4_screen *screen = vc4_screen(pscreen); + switch (param) { /* Supported features (boolean caps). */ case PIPE_CAP_VERTEX_COLOR_CLAMPED: @@ -135,6 +151,10 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_TEXTURE_BARRIER: return 1; + case PIPE_CAP_TILE_RASTER_ORDER: + return vc4_has_feature(screen, + DRM_VC4_PARAM_SUPPORTS_FIXED_RCL_ORDER); + /* lying for GL 2.0 */ case PIPE_CAP_OCCLUSION_QUERY: case PIPE_CAP_POINT_SPRITE: @@ -266,7 +286,6 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_MEMOBJ: case PIPE_CAP_LOAD_CONSTBUF: case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS: - case PIPE_CAP_TILE_RASTER_ORDER: return 0; /* Stream output. */ @@ -590,20 +609,6 @@ static int handle_compare(void *key1, void *key2) } static bool -vc4_has_feature(struct vc4_screen *screen, uint32_t feature) -{ - struct drm_vc4_get_param p = { - .param = feature, - }; - int ret = vc4_ioctl(screen->fd, DRM_IOCTL_VC4_GET_PARAM, &p); - - if (ret != 0) - return false; - - return p.value; -} - -static bool vc4_get_chip_info(struct vc4_screen *screen) { struct drm_vc4_get_param ident0 = { |