From: Yogesh Mohanmarimuthu Date: Mon, 18 Oct 2021 16:14:25 +0000 (+0530) Subject: loader,glx,egl/x11: init dri_screen_display_gpu in struct loader_dri3_drawable X-Git-Tag: upstream/23.3.3~14153 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94946251d0e09d53389ba49691095416db7618e2;p=platform%2Fupstream%2Fmesa.git loader,glx,egl/x11: init dri_screen_display_gpu in struct loader_dri3_drawable Initialize dri_screendisplay_gpu variable in struct laoder_dri3_drawable. Also make dri_screen_display_gpu variable as input parameter to function loader_dri3_drawable_init() since dri_screen variable is initialized this way. This also helps to avoid duplicate initializing dri_screen_display_gpu in glx and egl code. Signed-off-by: Yogesh Mohanmarimuthu Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index 243e2d3..04d0fe8 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -189,6 +189,7 @@ dri3_create_surface(_EGLDisplay *disp, EGLint type, _EGLConfig *conf, if (loader_dri3_drawable_init(dri2_dpy->conn, drawable, egl_to_loader_dri3_drawable_type(type), dri2_dpy->dri_screen, + dri2_dpy->dri_screen_display_gpu, dri2_dpy->is_different_gpu, dri2_dpy->multibuffers_available, true, diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 613c620..b3c82dc 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -364,7 +364,7 @@ dri3_create_drawable(struct glx_screen *base, XID xDrawable, if (loader_dri3_drawable_init(XGetXCBConnection(base->dpy), xDrawable, glx_to_loader_dri3_drawable_type(type), - psc->driScreen, + psc->driScreen, psc->driScreenDisplayGPU, psc->is_different_gpu, has_multibuffer, psc->prefer_back_buffer_reuse, config->driConfig, @@ -374,7 +374,6 @@ dri3_create_drawable(struct glx_screen *base, XID xDrawable, return NULL; } - pdraw->loader_drawable.dri_screen_display_gpu = psc->driScreenDisplayGPU; return &pdraw->base; } diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index 5c724c1..0cc73f7 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -378,6 +378,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn, xcb_drawable_t drawable, enum loader_dri3_drawable_type type, __DRIscreen *dri_screen, + __DRIscreen *dri_screen_display_gpu, bool is_different_gpu, bool multiplanes_available, bool prefer_back_buffer_reuse, @@ -397,6 +398,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn, draw->type = type; draw->region = 0; draw->dri_screen = dri_screen; + draw->dri_screen_display_gpu = dri_screen_display_gpu; draw->is_different_gpu = is_different_gpu; draw->multiplanes_available = multiplanes_available; draw->prefer_back_buffer_reuse = prefer_back_buffer_reuse; diff --git a/src/loader/loader_dri3_helper.h b/src/loader/loader_dri3_helper.h index 5eb9c90..8fe6c73 100644 --- a/src/loader/loader_dri3_helper.h +++ b/src/loader/loader_dri3_helper.h @@ -208,6 +208,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn, xcb_drawable_t drawable, enum loader_dri3_drawable_type type, __DRIscreen *dri_screen, + __DRIscreen *dri_screen_display_gpu, bool is_different_gpu, bool is_multiplanes_available, bool prefer_back_buffer_reuse,