drm/nouveau: create function for "dealing" with gpu lockup
Subsystems (3)
PATCH 1/1 drm/nouveau: create function for "dealing" with gpu lockup
It's mostly a cleanup, but in nv50_fbcon_accel_init gpu lockup message was printed, but HWACCEL_DISBALED flag was not set.
--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 15 +++++++++++---- drivers/gpu/drm/nouveau/nouveau_fbcon.h | 2 ++ drivers/gpu/drm/nouveau/nv04_fbcon.c | 15 +++++---------- drivers/gpu/drm/nouveau/nv50_fbcon.c | 17 +++++------------ 4 files changed, 23 insertions(+), 26 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fbcon.c +11 -4
@@ -64,8 +64,7 @@ nouveau_fbcon_sync(struct fb_info *info)return 0 ;if (RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info);return 0 ; }
@@ -86,8 +85,7 @@ nouveau_fbcon_sync(struct fb_info *info) }if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info);return 0 ; }
@@ -380,3 +378,12 @@ nouveau_fbcon_remove(struct drm_device *dev, struct drm_framebuffer *fb)return 0 ; } + +void nouveau_gpu_lockup (struct fb_info *info,const char *file,int line) +{ +struct nouveau_fbcon_par *par = info->par; +struct drm_device *dev = par->dev; + +NV_ERROR (dev,"GPU lockup - switching to software fbcon (%s:%d)\n" , file, line); + info->flags |=FBINFO_HWACCEL_DISABLED ; +}
drivers/gpu/drm/nouveau/nouveau_fbcon.h +2 -0
@@ -43,5 +43,7 @@ void nouveau_fbcon_zfill(struct drm_device *dev);int nv04_fbcon_accel_init (struct fb_info *info);int nv50_fbcon_accel_init (struct fb_info *info); +#define NV_GPU_LOCKUP (info) nouveau_gpu_lockup(info, __FILE__, __LINE__) +void nouveau_gpu_lockup (struct fb_info *info,const char *file,int line);#endif /* __NV50_FBCON_H__ */
drivers/gpu/drm/nouveau/nv04_fbcon.c +5 -10
@@ -39,8 +39,7 @@ nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -68,8 +67,7 @@ nv04_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,7 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -109,8 +107,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,8 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -144,8 +141,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int iter_len = dsize >128 ?128 : dsize;if (RING_SPACE (chan, iter_len +1 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info);cfb_imageblit (info, image);return ; }
@@ -242,8 +238,7 @@ nv04_fbcon_accel_init(struct fb_info *info)return ret;if (RING_SPACE (chan,49 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info);return 0 ; }
drivers/gpu/drm/nouveau/nv50_fbcon.c +5 -12
@@ -17,9 +17,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan, rect->rop ==ROP_COPY ?7 :11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -57,9 +55,7 @@ nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,12 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -102,8 +98,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -136,9 +131,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int push = dwords >2047 ?2047 : dwords;if (RING_SPACE (chan, push +1 )) { -NV_ERROR (dev, -"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +NV_GPU_LOCKUP (info);cfb_imageblit (info, image);return ; }
@@ -200,7 +193,7 @@ nv50_fbcon_accel_init(struct fb_info *info) ret =RING_SPACE (chan,59 );if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); +NV_GPU_LOCKUP (info);return ret; }
Signature · 1 line
1.6.6.rc3
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/2 drm/nouveau: create function for "dealing" with gpu lockup
New version, without file/line markers in nouveau_gpu_lockup (they were useless...).
--
From: Marcin Slusarz <[email protected]>
Subject: [PATCH v2 1/2] drm/nouveau: create function for "dealing" with gpu lockup
It's mostly a cleanup, but in nv50_fbcon_accel_init gpu lockup message was printed, but HWACCEL_DISBALED flag was not set.
--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 15 +++++++++++---- drivers/gpu/drm/nouveau/nouveau_fbcon.h | 1 + drivers/gpu/drm/nouveau/nv04_fbcon.c | 15 +++++---------- drivers/gpu/drm/nouveau/nv50_fbcon.c | 17 +++++------------ 4 files changed, 22 insertions(+), 26 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fbcon.c +11 -4
@@ -64,8 +64,7 @@ nouveau_fbcon_sync(struct fb_info *info)return 0 ;if (RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);return 0 ; }
@@ -86,8 +85,7 @@ nouveau_fbcon_sync(struct fb_info *info) }if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);return 0 ; }
@@ -380,3 +378,12 @@ nouveau_fbcon_remove(struct drm_device *dev, struct drm_framebuffer *fb)return 0 ; } + +void nouveau_gpu_lockup (struct fb_info *info) +{ +struct nouveau_fbcon_par *par = info->par; +struct drm_device *dev = par->dev; + +NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); + info->flags |=FBINFO_HWACCEL_DISABLED ; +}
drivers/gpu/drm/nouveau/nouveau_fbcon.h +1 -0
@@ -43,5 +43,6 @@ void nouveau_fbcon_zfill(struct drm_device *dev);int nv04_fbcon_accel_init (struct fb_info *info);int nv50_fbcon_accel_init (struct fb_info *info); +void nouveau_gpu_lockup (struct fb_info *info);#endif /* __NV50_FBCON_H__ */
drivers/gpu/drm/nouveau/nv04_fbcon.c +5 -10
@@ -39,8 +39,7 @@ nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -68,8 +67,7 @@ nv04_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,7 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -109,8 +107,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,8 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -144,8 +141,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int iter_len = dsize >128 ?128 : dsize;if (RING_SPACE (chan, iter_len +1 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);cfb_imageblit (info, image);return ; }
@@ -243,8 +239,7 @@ nv04_fbcon_accel_init(struct fb_info *info)return ret;if (RING_SPACE (chan,49 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);return 0 ; }
drivers/gpu/drm/nouveau/nv50_fbcon.c +5 -12
@@ -17,9 +17,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan, rect->rop ==ROP_COPY ?7 :11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -57,9 +55,7 @@ nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,12 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -102,8 +98,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -136,9 +131,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int push = dwords >2047 ?2047 : dwords;if (RING_SPACE (chan, push +1 )) { -NV_ERROR (dev, -"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);cfb_imageblit (info, image);return ; }
@@ -200,7 +193,7 @@ nv50_fbcon_accel_init(struct fb_info *info) ret =RING_SPACE (chan,59 );if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); +nouveau_gpu_lockup (info);return ret; }
Signature · 1 line
1.6.6.rc3
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · Marcin Slusarz
New version, without file/line markers in
nouveau_gpu_lockup(they were useless...).
Looks mostly good to me, can you rename to nouveau_fbcon_gpu_lockup() instead however, as the function only deals with fbcon and not a more general handling.
Thanks!
Quoted 174 lines
--
From: Marcin Slusarz <[email protected]>
Subject: [PATCH v2 1/2] drm/nouveau: create function for "dealing" with gpu lockupIt's mostly a cleanup, but in
nv50_fbcon_accel_initgpu lockup message was printed, butHWACCEL_DISBALEDflag was not set.Signed-off-by Marcin Slusarz <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 15 +++++++++++---- drivers/gpu/drm/nouveau/nouveau_fbcon.h | 1 + drivers/gpu/drm/nouveau/nv04_fbcon.c | 15 +++++---------- drivers/gpu/drm/nouveau/nv50_fbcon.c | 17 +++++------------ 4 files changed, 22 insertions(+), 26 deletions(-)drivers/gpu/drm/nouveau/nouveau_fbcon.c +11
-4@@ -64,8 +64,7 @@ nouveau_fbcon_sync(struct fb_info *info)return 0 ;if (RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);return 0 ; }@@ -86,8 +85,7 @@ nouveau_fbcon_sync(struct fb_info *info) }if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);return 0 ; }@@ -380,3 +378,12 @@ nouveau_fbcon_remove(struct drm_device *dev, struct drm_framebuffer *fb)return 0 ; } + +void nouveau_gpu_lockup (struct fb_info *info) +{ +struct nouveau_fbcon_par *par = info->par; +struct drm_device *dev = par->dev; + +NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); + info->flags |=FBINFO_HWACCEL_DISABLED ; +}drivers/gpu/drm/nouveau/nouveau_fbcon.h +1
-0@@ -43,5 +43,6 @@ void nouveau_fbcon_zfill(struct drm_device *dev);int nv04_fbcon_accel_init (struct fb_info *info);int nv50_fbcon_accel_init (struct fb_info *info); +void nouveau_gpu_lockup (struct fb_info *info);#endif /* __NV50_FBCON_H__ */ drivers/gpu/drm/nouveau/nv04_fbcon.c +5
-10@@ -39,8 +39,7 @@ nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -68,8 +67,7 @@ nv04_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,7 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -109,8 +107,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,8 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -144,8 +141,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int iter_len = dsize >128 ?128 : dsize;if (RING_SPACE (chan, iter_len +1 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);cfb_imageblit (info, image);return ; }@@ -243,8 +239,7 @@ nv04_fbcon_accel_init(struct fb_info *info)return ret;if (RING_SPACE (chan,49 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);return 0 ; }drivers/gpu/drm/nouveau/nv50_fbcon.c +5
-12@@ -17,9 +17,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan, rect->rop ==ROP_COPY ?7 :11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -57,9 +55,7 @@ nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,12 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -102,8 +98,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -136,9 +131,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int push = dwords >2047 ?2047 : dwords;if (RING_SPACE (chan, push +1 )) { -NV_ERROR (dev, -"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_gpu_lockup (info);cfb_imageblit (info, image);return ; }@@ -200,7 +193,7 @@ nv50_fbcon_accel_init(struct fb_info *info) ret =RING_SPACE (chan,59 );if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); +nouveau_gpu_lockup (info);return ret; }
Quoted 5 lines · Ben Skeggs
Quoted 1 line · Marcin Slusarz
New version, without file/line markers in
nouveau_gpu_lockup(they were useless...).Looks mostly good to me, can you rename to
nouveau_fbcon_gpu_lockup()instead however, as the function only deals with fbcon and not a more general handling.
done
---
From: Marcin Slusarz <[email protected]>
Subject: [PATCH v3 1/2] drm/nouveau: create function for "dealing" with gpu lockup
It's mostly a cleanup, but in nv50_fbcon_accel_init gpu lockup message was printed, but HWACCEL_DISBALED flag was not set.
--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 15 +++++++++++---- drivers/gpu/drm/nouveau/nouveau_fbcon.h | 1 + drivers/gpu/drm/nouveau/nv04_fbcon.c | 15 +++++---------- drivers/gpu/drm/nouveau/nv50_fbcon.c | 17 +++++------------ 4 files changed, 22 insertions(+), 26 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fbcon.c +11 -4
@@ -64,8 +64,7 @@ nouveau_fbcon_sync(struct fb_info *info)return 0 ;if (RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);return 0 ; }
@@ -86,8 +85,7 @@ nouveau_fbcon_sync(struct fb_info *info) }if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);return 0 ; }
@@ -380,3 +378,12 @@ nouveau_fbcon_remove(struct drm_device *dev, struct drm_framebuffer *fb)return 0 ; } + +void nouveau_fbcon_gpu_lockup (struct fb_info *info) +{ +struct nouveau_fbcon_par *par = info->par; +struct drm_device *dev = par->dev; + +NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); + info->flags |=FBINFO_HWACCEL_DISABLED ; +}
drivers/gpu/drm/nouveau/nouveau_fbcon.h +1 -0
@@ -43,5 +43,6 @@ void nouveau_fbcon_zfill(struct drm_device *dev);int nv04_fbcon_accel_init (struct fb_info *info);int nv50_fbcon_accel_init (struct fb_info *info); +void nouveau_fbcon_gpu_lockup (struct fb_info *info);#endif /* __NV50_FBCON_H__ */
drivers/gpu/drm/nouveau/nv04_fbcon.c +5 -10
@@ -39,8 +39,7 @@ nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -68,8 +67,7 @@ nv04_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,7 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -109,8 +107,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,8 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -144,8 +141,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int iter_len = dsize >128 ?128 : dsize;if (RING_SPACE (chan, iter_len +1 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);cfb_imageblit (info, image);return ; }
@@ -243,8 +239,7 @@ nv04_fbcon_accel_init(struct fb_info *info)return ret;if (RING_SPACE (chan,49 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);return 0 ; }
drivers/gpu/drm/nouveau/nv50_fbcon.c +5 -12
@@ -17,9 +17,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan, rect->rop ==ROP_COPY ?7 :11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -57,9 +55,7 @@ nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,12 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -102,8 +98,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {
@@ -136,9 +131,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int push = dwords >2047 ?2047 : dwords;if (RING_SPACE (chan, push +1 )) { -NV_ERROR (dev, -"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);cfb_imageblit (info, image);return ; }
@@ -200,7 +193,7 @@ nv50_fbcon_accel_init(struct fb_info *info) ret =RING_SPACE (chan,59 );if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); +nouveau_fbcon_gpu_lockup (info);return ret; }
Signature · 1 line
1.6.6.rc3
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Marcin Slusarz
Quoted 5 lines · Ben Skeggs
Quoted 1 line · Marcin Slusarz
New version, without file/line markers in
nouveau_gpu_lockup(they were useless...).Looks mostly good to me, can you rename to
nouveau_fbcon_gpu_lockup()instead however, as the function only deals with fbcon and not a more general handling.done
Thanks :) Applied to my tree, I'll push it in a few hours.
Ben.
Quoted 173 lines
---
From: Marcin Slusarz <[email protected]>
Subject: [PATCH v3 1/2] drm/nouveau: create function for "dealing" with gpu lockupIt's mostly a cleanup, but in
nv50_fbcon_accel_initgpu lockup message was printed, butHWACCEL_DISBALEDflag was not set.Signed-off-by Marcin Slusarz <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 15 +++++++++++---- drivers/gpu/drm/nouveau/nouveau_fbcon.h | 1 + drivers/gpu/drm/nouveau/nv04_fbcon.c | 15 +++++---------- drivers/gpu/drm/nouveau/nv50_fbcon.c | 17 +++++------------ 4 files changed, 22 insertions(+), 26 deletions(-)drivers/gpu/drm/nouveau/nouveau_fbcon.c +11
-4@@ -64,8 +64,7 @@ nouveau_fbcon_sync(struct fb_info *info)return 0 ;if (RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);return 0 ; }@@ -86,8 +85,7 @@ nouveau_fbcon_sync(struct fb_info *info) }if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);return 0 ; }@@ -380,3 +378,12 @@ nouveau_fbcon_remove(struct drm_device *dev, struct drm_framebuffer *fb)return 0 ; } + +void nouveau_fbcon_gpu_lockup (struct fb_info *info) +{ +struct nouveau_fbcon_par *par = info->par; +struct drm_device *dev = par->dev; + +NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); + info->flags |=FBINFO_HWACCEL_DISABLED ; +}drivers/gpu/drm/nouveau/nouveau_fbcon.h +1
-0@@ -43,5 +43,6 @@ void nouveau_fbcon_zfill(struct drm_device *dev);int nv04_fbcon_accel_init (struct fb_info *info);int nv50_fbcon_accel_init (struct fb_info *info); +void nouveau_fbcon_gpu_lockup (struct fb_info *info);#endif /* __NV50_FBCON_H__ */ drivers/gpu/drm/nouveau/nv04_fbcon.c +5
-10@@ -39,8 +39,7 @@ nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,4 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -68,8 +67,7 @@ nv04_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,7 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -109,8 +107,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,8 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -144,8 +141,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int iter_len = dsize >128 ?128 : dsize;if (RING_SPACE (chan, iter_len +1 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);cfb_imageblit (info, image);return ; }@@ -243,8 +239,7 @@ nv04_fbcon_accel_init(struct fb_info *info)return ret;if (RING_SPACE (chan,49 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);return 0 ; }drivers/gpu/drm/nouveau/nv50_fbcon.c +5
-12@@ -17,9 +17,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan, rect->rop ==ROP_COPY ?7 :11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -57,9 +55,7 @@ nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)return ;if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,12 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -102,8 +98,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) }if (!(info->flags &FBINFO_HWACCEL_DISABLED ) &&RING_SPACE (chan,11 )) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info); }if (info->flags &FBINFO_HWACCEL_DISABLED ) {@@ -136,9 +131,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)int push = dwords >2047 ?2047 : dwords;if (RING_SPACE (chan, push +1 )) { -NV_ERROR (dev, -"GPU lockup - switching to software fbcon\n" ); - info->flags |=FBINFO_HWACCEL_DISABLED ; +nouveau_fbcon_gpu_lockup (info);cfb_imageblit (info, image);return ; }@@ -200,7 +193,7 @@ nv50_fbcon_accel_init(struct fb_info *info) ret =RING_SPACE (chan,59 );if (ret) { -NV_ERROR (dev,"GPU lockup - switching to software fbcon\n" ); +nouveau_fbcon_gpu_lockup (info);return ret; }