Patchwork [11/13] drm/i915: Protect against deferred fbdev setup

login
register
mail settings
Submitter Daniel Vetter
Date July 4, 2017, 3:18 p.m.
Message ID <20170704151833.17304-12-daniel.vetter@ffwll.ch>
Download mbox | patch
Permalink /patch/9825265/
State New
Headers show

Comments

Daniel Vetter - July 4, 2017, 3:18 p.m.
We could probably hit this already with our current async fbdev init,
but it's much easier to hit this with the new deferred fbdev setup
that I'm working on polishing.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Maarten Lankhorst - July 5, 2017, 10:08 a.m.
Op 04-07-17 om 17:18 schreef Daniel Vetter:
> We could probably hit this already with our current async fbdev init,
> but it's much easier to hit this with the new deferred fbdev setup
> that I'm working on polishing.
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 580bd4f4a49e..a4224566ebca 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1931,7 +1931,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
>  		return ret;
>  
>  #ifdef CONFIG_DRM_FBDEV_EMULATION
> -	if (dev_priv->fbdev) {
> +	if (dev_priv->fbdev && dev_priv->fbdev->helper.fb) {
>  		fbdev_fb = to_intel_framebuffer(dev_priv->fbdev->helper.fb);
>  
>  		seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, modifier 0x%llx, refcount %d, obj ",

Since patch 10/13 makes it way more likely we don't allocate a FB, this patch should be commited before it?
Daniel Vetter - July 5, 2017, 8:17 p.m.
On Wed, Jul 05, 2017 at 12:08:15PM +0200, Maarten Lankhorst wrote:
> Op 04-07-17 om 17:18 schreef Daniel Vetter:
> > We could probably hit this already with our current async fbdev init,
> > but it's much easier to hit this with the new deferred fbdev setup
> > that I'm working on polishing.
> >
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 580bd4f4a49e..a4224566ebca 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -1931,7 +1931,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
> >  		return ret;
> >  
> >  #ifdef CONFIG_DRM_FBDEV_EMULATION
> > -	if (dev_priv->fbdev) {
> > +	if (dev_priv->fbdev && dev_priv->fbdev->helper.fb) {
> >  		fbdev_fb = to_intel_framebuffer(dev_priv->fbdev->helper.fb);
> >  
> >  		seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, modifier 0x%llx, refcount %d, obj ",
> 
> Since patch 10/13 makes it way more likely we don't allocate a FB, this patch should be commited before it?

Yeah I think I need to reshuffle, and add the patch to remove the
ifbdev->vma check in output_changed too. I think I'll merge patches 1-9
tomorrow meanwhile.

Thanks a lot for your review.
-Daniel

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 580bd4f4a49e..a4224566ebca 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1931,7 +1931,7 @@  static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
 		return ret;
 
 #ifdef CONFIG_DRM_FBDEV_EMULATION
-	if (dev_priv->fbdev) {
+	if (dev_priv->fbdev && dev_priv->fbdev->helper.fb) {
 		fbdev_fb = to_intel_framebuffer(dev_priv->fbdev->helper.fb);
 
 		seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, modifier 0x%llx, refcount %d, obj ",