mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 05:50:04 +01:00
Merge branch 'gbm_bo_use_front_rendering' into 'master'
modesetting: use GBM_BO_USE_FRONT_RENDERING See merge request xorg/xserver!1744
This commit is contained in:
commit
f45a614a10
2 changed files with 25 additions and 5 deletions
|
|
@ -1104,7 +1104,8 @@ drmmode_bo_import(drmmode_ptr drmmode, drmmode_bo *bo,
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
|
drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
|
||||||
unsigned width, unsigned height, unsigned bpp)
|
unsigned width, unsigned height, unsigned bpp,
|
||||||
|
uint32_t gbm_bo_use_flag)
|
||||||
{
|
{
|
||||||
bo->width = width;
|
bo->width = width;
|
||||||
bo->height = height;
|
bo->height = height;
|
||||||
|
|
@ -1137,9 +1138,16 @@ drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
|
||||||
FALSE, TRUE);
|
FALSE, TRUE);
|
||||||
if (num_modifiers > 0 &&
|
if (num_modifiers > 0 &&
|
||||||
!(num_modifiers == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID)) {
|
!(num_modifiers == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID)) {
|
||||||
|
#ifdef GBM_BO_WITH_MODIFIERS2
|
||||||
|
bo->gbm = gbm_bo_create_with_modifiers2(drmmode->gbm, width, height,
|
||||||
|
format, modifiers,
|
||||||
|
num_modifiers,
|
||||||
|
GBM_BO_USE_SCANOUT | gbm_bo_use_flag);
|
||||||
|
#else
|
||||||
bo->gbm = gbm_bo_create_with_modifiers(drmmode->gbm, width, height,
|
bo->gbm = gbm_bo_create_with_modifiers(drmmode->gbm, width, height,
|
||||||
format, modifiers,
|
format, modifiers,
|
||||||
num_modifiers);
|
num_modifiers);
|
||||||
|
#endif
|
||||||
free(modifiers);
|
free(modifiers);
|
||||||
if (bo->gbm) {
|
if (bo->gbm) {
|
||||||
bo->used_modifiers = TRUE;
|
bo->used_modifiers = TRUE;
|
||||||
|
|
@ -1149,7 +1157,7 @@ drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bo->gbm = gbm_bo_create(drmmode->gbm, width, height, format,
|
bo->gbm = gbm_bo_create(drmmode->gbm, width, height, format,
|
||||||
GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT);
|
GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT | gbm_bo_use_flag);
|
||||||
bo->used_modifiers = FALSE;
|
bo->used_modifiers = FALSE;
|
||||||
return bo->gbm != NULL;
|
return bo->gbm != NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -2111,7 +2119,7 @@ drmmode_shadow_fb_allocate(xf86CrtcPtr crtc, int width, int height,
|
||||||
drmmode_ptr drmmode = drmmode_crtc->drmmode;
|
drmmode_ptr drmmode = drmmode_crtc->drmmode;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!drmmode_create_bo(drmmode, bo, width, height, drmmode->kbpp)) {
|
if (!drmmode_create_bo(drmmode, bo, width, height, drmmode->kbpp, 0)) {
|
||||||
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
|
||||||
"Couldn't allocate shadow memory for rotated CRTC\n");
|
"Couldn't allocate shadow memory for rotated CRTC\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -3663,7 +3671,12 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
|
||||||
drmmode->fb_id = 0;
|
drmmode->fb_id = 0;
|
||||||
|
|
||||||
if (!drmmode_create_bo(drmmode, &drmmode->front_bo,
|
if (!drmmode_create_bo(drmmode, &drmmode->front_bo,
|
||||||
width, height, drmmode->kbpp))
|
width, height, drmmode->kbpp,
|
||||||
|
#ifdef HAVE_GBM_BO_USE_FRONT_RENDERING
|
||||||
|
GBM_BO_USE_FRONT_RENDERING))
|
||||||
|
#else
|
||||||
|
0))
|
||||||
|
#endif
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
pitch = drmmode_bo_get_pitch(&drmmode->front_bo);
|
pitch = drmmode_bo_get_pitch(&drmmode->front_bo);
|
||||||
|
|
@ -4444,7 +4457,12 @@ drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
|
||||||
width = pScrn->virtualX;
|
width = pScrn->virtualX;
|
||||||
height = pScrn->virtualY;
|
height = pScrn->virtualY;
|
||||||
|
|
||||||
if (!drmmode_create_bo(drmmode, &drmmode->front_bo, width, height, bpp))
|
if (!drmmode_create_bo(drmmode, &drmmode->front_bo, width, height, bpp,
|
||||||
|
#ifdef HAVE_GBM_BO_USE_FRONT_RENDERING
|
||||||
|
GBM_BO_USE_FRONT_RENDERING))
|
||||||
|
#else
|
||||||
|
0))
|
||||||
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
pScrn->displayWidth = drmmode_bo_get_pitch(&drmmode->front_bo) / cpp;
|
pScrn->displayWidth = drmmode_bo_get_pitch(&drmmode->front_bo) / cpp;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,8 @@ conf_data.set('GBM_BO_FD_FOR_PLANE',
|
||||||
build_glamor and gbm_dep.found() and gbm_dep.version().version_compare('>= 21.1') ? '1' : false)
|
build_glamor and gbm_dep.found() and gbm_dep.version().version_compare('>= 21.1') ? '1' : false)
|
||||||
conf_data.set('GBM_BO_WITH_MODIFIERS2',
|
conf_data.set('GBM_BO_WITH_MODIFIERS2',
|
||||||
build_glamor and gbm_dep.found() and gbm_dep.version().version_compare('>= 21.3') ? '1' : false)
|
build_glamor and gbm_dep.found() and gbm_dep.version().version_compare('>= 21.3') ? '1' : false)
|
||||||
|
conf_data.set('HAVE_GBM_BO_USE_FRONT_RENDERING',
|
||||||
|
build_glamor and gbm_dep.found() and gbm_dep.version().version_compare('>= 22.3') ? '1' : false)
|
||||||
|
|
||||||
conf_data.set_quoted('SERVER_MISC_CONFIG_PATH', serverconfigdir)
|
conf_data.set_quoted('SERVER_MISC_CONFIG_PATH', serverconfigdir)
|
||||||
conf_data.set_quoted('PROJECTROOT', get_option('prefix'))
|
conf_data.set_quoted('PROJECTROOT', get_option('prefix'))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue