2022-01-07 12:47:45

by Jani Nikula

[permalink] [raw]
Subject: Re: [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.

On Fri, 07 Jan 2022, Ashish Arora <[email protected]> wrote:
> From: Ashish Arora <[email protected]>
>
> On certain 4k panels, the BIOS framebuffer is larger than what panel
> requires causing display corruption. Introduce a check for the same.

This is quite thin on details. Is there a bug report?

Moreover, if this is what we want, this should be combined with the
conditions that follow resulting in a "!=" check instead of separate "<"
and ">".

BR,
Jani.



>
> Signed-off-by: Ashish Arora <[email protected]>
> ---
> drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index adc3a81be..f9952e1f8 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -193,6 +193,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
> struct drm_i915_gem_object *obj;
> int ret;
>
> + if (intel_fb &&
> + (sizes->fb_width < intel_fb->base.width ||
> + sizes->fb_height < intel_fb->base.height)) {
> + drm_dbg_kms(&dev_priv->drm,
> + "BIOS fb too large (%dx%d), we require (%dx%d),"
> + " releasing it\n",
> + intel_fb->base.width, intel_fb->base.height,
> + sizes->fb_width, sizes->fb_height);
> + drm_framebuffer_put(&intel_fb->base);
> + intel_fb = ifbdev->fb = NULL;
> + }
> if (intel_fb &&
> (sizes->fb_width > intel_fb->base.width ||
> sizes->fb_height > intel_fb->base.height)) {

--
Jani Nikula, Intel Open Source Graphics Center


2022-01-07 13:59:15

by Aditya Garg

[permalink] [raw]
Subject: Re: [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.



> On 07-Jan-2022, at 6:17 PM, Jani Nikula <[email protected]> wrote:
>
> On Fri, 07 Jan 2022, Ashish Arora <[email protected]> wrote:
>> From: Ashish Arora <[email protected]>
>>
>> On certain 4k panels, the BIOS framebuffer is larger than what panel
>> requires causing display corruption. Introduce a check for the same.
>
> This is quite thin on details. Is there a bug report?
No bug report, but an issue I am facing myself. This patch seems to fix it.
>
> Moreover, if this is what we want, this should be combined with the
> conditions that follow resulting in a "!=" check instead of separate "<"
> and ">”.
Sending a version 2
>
> BR,
> Jani.
>
>
>
>>
>> Signed-off-by: Ashish Arora <[email protected]>
>> ---
>> drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index adc3a81be..f9952e1f8 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -193,6 +193,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
>> struct drm_i915_gem_object *obj;
>> int ret;
>>
>> + if (intel_fb &&
>> + (sizes->fb_width < intel_fb->base.width ||
>> + sizes->fb_height < intel_fb->base.height)) {
>> + drm_dbg_kms(&dev_priv->drm,
>> + "BIOS fb too large (%dx%d), we require (%dx%d),"
>> + " releasing it\n",
>> + intel_fb->base.width, intel_fb->base.height,
>> + sizes->fb_width, sizes->fb_height);
>> + drm_framebuffer_put(&intel_fb->base);
>> + intel_fb = ifbdev->fb = NULL;
>> + }
>> if (intel_fb &&
>> (sizes->fb_width > intel_fb->base.width ||
>> sizes->fb_height > intel_fb->base.height)) {
>
> --
> Jani Nikula, Intel Open Source Graphics Center