Re: [Intel-gfx] [PATCH 1/1] drm/i915: Avoid initializing framebuffer without pipes

2018-10-22 Thread Chris Wilson
Quoting Jani Nikula (2018-10-22 15:09:06)
> On Fri, 19 Oct 2018, Chris Wilson  wrote:
> > Quoting Mika Kuoppala (2018-10-19 13:30:37)
> >> If we try to initialize a framebuffer without pipes, we get oops
> >> as we fail to get valid crtc for a PIPE A, on trying to find
> >> pitch limits. This is easily demonstrated by trying to init
> >> framebuffer with displays disabled by 'i915.disable_display=1'
> >> kernel cmdline.
> >> 
> >> Fix this by omitting framebuffer init early if there are no pipes.
> >> 
> >> Testcase: igt/kms_addfb_basic
> >> Cc: Ville Syrjala 
> >> Signed-off-by: Mika Kuoppala 
> >
> > To which Ville previously replied with the suggestion of preventing the
> > ioctl from even getting this far, to whit
> >
> > if (!INTEL_INFO(dev_priv)->num_pipes)
> >   i915->drm.driver_features &= ~DRIVER_MODESET
> >
> > See https://patchwork.freedesktop.org/series/51000/
> 
> As well as https://patchwork.freedesktop.org/series/50962/

That doesn't seem to fix this particular or similar oopses.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/1] drm/i915: Avoid initializing framebuffer without pipes

2018-10-22 Thread Jani Nikula
On Fri, 19 Oct 2018, Chris Wilson  wrote:
> Quoting Mika Kuoppala (2018-10-19 13:30:37)
>> If we try to initialize a framebuffer without pipes, we get oops
>> as we fail to get valid crtc for a PIPE A, on trying to find
>> pitch limits. This is easily demonstrated by trying to init
>> framebuffer with displays disabled by 'i915.disable_display=1'
>> kernel cmdline.
>> 
>> Fix this by omitting framebuffer init early if there are no pipes.
>> 
>> Testcase: igt/kms_addfb_basic
>> Cc: Ville Syrjala 
>> Signed-off-by: Mika Kuoppala 
>
> To which Ville previously replied with the suggestion of preventing the
> ioctl from even getting this far, to whit
>
> if (!INTEL_INFO(dev_priv)->num_pipes)
>   i915->drm.driver_features &= ~DRIVER_MODESET
>
> See https://patchwork.freedesktop.org/series/51000/

As well as https://patchwork.freedesktop.org/series/50962/

BR,
Jani.


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

-- 
Jani Nikula, Intel Open Source Graphics Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/1] drm/i915: Avoid initializing framebuffer without pipes

2018-10-19 Thread Chris Wilson
Quoting Mika Kuoppala (2018-10-19 13:30:37)
> If we try to initialize a framebuffer without pipes, we get oops
> as we fail to get valid crtc for a PIPE A, on trying to find
> pitch limits. This is easily demonstrated by trying to init
> framebuffer with displays disabled by 'i915.disable_display=1'
> kernel cmdline.
> 
> Fix this by omitting framebuffer init early if there are no pipes.
> 
> Testcase: igt/kms_addfb_basic
> Cc: Ville Syrjala 
> Signed-off-by: Mika Kuoppala 

To which Ville previously replied with the suggestion of preventing the
ioctl from even getting this far, to whit

if (!INTEL_INFO(dev_priv)->num_pipes)
i915->drm.driver_features &= ~DRIVER_MODESET

See https://patchwork.freedesktop.org/series/51000/
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/1] drm/i915: Avoid initializing framebuffer without pipes

2018-10-19 Thread Mika Kuoppala
If we try to initialize a framebuffer without pipes, we get oops
as we fail to get valid crtc for a PIPE A, on trying to find
pitch limits. This is easily demonstrated by trying to init
framebuffer with displays disabled by 'i915.disable_display=1'
kernel cmdline.

Fix this by omitting framebuffer init early if there are no pipes.

Testcase: igt/kms_addfb_basic
Cc: Ville Syrjala 
Signed-off-by: Mika Kuoppala 
---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index fc7e3b0bd95c..c1685395c67c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14312,6 +14312,9 @@ static int intel_framebuffer_init(struct 
intel_framebuffer *intel_fb,
stride = i915_gem_object_get_stride(obj);
i915_gem_object_unlock(obj);
 
+   if (INTEL_INFO(dev_priv)->num_pipes == 0)
+   goto err;
+
if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
/*
 * If there's a fence, enforce that
-- 
2.17.1

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