BUG caused by "Use new drm_fb_helper functions" series

2016-02-09 Thread One Thousand Gnomes
> > > But a better look has me wondering how all these gpus are syncing
> > > the framebuffer for direct access via cfb_imageblit and friends. I only 
> > > see
> > > nouveau and intel gma even trying.  
> > 
> > Probably no other DRM driver uses hardware acceleration for fbcon.  
> 
> Yup. We've had patches for i915, resulted in half of mesa+glamour in-kernel, 
> which
> is just pointless.
> -Daniel

When I did the gma500 driver I played with it a little and the only thing
that made any difference was scrolling acceleratin - which actually the
i915 can probably also do without using the 2D/3D engine.

It's actually trying to fix the wrong problem. The real problem is that
the fbcon layer when running pure text output tries to write everything to
the screen rather than just updating the offscreen array of text and
then doing at most one difference update per vblank based upon the state
of the display. That would make most of the dumb fbs feel lightning fast.

Alan


BUG caused by "Use new drm_fb_helper functions" series

2016-02-09 Thread Daniel Vetter
On Wed, Feb 03, 2016 at 06:30:54PM +0900, Michel Dänzer wrote:
> On 03.02.2016 03:38, Peter Hurley wrote:
> > On 02/01/2016 09:20 PM, Archit Taneja wrote:
> >> Hi Peter,
> >>
> >> On 02/02/2016 02:07 AM, Peter Hurley wrote:
> >>> Hi Archit,
> >>>
> >>> Just booting 4.4-rc5+, I got this splat [1]
> >>> At first glance, this appears to be a simple fix.
> >>
> >> Thanks for sharing this.
> >>
> >>>
> >>> However, I'm concerned that fbcon functions, which may be called with
> >>> interrupts disabled, are now hooked up to fbdev functions which may assume
> >>> interrupts are not disabled (as is the case with cfb_imageblit()).
> >>
> >> In the case when CONFIG_FB is enabled, drm_fb_helper_cfb_imageblit
> >> helper simply wraps around cfg_imageblit, so I don't see how we'd have
> >> any difference in behaviour.
> > 
> > 
> > Sorry; terrible attribution on my part.
> > This bug clearly has nothing to do with this series.
> > 
> > But a better look has me wondering how all these gpus are syncing
> > the framebuffer for direct access via cfb_imageblit and friends. I only see
> > nouveau and intel gma even trying.
> 
> Probably no other DRM driver uses hardware acceleration for fbcon.

Yup. We've had patches for i915, resulted in half of mesa+glamour in-kernel, 
which
is just pointless.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


BUG caused by "Use new drm_fb_helper functions" series

2016-02-03 Thread Michel Dänzer
On 03.02.2016 03:38, Peter Hurley wrote:
> On 02/01/2016 09:20 PM, Archit Taneja wrote:
>> Hi Peter,
>>
>> On 02/02/2016 02:07 AM, Peter Hurley wrote:
>>> Hi Archit,
>>>
>>> Just booting 4.4-rc5+, I got this splat [1]
>>> At first glance, this appears to be a simple fix.
>>
>> Thanks for sharing this.
>>
>>>
>>> However, I'm concerned that fbcon functions, which may be called with
>>> interrupts disabled, are now hooked up to fbdev functions which may assume
>>> interrupts are not disabled (as is the case with cfb_imageblit()).
>>
>> In the case when CONFIG_FB is enabled, drm_fb_helper_cfb_imageblit
>> helper simply wraps around cfg_imageblit, so I don't see how we'd have
>> any difference in behaviour.
> 
> 
> Sorry; terrible attribution on my part.
> This bug clearly has nothing to do with this series.
> 
> But a better look has me wondering how all these gpus are syncing
> the framebuffer for direct access via cfb_imageblit and friends. I only see
> nouveau and intel gma even trying.

Probably no other DRM driver uses hardware acceleration for fbcon.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer


BUG caused by "Use new drm_fb_helper functions" series

2016-02-02 Thread Archit Taneja
Hi Peter,

On 02/02/2016 02:07 AM, Peter Hurley wrote:
> Hi Archit,
>
> Just booting 4.4-rc5+, I got this splat [1]
> At first glance, this appears to be a simple fix.

Thanks for sharing this.

>
> However, I'm concerned that fbcon functions, which may be called with
> interrupts disabled, are now hooked up to fbdev functions which may assume
> interrupts are not disabled (as is the case with cfb_imageblit()).

In the case when CONFIG_FB is enabled, drm_fb_helper_cfb_imageblit
helper simply wraps around cfg_imageblit, so I don't see how we'd have
any difference in behaviour.

>
> For example, in the splat below, it's a simple fix to make the splat go
> away with GFP_ATOMIC allocation. However, the following fence wait is _never_
> going to trigger with interrupts disabled on UP.
>
> FWIW, I've been running almost exclusively debug kernel builds so I'm not
> sure why this hasn't triggered many times before, but it hasn't.

We could revert the patch
"drm/nouveau: Use new drm_fb_helper functions" and see if we still hit this
issue.

Thanks,
Archit

> Regards,
> Peter Hurley
>
>
> [1] BUG splat
>
> [   37.438494] BUG: sleeping function called from invalid context at 
> /home/peter/src/kernels/mainline/mm/slub.c:1287
> [   37.438495] in_atomic(): 1, irqs_disabled(): 1, pid: 2276, name: auditd
> [   37.438497] 1 lock held by auditd/2276:
> [   37.438507]  #0:  (audit_cmd_mutex){+.+.+.}, at: [] 
> audit_receive+0x1f/0xa0
> [   37.438507] irq event stamp: 1689
> [   37.438511] hardirqs last  enabled at (1689): [] 
> vprintk_emit+0x236/0x620
> [   37.438513] hardirqs last disabled at (1688): [] 
> vprintk_emit+0xd4/0x620
> [   37.438518] softirqs last  enabled at (1652): [] 
> netlink_poll+0x138/0x1c0
> [   37.438520] softirqs last disabled at (1650): [] 
> netlink_poll+0xf7/0x1c0
> [   37.438522] CPU: 7 PID: 2276 Comm: auditd Not tainted 
> 4.4.0-rc5+wip-xeon+debug #rc5+wip
> [   37.438523] Hardware name: Dell Inc. Precision WorkStation T5400  /0RW203, 
> BIOS A11 04/30/2012
> [   37.438526]  81ce5cc8 8802a87c3590 813fb6c5 
> 8802ac768000
> [   37.438528]  8802a87c35b8 810a6fb9 81ce5cc8 
> 0507
> [   37.438530]   8802a87c35e0 810a70b9 
> 024080c0
> [   37.438531] Call Trace:
> [   37.438535]  [] dump_stack+0x4e/0x79
> [   37.438538]  [] ___might_sleep+0x149/0x200
> [   37.438540]  [] __might_sleep+0x49/0x80
> [   37.438544]  [] kmem_cache_alloc_trace+0x20d/0x2e0
> [   37.438600]  [] ? nouveau_fence_new+0x3b/0x90 [nouveau]
> [   37.438624]  [] nouveau_fence_new+0x3b/0x90 [nouveau]
> [   37.438649]  [] nouveau_channel_idle+0x42/0xb0 [nouveau]
> [   37.438673]  [] nouveau_fbcon_sync+0x7f/0xb0 [nouveau]
> [   37.438677]  [] cfb_imageblit+0x9a/0x4d0
> [   37.438681]  [] ? trace_hardirqs_off_caller+0x1f/0xc0
> [   37.438693]  [] drm_fb_helper_cfb_imageblit+0xe/0x10 
> [drm_kms_helper]
> [   37.438717]  [] nouveau_fbcon_imageblit+0x51/0xd0 
> [nouveau]
> [   37.438719]  [] bit_putcs+0x2dc/0x530
> [   37.438721]  [] ? trace_hardirqs_off+0xd/0x10
> [   37.438725]  [] ? get_color.isra.15+0x34/0x130
> [   37.438727]  [] fbcon_putcs+0x128/0x160
> [   37.438728]  [] ? bit_cursor+0x5e0/0x5e0
> [   37.438730]  [] fbcon_redraw.isra.25+0x16b/0x1d0
> [   37.438731]  [] fbcon_scroll+0x1ea/0xce0
> [   37.438734]  [] scrup+0x14a/0x160
> [   37.438736]  [] lf+0x80/0x90
> [   37.438737]  [] vt_console_print+0x2a7/0x3e0
> [   37.438739]  [] 
> call_console_drivers.constprop.24+0x144/0x1d0
> [   37.438741]  [] console_unlock+0x463/0x540
> [   37.438742]  [] vprintk_emit+0x35a/0x620
> [   37.438744]  [] vprintk_default+0x29/0x40
> [   37.438748]  [] printk+0x4d/0x4f
> [   37.438750]  [] audit_printk_skb+0x62/0x70
> [   37.438751]  [] audit_log_end+0x1d4/0x2d0
> [   37.438752]  [] ? audit_log_end+0x30/0x2d0
> [   37.438754]  [] audit_log_config_change+0x89/0xa0
> [   37.438756]  [] audit_receive_msg+0xa5a/0xbb0
> [   37.438759]  [] ? mutex_lock_nested+0x2ed/0x450
> [   37.438761]  [] ? audit_receive+0x1f/0xa0
> [   37.438762]  [] ? audit_receive+0x1f/0xa0
> [   37.438764]  [] audit_receive+0x52/0xa0
> [   37.438766]  [] netlink_unicast+0xf2/0x1c0
> [   37.438767]  [] netlink_sendmsg+0x3e7/0x620
> [   37.438771]  [] sock_sendmsg+0x38/0x50
> [   37.438772]  [] SYSC_sendto+0xf6/0x170
> [   37.438775]  [] ? context_tracking_exit+0x1d/0x30
> [   37.438778]  [] ? enter_from_user_mode+0x1f/0x50
> [   37.438780]  [] ? syscall_trace_enter_phase1+0xcb/0x130
> [   37.438781]  [] ? trace_hardirqs_on_thunk+0x17/0x19
> [   37.438784]  [] SyS_sendto+0xe/0x10
> [   37.438786]  [] entry_SYSCALL_64_fastpath+0x16/0x7a
>

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum, hosted by The Linux Foundation


BUG caused by "Use new drm_fb_helper functions" series

2016-02-02 Thread Peter Hurley
On 02/01/2016 09:20 PM, Archit Taneja wrote:
> Hi Peter,
> 
> On 02/02/2016 02:07 AM, Peter Hurley wrote:
>> Hi Archit,
>>
>> Just booting 4.4-rc5+, I got this splat [1]
>> At first glance, this appears to be a simple fix.
> 
> Thanks for sharing this.
> 
>>
>> However, I'm concerned that fbcon functions, which may be called with
>> interrupts disabled, are now hooked up to fbdev functions which may assume
>> interrupts are not disabled (as is the case with cfb_imageblit()).
> 
> In the case when CONFIG_FB is enabled, drm_fb_helper_cfb_imageblit
> helper simply wraps around cfg_imageblit, so I don't see how we'd have
> any difference in behaviour.


Sorry; terrible attribution on my part.
This bug clearly has nothing to do with this series.

But a better look has me wondering how all these gpus are syncing
the framebuffer for direct access via cfb_imageblit and friends. I only see
nouveau and intel gma even trying.



>> For example, in the splat below, it's a simple fix to make the splat go
>> away with GFP_ATOMIC allocation. However, the following fence wait is _never_
>> going to trigger with interrupts disabled on UP.
>>
>> FWIW, I've been running almost exclusively debug kernel builds so I'm not
>> sure why this hasn't triggered many times before, but it hasn't.
> 
> We could revert the patch
> "drm/nouveau: Use new drm_fb_helper functions" and see if we still hit this
> issue.
> 
> Thanks,
> Archit
> 
>> Regards,
>> Peter Hurley
>>
>>
>> [1] BUG splat
>>
>> [   37.438494] BUG: sleeping function called from invalid context at 
>> /home/peter/src/kernels/mainline/mm/slub.c:1287
>> [   37.438495] in_atomic(): 1, irqs_disabled(): 1, pid: 2276, name: auditd
>> [   37.438497] 1 lock held by auditd/2276:
>> [   37.438507]  #0:  (audit_cmd_mutex){+.+.+.}, at: [] 
>> audit_receive+0x1f/0xa0
>> [   37.438507] irq event stamp: 1689
>> [   37.438511] hardirqs last  enabled at (1689): [] 
>> vprintk_emit+0x236/0x620
>> [   37.438513] hardirqs last disabled at (1688): [] 
>> vprintk_emit+0xd4/0x620
>> [   37.438518] softirqs last  enabled at (1652): [] 
>> netlink_poll+0x138/0x1c0
>> [   37.438520] softirqs last disabled at (1650): [] 
>> netlink_poll+0xf7/0x1c0
>> [   37.438522] CPU: 7 PID: 2276 Comm: auditd Not tainted 
>> 4.4.0-rc5+wip-xeon+debug #rc5+wip
>> [   37.438523] Hardware name: Dell Inc. Precision WorkStation T5400  
>> /0RW203, BIOS A11 04/30/2012
>> [   37.438526]  81ce5cc8 8802a87c3590 813fb6c5 
>> 8802ac768000
>> [   37.438528]  8802a87c35b8 810a6fb9 81ce5cc8 
>> 0507
>> [   37.438530]   8802a87c35e0 810a70b9 
>> 024080c0
>> [   37.438531] Call Trace:
>> [   37.438535]  [] dump_stack+0x4e/0x79
>> [   37.438538]  [] ___might_sleep+0x149/0x200
>> [   37.438540]  [] __might_sleep+0x49/0x80
>> [   37.438544]  [] kmem_cache_alloc_trace+0x20d/0x2e0
>> [   37.438600]  [] ? nouveau_fence_new+0x3b/0x90 [nouveau]
>> [   37.438624]  [] nouveau_fence_new+0x3b/0x90 [nouveau]
>> [   37.438649]  [] nouveau_channel_idle+0x42/0xb0 [nouveau]
>> [   37.438673]  [] nouveau_fbcon_sync+0x7f/0xb0 [nouveau]
>> [   37.438677]  [] cfb_imageblit+0x9a/0x4d0
>> [   37.438681]  [] ? trace_hardirqs_off_caller+0x1f/0xc0
>> [   37.438693]  [] drm_fb_helper_cfb_imageblit+0xe/0x10 
>> [drm_kms_helper]
>> [   37.438717]  [] nouveau_fbcon_imageblit+0x51/0xd0 
>> [nouveau]
>> [   37.438719]  [] bit_putcs+0x2dc/0x530
>> [   37.438721]  [] ? trace_hardirqs_off+0xd/0x10
>> [   37.438725]  [] ? get_color.isra.15+0x34/0x130
>> [   37.438727]  [] fbcon_putcs+0x128/0x160
>> [   37.438728]  [] ? bit_cursor+0x5e0/0x5e0
>> [   37.438730]  [] fbcon_redraw.isra.25+0x16b/0x1d0
>> [   37.438731]  [] fbcon_scroll+0x1ea/0xce0
>> [   37.438734]  [] scrup+0x14a/0x160
>> [   37.438736]  [] lf+0x80/0x90
>> [   37.438737]  [] vt_console_print+0x2a7/0x3e0
>> [   37.438739]  [] 
>> call_console_drivers.constprop.24+0x144/0x1d0
>> [   37.438741]  [] console_unlock+0x463/0x540
>> [   37.438742]  [] vprintk_emit+0x35a/0x620
>> [   37.438744]  [] vprintk_default+0x29/0x40
>> [   37.438748]  [] printk+0x4d/0x4f
>> [   37.438750]  [] audit_printk_skb+0x62/0x70
>> [   37.438751]  [] audit_log_end+0x1d4/0x2d0
>> [   37.438752]  [] ? audit_log_end+0x30/0x2d0
>> [   37.438754]  [] audit_log_config_change+0x89/0xa0
>> [   37.438756]  [] audit_receive_msg+0xa5a/0xbb0
>> [   37.438759]  [] ? mutex_lock_nested+0x2ed/0x450
>> [   37.438761]  [] ? audit_receive+0x1f/0xa0
>> [   37.438762]  [] ? audit_receive+0x1f/0xa0
>> [   37.438764]  [] audit_receive+0x52/0xa0
>> [   37.438766]  [] netlink_unicast+0xf2/0x1c0
>> [   37.438767]  [] netlink_sendmsg+0x3e7/0x620
>> [   37.438771]  [] sock_sendmsg+0x38/0x50
>> [   37.438772]  [] SYSC_sendto+0xf6/0x170
>> [   37.438775]  [] ? context_tracking_exit+0x1d/0x30
>> [   37.438778]  [] ? enter_from_user_mode+0x1f/0x50
>> [   37.438780]  [] ? syscall_trace_enter_phase1+0xcb/0x130
>> [   37.438781]  [] ? trace_hardirqs_on_thunk+0x17/0x19
>> [   

BUG caused by "Use new drm_fb_helper functions" series

2016-02-01 Thread Peter Hurley
Hi Archit,

Just booting 4.4-rc5+, I got this splat [1]
At first glance, this appears to be a simple fix.

However, I'm concerned that fbcon functions, which may be called with
interrupts disabled, are now hooked up to fbdev functions which may assume
interrupts are not disabled (as is the case with cfb_imageblit()).

For example, in the splat below, it's a simple fix to make the splat go
away with GFP_ATOMIC allocation. However, the following fence wait is _never_
going to trigger with interrupts disabled on UP.

FWIW, I've been running almost exclusively debug kernel builds so I'm not
sure why this hasn't triggered many times before, but it hasn't.

Regards,
Peter Hurley


[1] BUG splat

[   37.438494] BUG: sleeping function called from invalid context at 
/home/peter/src/kernels/mainline/mm/slub.c:1287
[   37.438495] in_atomic(): 1, irqs_disabled(): 1, pid: 2276, name: auditd
[   37.438497] 1 lock held by auditd/2276:
[   37.438507]  #0:  (audit_cmd_mutex){+.+.+.}, at: [] 
audit_receive+0x1f/0xa0
[   37.438507] irq event stamp: 1689
[   37.438511] hardirqs last  enabled at (1689): [] 
vprintk_emit+0x236/0x620
[   37.438513] hardirqs last disabled at (1688): [] 
vprintk_emit+0xd4/0x620
[   37.438518] softirqs last  enabled at (1652): [] 
netlink_poll+0x138/0x1c0
[   37.438520] softirqs last disabled at (1650): [] 
netlink_poll+0xf7/0x1c0
[   37.438522] CPU: 7 PID: 2276 Comm: auditd Not tainted 
4.4.0-rc5+wip-xeon+debug #rc5+wip
[   37.438523] Hardware name: Dell Inc. Precision WorkStation T5400  /0RW203, 
BIOS A11 04/30/2012
[   37.438526]  81ce5cc8 8802a87c3590 813fb6c5 
8802ac768000
[   37.438528]  8802a87c35b8 810a6fb9 81ce5cc8 
0507
[   37.438530]   8802a87c35e0 810a70b9 
024080c0
[   37.438531] Call Trace:
[   37.438535]  [] dump_stack+0x4e/0x79
[   37.438538]  [] ___might_sleep+0x149/0x200
[   37.438540]  [] __might_sleep+0x49/0x80
[   37.438544]  [] kmem_cache_alloc_trace+0x20d/0x2e0
[   37.438600]  [] ? nouveau_fence_new+0x3b/0x90 [nouveau]
[   37.438624]  [] nouveau_fence_new+0x3b/0x90 [nouveau]
[   37.438649]  [] nouveau_channel_idle+0x42/0xb0 [nouveau]
[   37.438673]  [] nouveau_fbcon_sync+0x7f/0xb0 [nouveau]
[   37.438677]  [] cfb_imageblit+0x9a/0x4d0
[   37.438681]  [] ? trace_hardirqs_off_caller+0x1f/0xc0
[   37.438693]  [] drm_fb_helper_cfb_imageblit+0xe/0x10 
[drm_kms_helper]
[   37.438717]  [] nouveau_fbcon_imageblit+0x51/0xd0 [nouveau]
[   37.438719]  [] bit_putcs+0x2dc/0x530
[   37.438721]  [] ? trace_hardirqs_off+0xd/0x10
[   37.438725]  [] ? get_color.isra.15+0x34/0x130
[   37.438727]  [] fbcon_putcs+0x128/0x160
[   37.438728]  [] ? bit_cursor+0x5e0/0x5e0
[   37.438730]  [] fbcon_redraw.isra.25+0x16b/0x1d0
[   37.438731]  [] fbcon_scroll+0x1ea/0xce0
[   37.438734]  [] scrup+0x14a/0x160
[   37.438736]  [] lf+0x80/0x90
[   37.438737]  [] vt_console_print+0x2a7/0x3e0
[   37.438739]  [] 
call_console_drivers.constprop.24+0x144/0x1d0
[   37.438741]  [] console_unlock+0x463/0x540
[   37.438742]  [] vprintk_emit+0x35a/0x620
[   37.438744]  [] vprintk_default+0x29/0x40
[   37.438748]  [] printk+0x4d/0x4f
[   37.438750]  [] audit_printk_skb+0x62/0x70
[   37.438751]  [] audit_log_end+0x1d4/0x2d0
[   37.438752]  [] ? audit_log_end+0x30/0x2d0
[   37.438754]  [] audit_log_config_change+0x89/0xa0
[   37.438756]  [] audit_receive_msg+0xa5a/0xbb0
[   37.438759]  [] ? mutex_lock_nested+0x2ed/0x450
[   37.438761]  [] ? audit_receive+0x1f/0xa0
[   37.438762]  [] ? audit_receive+0x1f/0xa0
[   37.438764]  [] audit_receive+0x52/0xa0
[   37.438766]  [] netlink_unicast+0xf2/0x1c0
[   37.438767]  [] netlink_sendmsg+0x3e7/0x620
[   37.438771]  [] sock_sendmsg+0x38/0x50
[   37.438772]  [] SYSC_sendto+0xf6/0x170
[   37.438775]  [] ? context_tracking_exit+0x1d/0x30
[   37.438778]  [] ? enter_from_user_mode+0x1f/0x50
[   37.438780]  [] ? syscall_trace_enter_phase1+0xcb/0x130
[   37.438781]  [] ? trace_hardirqs_on_thunk+0x17/0x19
[   37.438784]  [] SyS_sendto+0xe/0x10
[   37.438786]  [] entry_SYSCALL_64_fastpath+0x16/0x7a