diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-02-02 10:03:33 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-02-02 10:03:33 +0000 |
commit | 70cb682662f9c54bcc7cc0eda029c21efbb4947f (patch) | |
tree | cf85fdbeb9f7b69458a7ab6384581b80007837d9 /src/uxa | |
parent | 6d2754b1902e8bce37818c854fb890400b27343e (diff) |
uxa/dri2: Recreate the triple buffer across a mode change
If the mode changes whilst we have a pending flip, we may reinstall the
previous scanout buffer as our next back buffer despite it no longer
matching.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/uxa')
-rw-r--r-- | src/uxa/intel.h | 5 | ||||
-rw-r--r-- | src/uxa/intel_dri.c | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/uxa/intel.h b/src/uxa/intel.h index 55f74e5c..37b23e99 100644 --- a/src/uxa/intel.h +++ b/src/uxa/intel.h @@ -415,6 +415,11 @@ typedef struct _DRI2FrameEvent { DRI2BufferPtr front; DRI2BufferPtr back; + /* current scanout for triple buffer */ + int old_width; + int old_height; + int old_pitch; + int old_tiling; dri_bo *old_buffer; } DRI2FrameEventRec, *DRI2FrameEventPtr; diff --git a/src/uxa/intel_dri.c b/src/uxa/intel_dri.c index 481782f7..32622ad7 100644 --- a/src/uxa/intel_dri.c +++ b/src/uxa/intel_dri.c @@ -709,7 +709,14 @@ i830_dri2_del_frame_event(DRI2FrameEventPtr info) I830DRI2DestroyBuffer(NULL, info->back); if (info->old_buffer) { - if (info->intel->back_buffer == NULL) + /* Check that the old buffer still matches the front buffer + * in case a mode change occurred before we woke up. + */ + if (info->intel->back_buffer == NULL && + info->old_width == info->intel->scrn->virtualX && + info->old_height == info->intel->scrn->virtualY && + info->old_pitch == info->intel->front_pitch && + info->old_tiling == info->intel->front_tiling) info->intel->back_buffer = info->old_buffer; else dri_bo_unreference(info->old_buffer); @@ -895,6 +902,10 @@ queue_flip(struct intel_screen_private *intel, #if DRI2INFOREC_VERSION >= 6 if (intel->use_triple_buffer && allocate_back_buffer(intel)) { + info->old_width = intel->scrn->virtualX; + info->old_height = intel->scrn->virtualY; + info->old_pitch = intel->front_pitch; + info->old_tiling = intel->front_tiling; info->old_buffer = intel->front_buffer; dri_bo_reference(info->old_buffer); |