wip! renderer/native: only flip secondary crtc if using GBM
It's possible that the secondary gpu isn't using GBM for renderering. if that's the case we shouldn't try to flip using drm apis. This commit checks, and only does the flip when expected.
This commit is contained in:
parent
0540e4dc45
commit
8f538671d6
@ -1408,11 +1408,12 @@ meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
|
|||||||
CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
|
CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
|
||||||
MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
|
MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
|
||||||
MetaRendererNative *renderer_native = onscreen_native->renderer_native;
|
MetaRendererNative *renderer_native = onscreen_native->renderer_native;
|
||||||
|
MetaRendererNativeMode renderer_mode;
|
||||||
MetaGpuKms *render_gpu = onscreen_native->render_gpu;
|
MetaGpuKms *render_gpu = onscreen_native->render_gpu;
|
||||||
MetaRendererNativeGpuData *renderer_gpu_data;
|
MetaRendererNativeGpuData *renderer_gpu_data;
|
||||||
MetaGpuKms *gpu_kms;
|
MetaGpuKms *gpu_kms;
|
||||||
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state = NULL;
|
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state = NULL;
|
||||||
uint32_t fb_id;
|
uint32_t fb_id = 0;
|
||||||
|
|
||||||
gpu_kms = META_GPU_KMS (meta_crtc_get_gpu (crtc));
|
gpu_kms = META_GPU_KMS (meta_crtc_get_gpu (crtc));
|
||||||
if (!meta_gpu_kms_is_crtc_active (gpu_kms, crtc))
|
if (!meta_gpu_kms_is_crtc_active (gpu_kms, crtc))
|
||||||
@ -1423,19 +1424,27 @@ meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
|
|||||||
|
|
||||||
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
|
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
|
||||||
render_gpu);
|
render_gpu);
|
||||||
switch (renderer_gpu_data->mode)
|
|
||||||
{
|
|
||||||
case META_RENDERER_NATIVE_MODE_GBM:
|
|
||||||
if (gpu_kms == render_gpu)
|
if (gpu_kms == render_gpu)
|
||||||
{
|
{
|
||||||
fb_id = onscreen_native->gbm.next_fb_id;
|
renderer_mode = renderer_gpu_data->mode;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
secondary_gpu_state = get_secondary_gpu_state (onscreen, gpu_kms);
|
secondary_gpu_state = get_secondary_gpu_state (onscreen, gpu_kms);
|
||||||
fb_id = secondary_gpu_state->gbm.next_fb_id;
|
renderer_mode = renderer_gpu_data->secondary.mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (renderer_mode)
|
||||||
|
{
|
||||||
|
case META_RENDERER_NATIVE_MODE_GBM:
|
||||||
|
if (gpu_kms == render_gpu)
|
||||||
|
fb_id = onscreen_native->gbm.next_fb_id;
|
||||||
|
else
|
||||||
|
fb_id = secondary_gpu_state->gbm.next_fb_id;
|
||||||
|
|
||||||
|
if (fb_id)
|
||||||
|
{
|
||||||
if (!meta_gpu_kms_flip_crtc (gpu_kms,
|
if (!meta_gpu_kms_flip_crtc (gpu_kms,
|
||||||
crtc,
|
crtc,
|
||||||
x, y,
|
x, y,
|
||||||
@ -1447,7 +1456,7 @@ meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
|
|||||||
onscreen_native->total_pending_flips++;
|
onscreen_native->total_pending_flips++;
|
||||||
if (secondary_gpu_state)
|
if (secondary_gpu_state)
|
||||||
secondary_gpu_state->pending_flips++;
|
secondary_gpu_state->pending_flips++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_EGL_DEVICE
|
#ifdef HAVE_EGL_DEVICE
|
||||||
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
|
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
|
||||||
|
Loading…
Reference in New Issue
Block a user