Skip to content

Commit

Permalink
drm/i915/fbc: don't store/check a pointer to the FB
Browse files Browse the repository at this point in the history
We already make sure we run intel_fbc_update_update during modesets
and page flips, and this function takes care of deactivating FBC, so
it shouldn't be possible for us to reach the condition we check at
intel_fbc_work_fn. So instead of grabbing framebuffer references and
adding a lot of code to track when we need to free them, just don't
track anything at all since we shouldn't need to.

v2: Rebase.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1453210558-7875-25-git-send-email-paulo.r.zanoni@intel.com
  • Loading branch information
Paulo Zanoni committed Jan 29, 2016
1 parent e8216e5 commit 9b42281
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,6 @@ struct intel_fbc {
bool scheduled;
u32 scheduled_vblank;
struct work_struct work;
struct drm_framebuffer *fb;
} work;

const char *no_fbc_reason;
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/i915/intel_fbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,7 @@ static void intel_fbc_work_fn(struct work_struct *__work)
goto retry;
}

if (crtc->base.primary->fb == work->fb)
fbc->activate(dev_priv);
fbc->activate(dev_priv);

work->scheduled = false;

Expand Down Expand Up @@ -441,7 +440,6 @@ static void intel_fbc_schedule_activation(struct intel_crtc *crtc)
* we're not releasing fbc.lock, so it won't have an opportunity to grab
* it to discover that it was cancelled. So we just update the expected
* jiffy count. */
work->fb = crtc->base.primary->fb;
work->scheduled = true;
work->scheduled_vblank = drm_crtc_vblank_count(&crtc->base);
drm_crtc_vblank_put(&crtc->base);
Expand Down

0 comments on commit 9b42281

Please sign in to comment.