]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/bdw: Split ppgtt initialization up
authorBen Widawsky <benjamin.widawsky@intel.com>
Thu, 20 Feb 2014 06:05:43 +0000 (22:05 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 4 Mar 2014 14:54:59 +0000 (15:54 +0100)
commit9ff8b08d86a6c9b96a09e051aba2fd2e25b79119
treef9d53478484813a9da2981a41c1c1551e2d0ecbc
parent06ddba4d77e1122f5e4e674e667a5e8abcb82425
drm/i915/bdw: Split ppgtt initialization up

Like cleanup in an earlier patch, the code becomes much more readable,
and easier to extend if we extract out helper functions for the various
stages of init.

Note that with this patch it becomes really simple, and tempting to begin
using the 'goto out' idiom with explicit free/fini semantics. I've
kept the error path as similar as possible to the cleanup() function to
make sure cleanup is as robust as possible

v2: Remove comment "NB:From here on, ppgtt->base.cleanup() should
function properly"
Update commit message to reflect above

v3: Rebased on top of bugfixes found in the previous patch by Imre
Moved number of pd pages assertion to the proper place (Imre)

v4:
Allocate dma address space for num_pd_pages, not num_pd_entries (Ben)
Don't use gen8_pt_dma_addr after free on error path (Imre)
With new fix from v4 of the previous patch.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_gtt.c