]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/gpu/drm/i915/i915_gem_gtt.c
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)
commitbf2b4ed291a8a3681ba0cb50b6ba5423c47b9fac
treef9d53478484813a9da2981a41c1c1551e2d0ecbc
parentf3a964b96d792eac67976a3bb296a0d2049b4f91
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