[Intel-gfx] [PATCH 7/9] drm/i915: don't alloc/free fbc_work at every update

Chris Wilson chris at chris-wilson.co.uk
Thu Dec 25 02:33:11 PST 2014


On Tue, Dec 23, 2014 at 10:35:43AM -0200, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni at intel.com>
> 
> Because there's no need for it. Just use a static structure with a
> bool field to tell if it's in use or not. The big advantage here is
> not saving kzalloc/kfree calls, it's cutting the ugly "failed to
> allocate FBC work structure" code path: in this path we call
> enable_fbc() directly but we don't update fbc.crtc, fbc.fb_id and
> fbc.y - they are updated in intel_fbc_work_fn(), which we're not
> calling. And since testing out-of-memory cases like this is really
> hard, getting rid of the code path is a major relief.

No, it is not that hard to test.

The complaint here should be addressed by a function to call
dev_priv->display.enable_fbc, which would do the common task of setting
dev_priv->fbc.crtc, .fb_id, .y and *.enabled*.

That would remove duplicated code first. And then you can argue about
the merits of replacing the kmalloc by growing our global state.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list