[v5,01/11] drm/i915: unmap the correct page in intel_logical_ring_cleanup()

Submitted by Dave Gordon on Feb. 5, 2016, 6:33 p.m.


Message ID 1454697228-33164-2-git-send-email-david.s.gordon@intel.com
State New
Headers show
Series "A collection of cleanups, revisited" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Dave Gordon Feb. 5, 2016, 6:33 p.m.
The kunmap() call here didn't match the corresponding kmap().
The kmap()ing was changed with the introduction of the GuC-compatible
layout of context objects and the introduction of "LRC_PPHWSP_PN", in

    d167519 drm/i915: Integrate GuC-based command submission

but the corresponding kunmap() wasn't, probably because the old code
dug into the underlying sgl implementation instead of than calling
"i915_gem_object_get_page(ring->status_page.obj, 0)", which might more
easily have been noticed as containing an assumption about page 0.

    Use kmap_to_page() rather than repeat the mapping calculation.
    [Chris Wilson]

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
 drivers/gpu/drm/i915/intel_lrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 3a03646..c551c97 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -2012,7 +2012,7 @@  void intel_logical_ring_cleanup(struct intel_engine_cs *ring)
 	if (ring->status_page.obj) {
-		kunmap(sg_page(ring->status_page.obj->pages->sgl));
+		kunmap(kmap_to_page(ring->status_page.page_addr));
 		ring->status_page.obj = NULL;