dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Armada DRM: four fixes
@ 2013-12-09  0:04 Russell King - ARM Linux
  2013-12-09  0:08 ` [PATCH RFC 1/4] DRM: Armada: implement lastclose() for fbhelper Russell King
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2013-12-09  0:04 UTC (permalink / raw)
  To: Rob Clark, David Airlie, dri-devel

Rob, David,

Here are four fixes for review for the Armada DRM driver.

 drivers/gpu/drm/armada/armada_drm.h   |    1 +
 drivers/gpu/drm/armada/armada_drv.c   |    7 ++++++-
 drivers/gpu/drm/armada/armada_fbdev.c |   20 +++++++++++++++-----
 drivers/gpu/drm/armada/armada_gem.c   |    7 ++++---
 4 files changed, 26 insertions(+), 9 deletions(-)

If you're happy with them, I can send a pull request.

Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH RFC 1/4] DRM: Armada: implement lastclose() for fbhelper
  2013-12-09  0:04 [PATCH 0/4] Armada DRM: four fixes Russell King - ARM Linux
@ 2013-12-09  0:08 ` Russell King
  2013-12-10 15:26   ` Thierry Reding
  2013-12-09  0:08 ` [PATCH RFC 2/4] DRM: Armada: destroy framebuffer after helper Russell King
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Russell King @ 2013-12-09  0:08 UTC (permalink / raw)
  To: Rob Clark, David Airlie, dri-devel

Call drm_fb_helper_restore_fbdev_mode() upon last close so that in the
event of the X server crashing, we have some kind of mode restored.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/gpu/drm/armada/armada_drm.h   |    1 +
 drivers/gpu/drm/armada/armada_drv.c   |    7 ++++++-
 drivers/gpu/drm/armada/armada_fbdev.c |   10 ++++++++++
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drm.h b/drivers/gpu/drm/armada/armada_drm.h
index eef09ec9a5ff..a72cae03b99b 100644
--- a/drivers/gpu/drm/armada/armada_drm.h
+++ b/drivers/gpu/drm/armada/armada_drm.h
@@ -103,6 +103,7 @@ void armada_drm_queue_unref_work(struct drm_device *,
 extern const struct drm_mode_config_funcs armada_drm_mode_config_funcs;
 
 int armada_fbdev_init(struct drm_device *);
+void armada_fbdev_lastclose(struct drm_device *);
 void armada_fbdev_fini(struct drm_device *);
 
 int armada_overlay_plane_create(struct drm_device *, unsigned long);
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 7aede900a221..15425d23c9cc 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -321,6 +321,11 @@ static struct drm_ioctl_desc armada_ioctls[] = {
 		DRM_UNLOCKED),
 };
 
+static void armada_drm_lastclose(struct drm_device *dev)
+{
+	armada_fbdev_lastclose(dev);
+}
+
 static const struct file_operations armada_drm_fops = {
 	.owner			= THIS_MODULE,
 	.llseek			= no_llseek,
@@ -337,7 +342,7 @@ static struct drm_driver armada_drm_driver = {
 	.open			= NULL,
 	.preclose		= NULL,
 	.postclose		= NULL,
-	.lastclose		= NULL,
+	.lastclose		= armada_drm_lastclose,
 	.unload			= armada_drm_unload,
 	.get_vblank_counter	= drm_vblank_count,
 	.enable_vblank		= armada_drm_enable_vblank,
diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index dd5ea77dac96..743570e99f90 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -177,6 +177,16 @@ int armada_fbdev_init(struct drm_device *dev)
 	return ret;
 }
 
+void armada_fbdev_lastclose(struct drm_device *dev)
+{
+	struct armada_private *priv = dev->dev_private;
+
+	drm_modeset_lock_all(dev);
+	if (priv->fbdev)
+		drm_fb_helper_restore_fbdev_mode(priv->fbdev);
+	drm_modeset_unlock_all(dev);
+}
+
 void armada_fbdev_fini(struct drm_device *dev)
 {
 	struct armada_private *priv = dev->dev_private;
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH RFC 2/4] DRM: Armada: destroy framebuffer after helper
  2013-12-09  0:04 [PATCH 0/4] Armada DRM: four fixes Russell King - ARM Linux
  2013-12-09  0:08 ` [PATCH RFC 1/4] DRM: Armada: implement lastclose() for fbhelper Russell King
@ 2013-12-09  0:08 ` Russell King
  2013-12-10 15:26   ` Thierry Reding
  2013-12-09  0:10 ` [PATCH RFC 3/4] DRM: Armada: fix printing of phys_addr_t/dma_addr_t Russell King
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Russell King @ 2013-12-09  0:08 UTC (permalink / raw)
  To: Rob Clark, David Airlie, dri-devel

Destroy the framebuffer only after the helper, since the helper may
still be referencing the framebufer at this point.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/gpu/drm/armada/armada_fbdev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index 743570e99f90..b348b16f81e2 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -202,11 +202,11 @@ void armada_fbdev_fini(struct drm_device *dev)
 			framebuffer_release(info);
 		}
 
+		drm_fb_helper_fini(fbh);
+
 		if (fbh->fb)
 			fbh->fb->funcs->destroy(fbh->fb);
 
-		drm_fb_helper_fini(fbh);
-
 		priv->fbdev = NULL;
 	}
 }
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH RFC 3/4] DRM: Armada: fix printing of phys_addr_t/dma_addr_t
  2013-12-09  0:04 [PATCH 0/4] Armada DRM: four fixes Russell King - ARM Linux
  2013-12-09  0:08 ` [PATCH RFC 1/4] DRM: Armada: implement lastclose() for fbhelper Russell King
  2013-12-09  0:08 ` [PATCH RFC 2/4] DRM: Armada: destroy framebuffer after helper Russell King
@ 2013-12-09  0:10 ` Russell King
  2013-12-10 15:30   ` Thierry Reding
  2013-12-09  0:10 ` [PATCH RFC 4/4] DRM: Armada: prime refcounting bug fix Russell King
  2013-12-10 12:59 ` [PATCH 0/4] Armada DRM: four fixes Rob Clark
  4 siblings, 1 reply; 10+ messages in thread
From: Russell King @ 2013-12-09  0:10 UTC (permalink / raw)
  To: Rob Clark, David Airlie, dri-devel

These can be 64-bit quantities, so fix them up appropriately.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/gpu/drm/armada/armada_fbdev.c |    6 +++---
 drivers/gpu/drm/armada/armada_gem.c   |    5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index b348b16f81e2..948cb14c561e 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -105,9 +105,9 @@ static int armada_fb_create(struct drm_fb_helper *fbh,
 	drm_fb_helper_fill_fix(info, dfb->fb.pitches[0], dfb->fb.depth);
 	drm_fb_helper_fill_var(info, fbh, sizes->fb_width, sizes->fb_height);
 
-	DRM_DEBUG_KMS("allocated %dx%d %dbpp fb: 0x%08x\n",
-		dfb->fb.width, dfb->fb.height,
-		dfb->fb.bits_per_pixel, obj->phys_addr);
+	DRM_DEBUG_KMS("allocated %dx%d %dbpp fb: 0x%08llx\n",
+		dfb->fb.width, dfb->fb.height, dfb->fb.bits_per_pixel,
+		(unsigned long long)obj->phys_addr);
 
 	return 0;
 
diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
index 9f2356bae7fd..adc7c2da75bb 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -172,8 +172,9 @@ armada_gem_linear_back(struct drm_device *dev, struct armada_gem_object *obj)
 		obj->dev_addr = obj->linear->start;
 	}
 
-	DRM_DEBUG_DRIVER("obj %p phys %#x dev %#x\n",
-			 obj, obj->phys_addr, obj->dev_addr);
+	DRM_DEBUG_DRIVER("obj %p phys %#llx dev %#llx\n", obj,
+			 (unsigned long long)obj->phys_addr,
+			 (unsigned long long)obj->dev_addr);
 
 	return 0;
 }
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH RFC 4/4] DRM: Armada: prime refcounting bug fix
  2013-12-09  0:04 [PATCH 0/4] Armada DRM: four fixes Russell King - ARM Linux
                   ` (2 preceding siblings ...)
  2013-12-09  0:10 ` [PATCH RFC 3/4] DRM: Armada: fix printing of phys_addr_t/dma_addr_t Russell King
@ 2013-12-09  0:10 ` Russell King
  2013-12-10 16:00   ` Thierry Reding
  2013-12-10 12:59 ` [PATCH 0/4] Armada DRM: four fixes Rob Clark
  4 siblings, 1 reply; 10+ messages in thread
From: Russell King @ 2013-12-09  0:10 UTC (permalink / raw)
  To: Rob Clark, David Airlie, dri-devel

Commit 011c2282c74d changed the way refcounting on imported dma_bufs
works, and this hadn't been spotted while forward-porting Armada.
Reflect the changes in that commit into the Armada driver.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/gpu/drm/armada/armada_gem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
index adc7c2da75bb..887816f43476 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -558,7 +558,6 @@ armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf)
 			 * refcount on the gem object itself.
 			 */
 			drm_gem_object_reference(obj);
-			dma_buf_put(buf);
 			return obj;
 		}
 	}
@@ -574,6 +573,7 @@ armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf)
 	}
 
 	dobj->obj.import_attach = attach;
+	get_dma_buf(buf);
 
 	/*
 	 * Don't call dma_buf_map_attachment() here - it maps the
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] Armada DRM: four fixes
  2013-12-09  0:04 [PATCH 0/4] Armada DRM: four fixes Russell King - ARM Linux
                   ` (3 preceding siblings ...)
  2013-12-09  0:10 ` [PATCH RFC 4/4] DRM: Armada: prime refcounting bug fix Russell King
@ 2013-12-10 12:59 ` Rob Clark
  4 siblings, 0 replies; 10+ messages in thread
From: Rob Clark @ 2013-12-10 12:59 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: dri-devel@lists.freedesktop.org

On Sun, Dec 8, 2013 at 7:04 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> Rob, David,
>
> Here are four fixes for review for the Armada DRM driver.
>
>  drivers/gpu/drm/armada/armada_drm.h   |    1 +
>  drivers/gpu/drm/armada/armada_drv.c   |    7 ++++++-
>  drivers/gpu/drm/armada/armada_fbdev.c |   20 +++++++++++++++-----
>  drivers/gpu/drm/armada/armada_gem.c   |    7 ++++---
>  4 files changed, 26 insertions(+), 9 deletions(-)
>
> If you're happy with them, I can send a pull request.

yeah, they look good.. for the series:

Reviewed-by: Rob Clark <robdclark@gmail.com>

> Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH RFC 1/4] DRM: Armada: implement lastclose() for fbhelper
  2013-12-09  0:08 ` [PATCH RFC 1/4] DRM: Armada: implement lastclose() for fbhelper Russell King
@ 2013-12-10 15:26   ` Thierry Reding
  0 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2013-12-10 15:26 UTC (permalink / raw)
  To: Russell King; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 569 bytes --]

On Mon, Dec 09, 2013 at 12:08:14AM +0000, Russell King wrote:
> Call drm_fb_helper_restore_fbdev_mode() upon last close so that in the
> event of the X server crashing, we have some kind of mode restored.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  drivers/gpu/drm/armada/armada_drm.h   |    1 +
>  drivers/gpu/drm/armada/armada_drv.c   |    7 ++++++-
>  drivers/gpu/drm/armada/armada_fbdev.c |   10 ++++++++++
>  3 files changed, 17 insertions(+), 1 deletions(-)

Looks good:

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH RFC 2/4] DRM: Armada: destroy framebuffer after helper
  2013-12-09  0:08 ` [PATCH RFC 2/4] DRM: Armada: destroy framebuffer after helper Russell King
@ 2013-12-10 15:26   ` Thierry Reding
  0 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2013-12-10 15:26 UTC (permalink / raw)
  To: Russell King; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 419 bytes --]

On Mon, Dec 09, 2013 at 12:08:34AM +0000, Russell King wrote:
> Destroy the framebuffer only after the helper, since the helper may
> still be referencing the framebufer at this point.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  drivers/gpu/drm/armada/armada_fbdev.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH RFC 3/4] DRM: Armada: fix printing of phys_addr_t/dma_addr_t
  2013-12-09  0:10 ` [PATCH RFC 3/4] DRM: Armada: fix printing of phys_addr_t/dma_addr_t Russell King
@ 2013-12-10 15:30   ` Thierry Reding
  0 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2013-12-10 15:30 UTC (permalink / raw)
  To: Russell King; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 416 bytes --]

On Mon, Dec 09, 2013 at 12:10:04AM +0000, Russell King wrote:
> These can be 64-bit quantities, so fix them up appropriately.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  drivers/gpu/drm/armada/armada_fbdev.c |    6 +++---
>  drivers/gpu/drm/armada/armada_gem.c   |    5 +++--
>  2 files changed, 6 insertions(+), 5 deletions(-)

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH RFC 4/4] DRM: Armada: prime refcounting bug fix
  2013-12-09  0:10 ` [PATCH RFC 4/4] DRM: Armada: prime refcounting bug fix Russell King
@ 2013-12-10 16:00   ` Thierry Reding
  0 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2013-12-10 16:00 UTC (permalink / raw)
  To: Russell King; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 493 bytes --]

On Mon, Dec 09, 2013 at 12:10:24AM +0000, Russell King wrote:
> Commit 011c2282c74d changed the way refcounting on imported dma_bufs
> works, and this hadn't been spotted while forward-porting Armada.
> Reflect the changes in that commit into the Armada driver.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  drivers/gpu/drm/armada/armada_gem.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-12-10 16:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09  0:04 [PATCH 0/4] Armada DRM: four fixes Russell King - ARM Linux
2013-12-09  0:08 ` [PATCH RFC 1/4] DRM: Armada: implement lastclose() for fbhelper Russell King
2013-12-10 15:26   ` Thierry Reding
2013-12-09  0:08 ` [PATCH RFC 2/4] DRM: Armada: destroy framebuffer after helper Russell King
2013-12-10 15:26   ` Thierry Reding
2013-12-09  0:10 ` [PATCH RFC 3/4] DRM: Armada: fix printing of phys_addr_t/dma_addr_t Russell King
2013-12-10 15:30   ` Thierry Reding
2013-12-09  0:10 ` [PATCH RFC 4/4] DRM: Armada: prime refcounting bug fix Russell King
2013-12-10 16:00   ` Thierry Reding
2013-12-10 12:59 ` [PATCH 0/4] Armada DRM: four fixes Rob Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox