drm/i915/fb: Track rpm wakerefs
Keep track of the rpm wakeref used for framebuffer access so that we can cancel upon release and so more clearly identify leaks. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190114142129.24398-11-chris@chris-wilson.co.uk
This commit is contained in:
@@ -177,8 +177,9 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
||||
const struct i915_ggtt_view view = {
|
||||
.type = I915_GGTT_VIEW_NORMAL,
|
||||
};
|
||||
struct fb_info *info;
|
||||
struct drm_framebuffer *fb;
|
||||
intel_wakeref_t wakeref;
|
||||
struct fb_info *info;
|
||||
struct i915_vma *vma;
|
||||
unsigned long flags = 0;
|
||||
bool prealloc = false;
|
||||
@@ -209,7 +210,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
||||
}
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
intel_runtime_pm_get(dev_priv);
|
||||
wakeref = intel_runtime_pm_get(dev_priv);
|
||||
|
||||
/* Pin the GGTT vma for our access via info->screen_base.
|
||||
* This also validates that any existing fb inherited from the
|
||||
@@ -276,7 +277,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
||||
ifbdev->vma = vma;
|
||||
ifbdev->vma_flags = flags;
|
||||
|
||||
intel_runtime_pm_put_unchecked(dev_priv);
|
||||
intel_runtime_pm_put(dev_priv, wakeref);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
vga_switcheroo_client_fb_set(pdev, info);
|
||||
return 0;
|
||||
@@ -284,7 +285,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
||||
out_unpin:
|
||||
intel_unpin_fb_vma(vma, flags);
|
||||
out_unlock:
|
||||
intel_runtime_pm_put_unchecked(dev_priv);
|
||||
intel_runtime_pm_put(dev_priv, wakeref);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user