mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 11:00:11 +01:00
egl,gallium,glx: replace dri_get_screen_param with pipe_caps access
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32955>
This commit is contained in:
parent
aa9fa085fe
commit
e5e5af05ea
5 changed files with 11 additions and 24 deletions
|
|
@ -628,7 +628,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
|||
unsigned int api_mask = screen->api_mask;
|
||||
|
||||
#ifdef HAVE_LIBDRM
|
||||
int caps = dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_DMABUF);
|
||||
unsigned caps = pscreen->caps.dmabuf;
|
||||
/* set if both import and export are suported */
|
||||
if (dri2_dpy->multibuffers_available) {
|
||||
dri2_dpy->has_dmabuf_import = (caps & DRM_PRIME_CAP_IMPORT) > 0;
|
||||
|
|
@ -636,7 +636,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
|||
}
|
||||
#endif
|
||||
#ifdef HAVE_ANDROID_PLATFORM
|
||||
dri2_dpy->has_native_fence_fd = dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_NATIVE_FENCE_FD);
|
||||
dri2_dpy->has_native_fence_fd = pscreen->caps.native_fence_fd;
|
||||
#endif
|
||||
dri2_dpy->has_compression_modifiers = pscreen->query_compression_rates &&
|
||||
(pscreen->query_compression_modifiers || dri2_dpy->kopper);
|
||||
|
|
@ -673,8 +673,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
|||
disp->Extensions.MESA_query_driver = EGL_TRUE;
|
||||
|
||||
/* Report back to EGL the bitmask of priorities supported */
|
||||
disp->Extensions.IMG_context_priority =
|
||||
dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_CONTEXT_PRIORITY_MASK);
|
||||
disp->Extensions.IMG_context_priority = pscreen->caps.context_priority_mask;
|
||||
|
||||
/**
|
||||
* FIXME: Some drivers currently misreport what context priorities the user
|
||||
|
|
@ -699,9 +698,8 @@ dri2_setup_screen(_EGLDisplay *disp)
|
|||
disp->Extensions.EXT_config_select_group = EGL_TRUE;
|
||||
|
||||
disp->Extensions.EXT_create_context_robustness =
|
||||
dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_DEVICE_RESET_STATUS_QUERY);
|
||||
disp->RobustBufferAccess =
|
||||
dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR);
|
||||
pscreen->caps.device_reset_status_query;
|
||||
disp->RobustBufferAccess = pscreen->caps.robust_buffer_access_behavior;
|
||||
|
||||
/* EXT_query_reset_notification_strategy complements and requires
|
||||
* EXT_create_context_robustness. */
|
||||
|
|
@ -725,7 +723,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
|||
disp->Extensions.MESA_drm_image = (capabilities & __DRI_IMAGE_CAP_GLOBAL_NAMES) != 0;
|
||||
|
||||
#ifdef HAVE_LIBDRM
|
||||
if (dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_DMABUF) & DRM_PRIME_CAP_EXPORT)
|
||||
if (pscreen->caps.dmabuf & DRM_PRIME_CAP_EXPORT)
|
||||
disp->Extensions.MESA_image_dma_buf_export = true;
|
||||
|
||||
if (dri2_dpy->has_dmabuf_import) {
|
||||
|
|
@ -740,7 +738,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
|||
disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_texture_cubemap_image = EGL_TRUE;
|
||||
|
||||
if (dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_MAX_TEXTURE_3D_LEVELS) != 0)
|
||||
if (pscreen->caps.max_texture_3d_levels != 0)
|
||||
disp->Extensions.KHR_gl_texture_3D_image = EGL_TRUE;
|
||||
|
||||
disp->Extensions.KHR_context_flush_control = EGL_TRUE;
|
||||
|
|
@ -748,10 +746,8 @@ dri2_setup_screen(_EGLDisplay *disp)
|
|||
if (dri_get_pipe_screen(dri2_dpy->dri_screen_render_gpu)->set_damage_region)
|
||||
disp->Extensions.KHR_partial_update = EGL_TRUE;
|
||||
|
||||
disp->Extensions.EXT_protected_surface =
|
||||
dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_DEVICE_PROTECTED_SURFACE) != 0;
|
||||
disp->Extensions.EXT_protected_content =
|
||||
dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_DEVICE_PROTECTED_CONTEXT) != 0;
|
||||
disp->Extensions.EXT_protected_surface = pscreen->caps.device_protected_surface;
|
||||
disp->Extensions.EXT_protected_content = pscreen->caps.device_protected_context;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1055,10 +1055,3 @@ dri_get_pipe_screen(struct dri_screen *screen)
|
|||
{
|
||||
return screen->base.screen;
|
||||
}
|
||||
|
||||
int
|
||||
dri_get_screen_param(struct dri_screen *driScreen, enum pipe_cap param)
|
||||
{
|
||||
struct pipe_screen *screen = dri_get_pipe_screen(driScreen);
|
||||
return screen->get_param(screen, param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -337,6 +337,4 @@ dri_set_blob_cache_funcs(struct dri_screen *screen, __DRIblobCacheSet set,
|
|||
|
||||
PUBLIC struct pipe_screen *
|
||||
dri_get_pipe_screen(struct dri_screen *driScreen);
|
||||
PUBLIC int
|
||||
dri_get_screen_param(struct dri_screen *driScreen, enum pipe_cap param);
|
||||
#endif /* _DRI_UTIL_H_ */
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@
|
|||
dri_server_wait_sync;
|
||||
dri_set_blob_cache_funcs;
|
||||
dri_get_pipe_screen;
|
||||
dri_get_screen_param;
|
||||
dri3*;
|
||||
loader_dri3*;
|
||||
dri_create_drawable;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include <xcb/xcb.h>
|
||||
#include <xcb/glx.h>
|
||||
#include "dri_util.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
|
@ -807,7 +808,7 @@ bind_extensions(struct glx_screen *psc, const char *driverName)
|
|||
"GLX_EXT_create_context_es2_profile");
|
||||
}
|
||||
|
||||
if (dri_get_screen_param(psc->frontend_screen, PIPE_CAP_DEVICE_RESET_STATUS_QUERY))
|
||||
if (dri_get_pipe_screen(psc->frontend_screen)->caps.device_reset_status_query)
|
||||
__glXEnableDirectExtension(psc,
|
||||
"GLX_ARB_create_context_robustness");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue