Armada DRM: four fixes
Subsystems (2)
cover Armada DRM: four fixes
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.
RFC PATCH 1/4 DRM: Armada: implement lastclose() for fbhelper
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.
--- 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(-)
drivers/gpu/drm/armada/armada_drm.h +1 -0
@@ -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 );
drivers/gpu/drm/armada/armada_drv.c +6 -1
@@ -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,
drivers/gpu/drm/armada/armada_fbdev.c +10 -0
@@ -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;
Signature · 1 line
1.7.4.4
Re: [PATCH RFC 1/4] DRM: Armada: implement lastclose() for fbhelper
Quoted 9 lines · Russell King
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 <[email protected]>--- 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:
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 2/4 DRM: Armada: destroy framebuffer after helper
In reply to Russell King - ARM LinuxDestroy the framebuffer only after the helper, since the helper may still be referencing the framebufer at this point.
--- drivers/gpu/drm/armada/armada_fbdev.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/armada/armada_fbdev.c +2 -2
@@ -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 ; } }
Signature · 1 line
1.7.4.4
Re: [PATCH RFC 2/4] DRM: Armada: destroy framebuffer after helper
Quoted 7 lines · Russell King
Destroy the framebuffer only after the helper, since the helper may still be referencing the framebufer at this point.
Signed-off-by Russell King <[email protected]>--- drivers/gpu/drm/armada/armada_fbdev.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 3/4 DRM: Armada: fix printing of phys_addr_t/dma_addr_t
In reply to Russell King - ARM LinuxThese can be 64-bit quantities, so fix them up appropriately.
--- drivers/gpu/drm/armada/armada_fbdev.c | 6 +++--- drivers/gpu/drm/armada/armada_gem.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/armada/armada_fbdev.c +3 -3
@@ -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 ;
drivers/gpu/drm/armada/armada_gem.c +3 -2
@@ -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 ; }
Signature · 1 line
1.7.4.4
Re: [PATCH RFC 3/4] DRM: Armada: fix printing of phys_addr_t/dma_addr_t
Quoted 7 lines · Russell King
These can be 64-bit quantities, so fix them up appropriately.
Signed-off-by Russell King <[email protected]>--- drivers/gpu/drm/armada/armada_fbdev.c | 6 +++--- drivers/gpu/drm/armada/armada_gem.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-)
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 4/4 DRM: Armada: prime refcounting bug fix
In reply to Russell King - ARM LinuxCommit 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.
--- drivers/gpu/drm/armada/armada_gem.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/armada/armada_gem.c +1 -1
@@ -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
Signature · 1 line
1.7.4.4
Re: [PATCH RFC 4/4] DRM: Armada: prime refcounting bug fix
Quoted 8 lines · Russell King
Commit
011c2282c74dchanged the way refcounting on importeddma_bufsworks, 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 <[email protected]>--- drivers/gpu/drm/armada/armada_gem.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Russell King - ARM Linux
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:
Quoted 1 line
Thanks.