drm/hyperv: Added error message for fb size greater then allocated
Subsystems (5)
Saurabh Sengar
maintainerPATCH v2 1/1 drm/hyperv: Added error message for fb size greater then allocated
Added error message when the size of requested framebuffer is more then the allocated size by vmbus mmio region for framebuffer
---
v1 -> v2 : Corrected Sign-off
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +4 -1
@@ -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 ; }
Signature · 1 line
1.8.3.1
Wei Liu
maintainerQuoted 15 lines · Saurabh Sengar
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 <[email protected]>---
v1 -> v2 : Corrected Sign-offdrivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0
-0
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe, · line 127
Quoted 6 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +2
-1@@ -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.
Quoted 9 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +2
-0+ current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size);return -EINVAL ; + }return 0 ; }Signature · 1 line
1.8.3.1
Quoted 16 lines · Saurabh Sengar
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 <[email protected]>---
v1 -> v2 : Corrected Sign-offdrivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0
-0
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe, · line 128
Quoted 7 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +3
-1@@ -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.
Quoted 8 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +1
-1return -EINVAL ; + }return 0 ; } --1.8.3.1
Saurabh Singh Sengar
maintainerQuoted 21 lines · Deepak Rawat
Quoted 19 lines · Saurabh Sengar
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 <[email protected]>---
v1 -> v2 : Corrected Sign-offdrivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +0
-0@@ -123,8 +123,11 @@ static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe,if (fb->format->format !=DRM_FORMAT_XRGB8888 )return -EINVAL ;
Quoted 7 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe, · line 128
Quoted 4 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +3
-1-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.
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +1
-1return -EINVAL ; + }return 0 ; } --1.8.3.1