All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 01/21] drm/i915/fbdev: Call intel_unpin_fb_obj() on release
Date: Sun, 24 Apr 2016 08:18:32 +0100	[thread overview]
Message-ID: <1461482332-21975-1-git-send-email-chris@chris-wilson.co.uk> (raw)

When releasing the intel_fbdev, we should unpin the framebuffer that we
pinned during construction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 drivers/gpu/drm/i915/intel_drv.h     | 1 +
 drivers/gpu/drm/i915/intel_fbdev.c   | 7 ++++++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ff60241b1f76..a59fe7b032b0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2309,7 +2309,7 @@ err_pm:
 	return ret;
 }
 
-static void intel_unpin_fb_obj(struct drm_framebuffer *fb, unsigned int rotation)
+void intel_unpin_fb_obj(struct drm_framebuffer *fb, unsigned int rotation)
 {
 	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
 	struct i915_ggtt_view view;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index b9f1304439e2..54f7000e2fe9 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1161,6 +1161,7 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
 				    struct drm_modeset_acquire_ctx *ctx);
 int intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
 			       unsigned int rotation);
+void intel_unpin_fb_obj(struct drm_framebuffer *fb, unsigned int rotation);
 struct drm_framebuffer *
 __intel_framebuffer_create(struct drm_device *dev,
 			   struct drm_mode_fb_cmd2 *mode_cmd,
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 79ac202f3870..c3c265d6f521 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -287,7 +287,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
 out_destroy_fbi:
 	drm_fb_helper_release_fbi(helper);
 out_unpin:
-	i915_gem_object_ggtt_unpin(obj);
+	intel_unpin_fb_obj(&ifbdev->fb->base, BIT(DRM_ROTATE_0));
 out_unlock:
 	mutex_unlock(&dev->struct_mutex);
 	return ret;
@@ -551,6 +551,11 @@ static void intel_fbdev_destroy(struct drm_device *dev,
 
 	if (ifbdev->fb) {
 		drm_framebuffer_unregister_private(&ifbdev->fb->base);
+
+		mutex_lock(&dev->struct_mutex);
+		intel_unpin_fb_obj(&ifbdev->fb->base, BIT(DRM_ROTATE_0));
+		mutex_unlock(&dev->struct_mutex);
+
 		drm_framebuffer_remove(&ifbdev->fb->base);
 	}
 }
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2016-04-24  7:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-24  7:18 Chris Wilson [this message]
2016-04-24  7:18 ` [PATCH 02/21] drm/i915/overlay: Replace i915_gem_obj_ggtt_offset() with the known flip_addr Chris Wilson
2016-04-24  7:18 ` [PATCH 03/21] io-mapping: Specify mapping size for io_mapping_map_wc() Chris Wilson
2016-04-24  7:18   ` Chris Wilson
2016-04-24  7:18   ` Chris Wilson
2016-04-24  7:18 ` [PATCH 04/21] drm/i915: Introduce i915_vm_to_ggtt() Chris Wilson
2016-04-24  7:18 ` [PATCH 05/21] drm/i915: Move ioremap_wc tracking onto VMA Chris Wilson
2016-04-24  7:18 ` [PATCH 06/21] drm/i915: Use i915_vma_pin_iomap on the ringbuffer object Chris Wilson
2016-04-24  7:18 ` [PATCH 07/21] drm/i915: Mark the current context as lost on suspend Chris Wilson
2016-04-24  7:18 ` [PATCH 08/21] drm/i915: L3 cache remapping is part of context switching Chris Wilson
2016-04-24  7:18 ` [PATCH 09/21] drm/i915: Consolidate L3 remapping LRI Chris Wilson
2016-04-24  7:18 ` [PATCH 10/21] drm/i915: Remove early l3-remap Chris Wilson
2016-04-24  7:18 ` [PATCH 11/21] drm/i915: Rearrange switch_context to load the aliasing ppgtt on first use Chris Wilson
2016-04-24  7:18 ` [PATCH 12/21] drm/i915: Assign every HW context a unique ID Chris Wilson
2016-04-24  7:18 ` [PATCH 13/21] drm/i915: Replace the pinned context address with its " Chris Wilson
2016-04-24  7:18 ` [PATCH 14/21] drm/i915: Refactor execlists default context pinning Chris Wilson
2016-04-24  7:18 ` [PATCH 15/21] drm/i915: Move context initialisation to first-use Chris Wilson
2016-04-24  7:18 ` [PATCH 16/21] drm/i915: Move the magical deferred context allocation into the request Chris Wilson
2016-04-24  7:18 ` [PATCH 17/21] drm/i915: Move releasing of the GEM request from free to retire/cancel Chris Wilson
2016-04-24  7:18 ` [PATCH 18/21] drm/i915: Track the previous pinned context inside the request Chris Wilson
2016-04-24  7:18 ` [PATCH 19/21] drm/i915: Store LRC hardware id in " Chris Wilson
2016-04-24  7:18 ` [PATCH 20/21] drm/i915: Stop tracking execlists retired requests Chris Wilson
2016-04-24  7:32 ` [PATCH 01/21] drm/i915/fbdev: Call intel_unpin_fb_obj() on release Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461482332-21975-1-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.