dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/hyperv: Added error message for fb size greater then allocated
@ 2022-04-07  6:27 Saurabh Sengar
  2022-04-07 13:14 ` Wei Liu
  2022-04-07 16:28 ` Deepak Rawat
  0 siblings, 2 replies; 4+ messages in thread
From: Saurabh Sengar @ 2022-04-07  6:27 UTC (permalink / raw)
  To: ssengar, drawat.floss, airlied, daniel, linux-hyperv, dri-devel,
	linux-kernel, mikelley, decui

Added error message when the size of requested framebuffer is more then
the allocated size by vmbus mmio region for framebuffer

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
---
v1 -> v2 : Corrected Sign-off

 drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
index e82b815..92587f0 100644
--- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
+++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
@@ -123,8 +123,11 @@ static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe,
 	if (fb->format->format != DRM_FORMAT_XRGB8888)
 		return -EINVAL;
 
-	if (fb->pitches[0] * fb->height > hv->fb_size)
+	if (fb->pitches[0] * fb->height > hv->fb_size) {
+		drm_err(&hv->dev, "hv->hdev, fb size requested by process %s for %d X %d (pitch %d) is greater then allocated size %ld\n",
+		current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size);
 		return -EINVAL;
+	}
 
 	return 0;
 }
-- 
1.8.3.1


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

* Re: [PATCH v2] drm/hyperv: Added error message for fb size greater then allocated
  2022-04-07  6:27 [PATCH v2] drm/hyperv: Added error message for fb size greater then allocated Saurabh Sengar
@ 2022-04-07 13:14 ` Wei Liu
  2022-04-07 16:28 ` Deepak Rawat
  1 sibling, 0 replies; 4+ messages in thread
From: Wei Liu @ 2022-04-07 13:14 UTC (permalink / raw)
  To: Saurabh Sengar
  Cc: linux-hyperv, airlied, ssengar, decui, linux-kernel, dri-devel,
	mikelley, drawat.floss, Wei Liu

On Wed, Apr 06, 2022 at 11:27:07PM -0700, Saurabh Sengar wrote:
> Added error message when the size of requested framebuffer is more then
> the allocated size by vmbus mmio region for framebuffer
> 
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> ---
> v1 -> v2 : Corrected Sign-off
> 
>  drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> index e82b815..92587f0 100644
> --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> @@ -123,8 +123,11 @@ static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe,
>  	if (fb->format->format != DRM_FORMAT_XRGB8888)
>  		return -EINVAL;
>  
> -	if (fb->pitches[0] * fb->height > hv->fb_size)
> +	if (fb->pitches[0] * fb->height > hv->fb_size) {
> +		drm_err(&hv->dev, "hv->hdev, fb size requested by process %s for %d X %d (pitch %d) is greater then allocated size %ld\n",

then -> than.

> +		current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size);
>  		return -EINVAL;
> +	}
>  
>  	return 0;
>  }
> -- 
> 1.8.3.1
> 

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

* Re: [PATCH v2] drm/hyperv: Added error message for fb size greater then allocated
  2022-04-07  6:27 [PATCH v2] drm/hyperv: Added error message for fb size greater then allocated Saurabh Sengar
  2022-04-07 13:14 ` Wei Liu
@ 2022-04-07 16:28 ` Deepak Rawat
  2022-04-07 17:43   ` Saurabh Singh Sengar
  1 sibling, 1 reply; 4+ messages in thread
From: Deepak Rawat @ 2022-04-07 16:28 UTC (permalink / raw)
  To: Saurabh Sengar
  Cc: linux-hyperv, David Airlie, ssengar, Dexuan Cui, linux-kernel,
	dri-devel, Michael Kelley

On Wed, Apr 6, 2022 at 11:27 PM Saurabh Sengar
<ssengar@linux.microsoft.com> wrote:
>
> Added error message when the size of requested framebuffer is more then
> the allocated size by vmbus mmio region for framebuffer
>
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> ---
> v1 -> v2 : Corrected Sign-off
>
>  drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> index e82b815..92587f0 100644
> --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> @@ -123,8 +123,11 @@ static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe,
>         if (fb->format->format != DRM_FORMAT_XRGB8888)
>                 return -EINVAL;
>
> -       if (fb->pitches[0] * fb->height > hv->fb_size)
> +       if (fb->pitches[0] * fb->height > hv->fb_size) {
> +               drm_err(&hv->dev, "hv->hdev, fb size requested by process %s for %d X %d (pitch %d) is greater then allocated size %ld\n",
> +               current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size);

Any reason to add an error message here. Since this function is called
whenever there is an update, avoid printing an error here.

>                 return -EINVAL;
> +       }
>
>         return 0;
>  }
> --
> 1.8.3.1
>

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

* Re: [PATCH v2] drm/hyperv: Added error message for fb size greater then allocated
  2022-04-07 16:28 ` Deepak Rawat
@ 2022-04-07 17:43   ` Saurabh Singh Sengar
  0 siblings, 0 replies; 4+ messages in thread
From: Saurabh Singh Sengar @ 2022-04-07 17:43 UTC (permalink / raw)
  To: Deepak Rawat
  Cc: linux-hyperv, David Airlie, ssengar, Dexuan Cui, linux-kernel,
	dri-devel, Michael Kelley

On Thu, Apr 07, 2022 at 09:28:53AM -0700, Deepak Rawat wrote:
> On Wed, Apr 6, 2022 at 11:27 PM Saurabh Sengar
> <ssengar@linux.microsoft.com> wrote:
> >
> > Added error message when the size of requested framebuffer is more then
> > the allocated size by vmbus mmio region for framebuffer
> >
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> > v1 -> v2 : Corrected Sign-off
> >
> >  drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> > index e82b815..92587f0 100644
> > --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> > +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c
> > @@ -123,8 +123,11 @@ static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe,
> >         if (fb->format->format != DRM_FORMAT_XRGB8888)
> >                 return -EINVAL;
> >
> > -       if (fb->pitches[0] * fb->height > hv->fb_size)
> > +       if (fb->pitches[0] * fb->height > hv->fb_size) {
> > +               drm_err(&hv->dev, "hv->hdev, fb size requested by process %s for %d X %d (pitch %d) is greater then allocated size %ld\n",
> > +               current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size);
> 
> Any reason to add an error message here. Since this function is called
> whenever there is an update, avoid printing an error here.

Recently we hit an issue where userspace application was programing the bigger size buffer then the actual allocated size for framebuffer by hyperv vmbus. This resulted in black screen, and there was no error message it was failing silently and took a
 while to debug this issue. Although the function will be called in each update but this error is printed only in fatal case where pipeline is fail to set the crtc for desired resolution.

> 
> >                 return -EINVAL;
> > +       }
> >
> >         return 0;
> >  }
> > --
> > 1.8.3.1
> >

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

end of thread, other threads:[~2022-04-08  7:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07  6:27 [PATCH v2] drm/hyperv: Added error message for fb size greater then allocated Saurabh Sengar
2022-04-07 13:14 ` Wei Liu
2022-04-07 16:28 ` Deepak Rawat
2022-04-07 17:43   ` Saurabh Singh Sengar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).