[PATCH] drm/radeon: only init fbdev if we have connectors
Is something similar required for AMDGPU too? On Mon, 25 Jan 2016 at 23:06 Rob Clark wrote: > This fixes an issue that was noticed on an optimus/prime laptop with > a kernel that was old enough to not support the integrated intel gfx > (which was driving all the outputs), but did have support for the > discrete radeon gpu. The end result was not falling back to VESA and > leaving the user with a black screen. > > (Plus it is kind of silly to create an framebuffer device if there > are no outputs hooked up to the gpu.) > > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/radeon/radeon_display.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_display.c > b/drivers/gpu/drm/radeon/radeon_display.c > index 1eca0ac..f8e776c 100644 > --- a/drivers/gpu/drm/radeon/radeon_display.c > +++ b/drivers/gpu/drm/radeon/radeon_display.c > @@ -1670,8 +1670,10 @@ int radeon_modeset_init(struct radeon_device *rdev) > /* setup afmt */ > radeon_afmt_init(rdev); > > - radeon_fbdev_init(rdev); > - drm_kms_helper_poll_init(rdev->ddev); > + if (!list_empty(&rdev->ddev->mode_config.connector_list)) { > + radeon_fbdev_init(rdev); > + drm_kms_helper_poll_init(rdev->ddev); > + } > > /* do pm late init */ > ret = radeon_pm_late_init(rdev); > -- > 2.5.0 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel > -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/42fc5cfb/attachment-0001.html>
[Bug 91880] Radeonsi on Grenada cards (r9 390) exceptionally unstable and poorly performing
https://bugs.freedesktop.org/show_bug.cgi?id=91880 --- Comment #76 from Julian --- (In reply to Ioannis Panagiotopoulos from comment #75) > Also tried this since I have the same problem, compiled the new_smc branch, > installed the kernel and the firmware, however the problem persists if I > boot it without radeon.dpm=0. What card do you have? You can try this as well: download and move the hawaii_k_smc.bin firmware image into /lib/firmware/radeon and rename it to hawaii_smc.bin (backup or delete the existing file). Boot into your normal unpatched Kernel and see if it works. That's what I'm doing right now and it works for me. Just keep in mind that this might break your Linux install if it doesn't work (so having a live USB/CD and the backuped firmware file is handy). -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/db5f8fe0/attachment.html>
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On Mon, Jan 25, 2016 at 10:42 PM, Mario Kleiner wrote: >> >>> Now the patch i want to try next to fix the drm_vblank_pre/post_modeset >>> regression in Linux 4.4/4.5 is to add a ... >>> >>> if ((diff > 1) && vblank->inmodeset) diff = 1; >>> >>> ... to the bottom of drm_update_vblank_count(). That should hopefully >>> restore the pre/post_modeset behavior as close to the original behavior >>> as >>> possible. As a side effect it would also prevent the counter jump caused >>> by >>> redundant calls to drm_vblank_off(). >> >> >> Hm, can we just frob pre/post_modeset only with some checks? I'd like to >> not put that kind of "I have no idea about my hw state" hacks into the new >> helpers. Otherwise not even atomic drivers can start to gain WARN_ONs to >> enforce correct usage, which would be a real bummer imo. >> -Daniel >> > > We could check for only (vblank->inmodeset & 0x2) to only apply it to the > legacy pre/post path, trusting that the drm_vblank_off/on path will be made > robust in a different way, e.g., by the stuff discussed above and careful > implementation in each kms driver that uses those. Atm. radeon doesn't use > off/on, so your enablement patch set can make sure it does the right thing > from the beginning. > > rockchip-kms may need similar treatment to radeon to avoid redundant calls. > > Btw. how the patch to drm_update_vblank_count() close to the bottom would > actually look is more like: > > if ((diff > 1) && > ((vblank->inmodeset & 0x2) || (flags & DRM_CALLED_FROM_VBLIRQ))) > diff = 1; Yeah I think that should work as a short-term fix for radoen. When you do that, can you pls do a second patch to give the magic 0x2 and 0x1 some meaning? Otherwise this is super-hard to understand code ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
[PATCH] gpu: drm: amd: amdkfd: Remove unnecessary cast in kfree
Remove an unnecassary cast in the argument to kfree. Found using Coccinelle. The semantic patch used to find this is as follows: // @@ type T; expression *f; @@ - kfree((T *)(f)); + kfree(f); // Signed-off-by: Amitoj Kaur Chawla --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 9be0070..a902ae0 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -194,7 +194,7 @@ static void kfd_process_wq_release(struct work_struct *work) kfree(p); - kfree((void *)work); + kfree(work); } static void kfd_process_destroy_delayed(struct rcu_head *rcu) -- 1.9.1
[Bug 93866] Tonga: Weston-drm direct scan out corruption
https://bugs.freedesktop.org/show_bug.cgi?id=93866 Andy Furniss changed: What|Removed |Added Attachment #121287|text/plain |image/jpeg mime type|| -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/980c20d5/attachment.html>
[Bug 93866] Tonga: Weston-drm direct scan out corruption
https://bugs.freedesktop.org/show_bug.cgi?id=93866 Bug ID: 93866 Summary: Tonga: Weston-drm direct scan out corruption Product: DRI Version: DRI git Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: DRM/AMDgpu Assignee: dri-devel at lists.freedesktop.org Reporter: adf.lists at gmail.com Created attachment 121287 --> https://bugs.freedesktop.org/attachment.cgi?id=121287&action=edit external picture showing corruption Testing both release and git wayland/weston on R9285. Using weston-launch from fbcon so it uses weston-drm. Apart from https://bugs.freedesktop.org/show_bug.cgi?id=93740 which can be worked around, rendering is good when compositing. If I run something that allows weston to enable direct scanout there is slight corruption. kodi and mpv are the only ways I know to do this. If I do something that changes back yo compositing the corruption goes, taking a screen shot/recording or zooming in will all "fix" the corruption. I am inferring direct scan out is happening as I can't change transparency + the man page for weston-drm says it will be used where possible. Tried going back in time with mesa to see if it ever worked, but I started hitting places where either weston wouldn't start or I always got compositing so no corruption but I could change transparency. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/d8c8809f/attachment.html>
[Bug 93740] weston client egl corruption above certain window size since radeonsi: Enable DCC.
https://bugs.freedesktop.org/show_bug.cgi?id=93740 --- Comment #3 from Andy Furniss --- Re tested with git wayland/weston and the issue persists. Testing from mesa head R600_DEBUG=nodcc fixes. nodccclear does not fix. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/8cfa931e/attachment-0001.html>
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On 01/25/2016 09:32 PM, Daniel Vetter wrote: > On Mon, Jan 25, 2016 at 08:30:14PM +0100, Mario Kleiner wrote: >> >> >> On 01/25/2016 07:51 PM, Daniel Vetter wrote: >>> On Mon, Jan 25, 2016 at 05:38:30PM +0100, Mario Kleiner wrote: Readding Daniel, which somehow got dropped from the cc. On 01/25/2016 03:53 PM, Ville Syrjälä wrote: > On Mon, Jan 25, 2016 at 02:44:53PM +0100, Mario Kleiner wrote: >> >> >> On 01/25/2016 02:23 PM, Ville Syrjälä wrote: >>> On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: On 01/25/2016 05:15 AM, Michel Dänzer wrote: > On 23.01.2016 00:18, Ville Syrjälä wrote: >> On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: >>> >>> [ Trimming KDE folks from Cc ] >>> >>> On 21.01.2016 19:09, Daniel Vetter wrote: On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: > On 21.01.2016 16:58, Daniel Vetter wrote: >> >> Can you please point me at the vblank on/off jump bug please? > > AFAIR I originally reported it in response to > http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html > , but I can't find that in the archives, so maybe that was just > on IRC. > See > http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html > . Basically, I ran into the bug fixed by your patch because the > counter > jumped forward on every DPMS off, so it hit the 32-bit boundary > after > just a few days. Ok, so just uncovered the overflow bug. >>> >>> Not sure what you mean by "just", but to be clear: The >>> drm_vblank_on/off >>> counter jumping bug (similar to the bug this thread is about), which >>> exposed the overflow bug, is still alive and kicking in 4.5. It >>> seems >>> to happen when turning off the CRTC: >>> >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=218104694, diff=0, hw=916 hw_last=916 >>> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 >>> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 >>> p(2199,-45)@ 7304.307354 -> 7304.308006 [e 0 us, 0 rep] >>> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=218104694, diff=16776301, hw=1 hw_last=916 >> >> Not sure what bug we're talking about here, but here the hw counter >> clearly jumps backwards. >> >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 1: >>> current=0, diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 2: >>> current=0, diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 3: >>> current=0, diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 >>> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ >>> 7304.317140 -> 7304.317140 [e 0 us, 0 rep] >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=234880995, diff=16777215, hw=0 hw_last=1 >> >> Same here. > > At least one of the jumps is expected, because this is around turning > off the CRTC for DPMS off. Don't know yet why there are two jumps back > though. > > >> These things just don't happen on i915 because drm_vblank_off() and >> drm_vblank_on() are always called around the times when the hw >> counter >> might get reset. Or at least that's how it should be. > > Which is of course the idea of Daniel's patch (which is what I'm > getting > the above with) or Mario's patch as well, but clearly something's > still > wrong. It's certainly possible that it's something in the driver, but > since calling drm_vblank_pre/post_modeset from the same places seems > to > work fine (ignoring the regression discussed in this thread)... Do > drm_vblank_on/off require something else to
[Bug 93360] [radeonsi/llvm] Segfault in CS:GO
https://bugs.freedesktop.org/show_bug.cgi?id=93360 --- Comment #7 from Tobias Droste --- Because bug 92944 was magically fixed I just tested again with everything set to high and it looks like this is not crashing anymore. This was with LLVM svn trunk and mesa git from 2 days ago. Though the image looks wrong with everything set to high. The lighting is doesn't seem to be rendered correctly. Sarnex is it working for you? -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/13cdf3c5/attachment.html>
[PATCH 01/15] drm/vblank: Use drm_event_reserve_init
On Mon, Jan 25, 2016 at 10:16:42PM +0100, Daniel Vetter wrote: > Well we can't use that directly since that code must hold > dev->event_lock already. Extract an _unlocked version. > > Embarrassingly I've totally forgotten about this patch and any kind of > event-based vblank wait totally blew up, killing the kernel. > > Cc: Alex Deucher > Cc: Daniel Stone > Cc: Laurent Pinchart > Signed-off-by: Daniel Vetter Forgot cover letter: Just this patch is new, fixes an embarrassing BUG when using any kind of drm_event for vblanks :( Everything else in the patch series is unchanged. Review on this one highly welcome. To make sure I'm not that silly again resending the entire pile, so that our intel CI bot can pick it up again and test it for real. -Daniel > --- > drivers/gpu/drm/drm_fops.c | 64 > +++--- > drivers/gpu/drm/drm_irq.c | 10 +++- > include/drm/drmP.h | 4 +++ > 3 files changed, 56 insertions(+), 22 deletions(-) > > diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c > index e13501e3606e..eb6a02f78697 100644 > --- a/drivers/gpu/drm/drm_fops.c > +++ b/drivers/gpu/drm/drm_fops.c > @@ -678,7 +678,7 @@ unsigned int drm_poll(struct file *filp, struct > poll_table_struct *wait) > EXPORT_SYMBOL(drm_poll); > > /** > - * drm_event_reserve_init - init a DRM event and reserve space for it > + * drm_event_reserve_init_locked - init a DRM event and reserve space for it > * @dev: DRM device > * @file_priv: DRM file private data > * @p: tracking structure for the pending event > @@ -694,24 +694,20 @@ EXPORT_SYMBOL(drm_poll); > * If callers embedded @p into a larger structure it must be allocated with > * kmalloc and @p must be the first member element. > * > + * This is the locked version of drm_event_reserve_init() for callers which > + * already hold dev->event_lock. > + * > * RETURNS: > * > * 0 on success or a negative error code on failure. > */ > -int drm_event_reserve_init(struct drm_device *dev, > -struct drm_file *file_priv, > -struct drm_pending_event *p, > -struct drm_event *e) > +int drm_event_reserve_init_locked(struct drm_device *dev, > + struct drm_file *file_priv, > + struct drm_pending_event *p, > + struct drm_event *e) > { > - unsigned long flags; > - int ret = 0; > - > - spin_lock_irqsave(&dev->event_lock, flags); > - > - if (file_priv->event_space < e->length) { > - ret = -ENOMEM; > - goto out; > - } > + if (file_priv->event_space < e->length) > + return -ENOMEM; > > file_priv->event_space -= e->length; > > @@ -721,8 +717,46 @@ int drm_event_reserve_init(struct drm_device *dev, > /* we *could* pass this in as arg, but everyone uses kfree: */ > p->destroy = (void (*) (struct drm_pending_event *)) kfree; > > -out: > + return 0; > +} > +EXPORT_SYMBOL(drm_event_reserve_init_locked); > + > +/** > + * drm_event_reserve_init - init a DRM event and reserve space for it > + * @dev: DRM device > + * @file_priv: DRM file private data > + * @p: tracking structure for the pending event > + * @e: actual event data to deliver to userspace > + * > + * This function prepares the passed in event for eventual delivery. If the > event > + * doesn't get delivered (because the IOCTL fails later on, before queuing up > + * anything) then the even must be cancelled and freed using > + * drm_event_cancel_free(). Successfully initialized events should be sent > out > + * using drm_send_event() or drm_send_event_locked() to signal completion of > the > + * asynchronous event to userspace. > + * > + * If callers embedded @p into a larger structure it must be allocated with > + * kmalloc and @p must be the first member element. > + * > + * Callers which already hold dev->event_lock should use > + * drm_event_reserve_init() instead. > + * > + * RETURNS: > + * > + * 0 on success or a negative error code on failure. > + */ > +int drm_event_reserve_init(struct drm_device *dev, > +struct drm_file *file_priv, > +struct drm_pending_event *p, > +struct drm_event *e) > +{ > + unsigned long flags; > + int ret; > + > + spin_lock_irqsave(&dev->event_lock, flags); > + ret = drm_event_reserve_init_locked(dev, file_priv, p, e); > spin_unlock_irqrestore(&dev->event_lock, flags); > + > return ret; > } > EXPORT_SYMBOL(drm_event_reserve_init); > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c > index 4ec8bca643ac..aa602199cb5d 100644 > --- a/drivers/gpu/drm/drm_irq.c > +++ b/drivers/gpu/drm/drm_irq.c > @@ -1598,9 +1598,6 @@ static int drm_queue_vblank_event(struct drm_device > *dev, unsigned int pipe, > e->event.base.type = DRM_EVENT_VBLANK; > e->event.base.le
[PATCH 15/15] drm/vmwgfx: Nuke preclose hook
Again since the drm core takes care of event unlinking/disarming this is now just needless code. v2: I've completely missed eaction->fpriv_head and all the related code. We need to nuke that too to avoid accidentally deferencing the freed-up vmwgfx-private fpriv. v3: Also remove vmw_fpriv->fence_events and unused variables I missed. Cc: Thomas Hellström Acked-by: Daniel Stone Reviewed-by: Alex Deucher Reviewed-by: Thomas Hellstrom Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-23-git-send-email-daniel.vetter at ffwll.ch Signed-off-by: Daniel Vetter --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 11 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 52 --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.h | 2 -- 4 files changed, 66 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index c49812b80dd0..c96a2d2d5107 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -971,15 +971,6 @@ static int vmw_driver_unload(struct drm_device *dev) return 0; } -static void vmw_preclose(struct drm_device *dev, -struct drm_file *file_priv) -{ - struct vmw_fpriv *vmw_fp = vmw_fpriv(file_priv); - struct vmw_private *dev_priv = vmw_priv(dev); - - vmw_event_fence_fpriv_gone(dev_priv->fman, &vmw_fp->fence_events); -} - static void vmw_postclose(struct drm_device *dev, struct drm_file *file_priv) { @@ -1010,7 +1001,6 @@ static int vmw_driver_open(struct drm_device *dev, struct drm_file *file_priv) if (unlikely(vmw_fp == NULL)) return ret; - INIT_LIST_HEAD(&vmw_fp->fence_events); vmw_fp->tfile = ttm_object_file_init(dev_priv->tdev, 10); if (unlikely(vmw_fp->tfile == NULL)) goto out_no_tfile; @@ -1500,7 +1490,6 @@ static struct drm_driver driver = { .master_set = vmw_master_set, .master_drop = vmw_master_drop, .open = vmw_driver_open, - .preclose = vmw_preclose, .postclose = vmw_postclose, .set_busid = drm_pci_set_busid, diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 469cdd520615..5cb1b1687cd4 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -80,7 +80,6 @@ struct vmw_fpriv { struct drm_master *locked_master; struct ttm_object_file *tfile; - struct list_head fence_events; bool gb_aware; }; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c index e0edf149d9d5..ac477863fc07 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c @@ -71,7 +71,6 @@ struct vmw_user_fence { */ struct vmw_event_fence_action { struct vmw_fence_action action; - struct list_head fpriv_head; struct drm_pending_event *event; struct vmw_fence_obj *fence; @@ -808,44 +807,6 @@ int vmw_fence_obj_unref_ioctl(struct drm_device *dev, void *data, } /** - * vmw_event_fence_fpriv_gone - Remove references to struct drm_file objects - * - * @fman: Pointer to a struct vmw_fence_manager - * @event_list: Pointer to linked list of struct vmw_event_fence_action objects - * with pointers to a struct drm_file object about to be closed. - * - * This function removes all pending fence events with references to a - * specific struct drm_file object about to be closed. The caller is required - * to pass a list of all struct vmw_event_fence_action objects with such - * events attached. This function is typically called before the - * struct drm_file object's event management is taken down. - */ -void vmw_event_fence_fpriv_gone(struct vmw_fence_manager *fman, - struct list_head *event_list) -{ - struct vmw_event_fence_action *eaction; - struct drm_pending_event *event; - unsigned long irq_flags; - - while (1) { - spin_lock_irqsave(&fman->lock, irq_flags); - if (list_empty(event_list)) - goto out_unlock; - eaction = list_first_entry(event_list, - struct vmw_event_fence_action, - fpriv_head); - list_del_init(&eaction->fpriv_head); - event = eaction->event; - eaction->event = NULL; - spin_unlock_irqrestore(&fman->lock, irq_flags); - event->destroy(event); - } -out_unlock: - spin_unlock_irqrestore(&fman->lock, irq_flags); -} - - -/** * vmw_event_fence_action_seq_passed * * @action: The struct vmw_fence_action embedded in a struct @@ -879,7 +840,6 @@ static void vmw_event_fence_action_seq_passed(struct vmw_fence_action *action) *eaction->tv_usec = tv.tv_usec; } - l
[PATCH 14/15] drm/vc4: Nuke preclose hook
Again since the drm core takes care of event unlinking/disarming this is now just needless code. v2: Fixup misplaced hunk. Cc: Eric Anholt Acked-by: Daniel Stone Reviewed-by: Alex Deucher (v1) Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-22-git-send-email-daniel.vetter at ffwll.ch Acked-by: Eric Anholt Signed-off-by: Daniel Vetter --- drivers/gpu/drm/vc4/vc4_crtc.c | 20 drivers/gpu/drm/vc4/vc4_drv.c | 10 -- drivers/gpu/drm/vc4/vc4_drv.h | 1 - 3 files changed, 31 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 018145e0b87d..937409792b97 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -593,26 +593,6 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { .atomic_flush = vc4_crtc_atomic_flush, }; -/* Frees the page flip event when the DRM device is closed with the - * event still outstanding. - */ -void vc4_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file) -{ - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); - struct drm_device *dev = crtc->dev; - unsigned long flags; - - spin_lock_irqsave(&dev->event_lock, flags); - - if (vc4_crtc->event && vc4_crtc->event->base.file_priv == file) { - vc4_crtc->event->base.destroy(&vc4_crtc->event->base); - drm_crtc_vblank_put(crtc); - vc4_crtc->event = NULL; - } - - spin_unlock_irqrestore(&dev->event_lock, flags); -} - static const struct vc4_crtc_data pv0_data = { .hvs_channel = 0, .encoder0_type = VC4_ENCODER_TYPE_DSI0, diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index f1655fff8425..b7d2ff0e6e1f 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -43,14 +43,6 @@ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index) return map; } -static void vc4_drm_preclose(struct drm_device *dev, struct drm_file *file) -{ - struct drm_crtc *crtc; - - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) - vc4_cancel_page_flip(crtc, file); -} - static void vc4_lastclose(struct drm_device *dev) { struct vc4_dev *vc4 = to_vc4_dev(dev); @@ -91,8 +83,6 @@ static struct drm_driver vc4_drm_driver = { DRIVER_HAVE_IRQ | DRIVER_PRIME), .lastclose = vc4_lastclose, - .preclose = vc4_drm_preclose, - .irq_handler = vc4_irq, .irq_preinstall = vc4_irq_preinstall, .irq_postinstall = vc4_irq_postinstall, diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 080865ec2bae..4c734d087d7f 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -376,7 +376,6 @@ int vc4_bo_stats_debugfs(struct seq_file *m, void *arg); extern struct platform_driver vc4_crtc_driver; int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id); void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id); -void vc4_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file); int vc4_crtc_debugfs_regs(struct seq_file *m, void *arg); /* vc4_debugfs.c */ -- 2.7.0.rc3
[PATCH 13/15] drm/tilcdc: Nuke preclose hook
Again since the drm core takes care of event unlinking/disarming this is now just needless code. v2: Fixup misplaced hunks. Cc: Rob Clark Acked-by: Daniel Stone Reviewed-by: Alex Deucher (v1) Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-21-git-send-email-daniel.vetter at ffwll.ch Signed-off-by: Daniel Vetter --- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 20 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 8 drivers/gpu/drm/tilcdc/tilcdc_drv.h | 1 - 3 files changed, 29 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index 7d07733bdc86..4802da8e6d6f 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -662,26 +662,6 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) return IRQ_HANDLED; } -void tilcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file) -{ - struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_pending_vblank_event *event; - struct drm_device *dev = crtc->dev; - unsigned long flags; - - /* Destroy the pending vertical blanking event associated with the -* pending page flip, if any, and disable vertical blanking interrupts. -*/ - spin_lock_irqsave(&dev->event_lock, flags); - event = tilcdc_crtc->event; - if (event && event->base.file_priv == file) { - tilcdc_crtc->event = NULL; - event->base.destroy(&event->base); - drm_vblank_put(dev, 0); - } - spin_unlock_irqrestore(&dev->event_lock, flags); -} - struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev) { struct tilcdc_crtc *tilcdc_crtc; diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index d7f5b897c6c5..8190ac3b1b32 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -350,13 +350,6 @@ fail_free_priv: return ret; } -static void tilcdc_preclose(struct drm_device *dev, struct drm_file *file) -{ - struct tilcdc_drm_private *priv = dev->dev_private; - - tilcdc_crtc_cancel_page_flip(priv->crtc, file); -} - static void tilcdc_lastclose(struct drm_device *dev) { struct tilcdc_drm_private *priv = dev->dev_private; @@ -557,7 +550,6 @@ static struct drm_driver tilcdc_driver = { .driver_features= DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET, .load = tilcdc_load, .unload = tilcdc_unload, - .preclose = tilcdc_preclose, .lastclose = tilcdc_lastclose, .set_busid = drm_platform_set_busid, .irq_handler= tilcdc_irq, diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h index e863ad0d26fe..66105d8dc620 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h @@ -163,7 +163,6 @@ struct tilcdc_panel_info { #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev); -void tilcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file); irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc); void tilcdc_crtc_update_clk(struct drm_crtc *crtc); void tilcdc_crtc_set_panel_info(struct drm_crtc *crtc, -- 2.7.0.rc3
[PATCH 12/15] drm/tegra: Stop cancelling page flip events
The core takes care of that now. v2: Fixup misplaced hunk. Cc: Thierry Reding Cc: Terje Bergström Acked-by: Daniel Stone Reviewed-by: Alex Deucher Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-20-git-send-email-daniel.vetter at ffwll.ch Acked-by: Thierry Reding Signed-off-by: Daniel Vetter --- drivers/gpu/drm/tegra/dc.c | 17 - drivers/gpu/drm/tegra/drm.c | 3 --- drivers/gpu/drm/tegra/drm.h | 1 - 3 files changed, 21 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index dde6f208c347..fb2b4b0271a2 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -988,23 +988,6 @@ static void tegra_dc_finish_page_flip(struct tegra_dc *dc) spin_unlock_irqrestore(&drm->event_lock, flags); } -void tegra_dc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file) -{ - struct tegra_dc *dc = to_tegra_dc(crtc); - struct drm_device *drm = crtc->dev; - unsigned long flags; - - spin_lock_irqsave(&drm->event_lock, flags); - - if (dc->event && dc->event->base.file_priv == file) { - dc->event->base.destroy(&dc->event->base); - drm_crtc_vblank_put(crtc); - dc->event = NULL; - } - - spin_unlock_irqrestore(&drm->event_lock, flags); -} - static void tegra_dc_destroy(struct drm_crtc *crtc) { drm_crtc_cleanup(crtc); diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index c5c856a0879d..021d0e1398fb 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -860,9 +860,6 @@ static void tegra_drm_preclose(struct drm_device *drm, struct drm_file *file) struct tegra_drm_context *context, *tmp; struct drm_crtc *crtc; - list_for_each_entry(crtc, &drm->mode_config.crtc_list, head) - tegra_dc_cancel_page_flip(crtc, file); - list_for_each_entry_safe(context, tmp, &fpriv->contexts, list) tegra_drm_context_free(context); diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h index c088f2f67eda..8a10f5b7d9dc 100644 --- a/drivers/gpu/drm/tegra/drm.h +++ b/drivers/gpu/drm/tegra/drm.h @@ -195,7 +195,6 @@ struct tegra_dc_window { u32 tegra_dc_get_vblank_counter(struct tegra_dc *dc); void tegra_dc_enable_vblank(struct tegra_dc *dc); void tegra_dc_disable_vblank(struct tegra_dc *dc); -void tegra_dc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file); void tegra_dc_commit(struct tegra_dc *dc); int tegra_dc_state_setup_clock(struct tegra_dc *dc, struct drm_crtc_state *crtc_state, -- 2.7.0.rc3
[PATCH 11/15] drm/shmob: Nuke preclose hook
Again since the drm core takes care of event unlinking/disarming this is now just needless code. v2: Fixup misplaced hunk. Cc: Laurent Pinchart Acked-by: Daniel Stone Reviewed-by: Alex Deucher (v1) Reviewed-by: Laurent Pinchart Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-19-git-send-email-daniel.vetter at ffwll.ch Signed-off-by: Daniel Vetter --- drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 20 drivers/gpu/drm/shmobile/shmob_drm_crtc.h | 2 -- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 8 3 files changed, 30 deletions(-) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c index db0763794edc..27342fd76e90 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c @@ -438,26 +438,6 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { .mode_set_base = shmob_drm_crtc_mode_set_base, }; -void shmob_drm_crtc_cancel_page_flip(struct shmob_drm_crtc *scrtc, -struct drm_file *file) -{ - struct drm_pending_vblank_event *event; - struct drm_device *dev = scrtc->crtc.dev; - unsigned long flags; - - /* Destroy the pending vertical blanking event associated with the -* pending page flip, if any, and disable vertical blanking interrupts. -*/ - spin_lock_irqsave(&dev->event_lock, flags); - event = scrtc->event; - if (event && event->base.file_priv == file) { - scrtc->event = NULL; - event->base.destroy(&event->base); - drm_vblank_put(dev, 0); - } - spin_unlock_irqrestore(&dev->event_lock, flags); -} - void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) { struct drm_pending_vblank_event *event; diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.h b/drivers/gpu/drm/shmobile/shmob_drm_crtc.h index eddad6dcc88a..38ed4ff8aaf2 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.h +++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.h @@ -47,8 +47,6 @@ struct shmob_drm_connector { int shmob_drm_crtc_create(struct shmob_drm_device *sdev); void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev, bool enable); -void shmob_drm_crtc_cancel_page_flip(struct shmob_drm_crtc *scrtc, -struct drm_file *file); void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc); void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc); void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc); diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index 04e66e3751b4..7700ff172079 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c @@ -200,13 +200,6 @@ done: return ret; } -static void shmob_drm_preclose(struct drm_device *dev, struct drm_file *file) -{ - struct shmob_drm_device *sdev = dev->dev_private; - - shmob_drm_crtc_cancel_page_flip(&sdev->crtc, file); -} - static irqreturn_t shmob_drm_irq(int irq, void *arg) { struct drm_device *dev = arg; @@ -266,7 +259,6 @@ static struct drm_driver shmob_drm_driver = { | DRIVER_PRIME, .load = shmob_drm_load, .unload = shmob_drm_unload, - .preclose = shmob_drm_preclose, .set_busid = drm_platform_set_busid, .irq_handler= shmob_drm_irq, .get_vblank_counter = drm_vblank_no_hw_counter, -- 2.7.0.rc3
[PATCH 10/15] drm/rcar: Nuke preclose hook
Again since the drm core takes care of event unlinking/disarming this is now just needless code. Cc: Laurent Pinchart Acked-by: Daniel Stone Reviewed-by: Alex Deucher Reviewed-by: Laurent Pinchart Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-18-git-send-email-daniel.vetter at ffwll.ch Signed-off-by: Daniel Vetter --- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 20 drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 2 -- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 10 -- 3 files changed, 32 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 88a4b706be16..4ec80ae1fa99 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -282,26 +282,6 @@ static void rcar_du_crtc_update_planes(struct rcar_du_crtc *rcrtc) * Page Flip */ -void rcar_du_crtc_cancel_page_flip(struct rcar_du_crtc *rcrtc, - struct drm_file *file) -{ - struct drm_pending_vblank_event *event; - struct drm_device *dev = rcrtc->crtc.dev; - unsigned long flags; - - /* Destroy the pending vertical blanking event associated with the -* pending page flip, if any, and disable vertical blanking interrupts. -*/ - spin_lock_irqsave(&dev->event_lock, flags); - event = rcrtc->event; - if (event && event->base.file_priv == file) { - rcrtc->event = NULL; - event->base.destroy(&event->base); - drm_crtc_vblank_put(&rcrtc->crtc); - } - spin_unlock_irqrestore(&dev->event_lock, flags); -} - static void rcar_du_crtc_finish_page_flip(struct rcar_du_crtc *rcrtc) { struct drm_pending_vblank_event *event; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h index 4b95d9d08c49..2bbe3f5aab65 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h @@ -67,8 +67,6 @@ enum rcar_du_output { int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index); void rcar_du_crtc_enable_vblank(struct rcar_du_crtc *rcrtc, bool enable); -void rcar_du_crtc_cancel_page_flip(struct rcar_du_crtc *rcrtc, - struct drm_file *file); void rcar_du_crtc_suspend(struct rcar_du_crtc *rcrtc); void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc); diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 40422f6b645e..0bb2b31555bf 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -220,15 +220,6 @@ done: return ret; } -static void rcar_du_preclose(struct drm_device *dev, struct drm_file *file) -{ - struct rcar_du_device *rcdu = dev->dev_private; - unsigned int i; - - for (i = 0; i < rcdu->num_crtcs; ++i) - rcar_du_crtc_cancel_page_flip(&rcdu->crtcs[i], file); -} - static void rcar_du_lastclose(struct drm_device *dev) { struct rcar_du_device *rcdu = dev->dev_private; @@ -271,7 +262,6 @@ static struct drm_driver rcar_du_driver = { | DRIVER_ATOMIC, .load = rcar_du_load, .unload = rcar_du_unload, - .preclose = rcar_du_preclose, .lastclose = rcar_du_lastclose, .set_busid = drm_platform_set_busid, .get_vblank_counter = drm_vblank_no_hw_counter, -- 2.7.0.rc3
[PATCH 09/15] drm/omap: Nuke close hooks
Again since the core takes care of this we can remove them. While at it also remove the postclose hook, it's empty. v2: Laurent pointed me at even more code to delete. v3: Remove unused flags (Tomi). Cc: Laurent Pinchart Cc: Tomi Valkeinen Acked-by: Daniel Stone Reviewed-by: Alex Deucher Link: http://patchwork.freedesktop.org/patch/msgid/1452683114-25043-1-git-send-email-daniel.vetter at ffwll.ch Reviewed-by: Laurent Pinchart Acked-by: Tomi Valkeinen Signed-off-by: Daniel Vetter --- drivers/gpu/drm/omapdrm/omap_crtc.c | 13 +--- drivers/gpu/drm/omapdrm/omap_drv.c | 42 - drivers/gpu/drm/omapdrm/omap_drv.h | 1 - 3 files changed, 1 insertion(+), 55 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 2ed0754ed19e..d38fcbcc43a8 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -269,18 +269,7 @@ static void omap_crtc_complete_page_flip(struct drm_crtc *crtc) return; spin_lock_irqsave(&dev->event_lock, flags); - - list_del(&event->base.link); - - /* -* Queue the event for delivery if it's still linked to a file -* handle, otherwise just destroy it. -*/ - if (event->base.file_priv) - drm_crtc_send_vblank_event(crtc, event); - else - event->base.destroy(&event->base); - + drm_crtc_send_vblank_event(crtc, event); spin_unlock_irqrestore(&dev->event_lock, flags); } diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index dfafdb602ad2..33370f42e4d7 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -142,7 +142,6 @@ static int omap_atomic_commit(struct drm_device *dev, { struct omap_drm_private *priv = dev->dev_private; struct omap_atomic_state_commit *commit; - unsigned long flags; unsigned int i; int ret; @@ -175,17 +174,6 @@ static int omap_atomic_commit(struct drm_device *dev, priv->commit.pending |= commit->crtcs; spin_unlock(&priv->commit.lock); - /* Keep track of all CRTC events to unlink them in preclose(). */ - spin_lock_irqsave(&dev->event_lock, flags); - for (i = 0; i < dev->mode_config.num_crtc; ++i) { - struct drm_crtc_state *cstate = state->crtc_states[i]; - - if (cstate && cstate->event) - list_add_tail(&cstate->event->base.link, - &priv->commit.events); - } - spin_unlock_irqrestore(&dev->event_lock, flags); - /* Swap the state, this is the point of no return. */ drm_atomic_helper_swap_state(dev, state); @@ -673,7 +661,6 @@ static int dev_load(struct drm_device *dev, unsigned long flags) priv->wq = alloc_ordered_workqueue("omapdrm", 0); init_waitqueue_head(&priv->commit.wait); spin_lock_init(&priv->commit.lock); - INIT_LIST_HEAD(&priv->commit.events); spin_lock_init(&priv->list_lock); INIT_LIST_HEAD(&priv->obj_list); @@ -787,33 +774,6 @@ static void dev_lastclose(struct drm_device *dev) } } -static void dev_preclose(struct drm_device *dev, struct drm_file *file) -{ - struct omap_drm_private *priv = dev->dev_private; - struct drm_pending_event *event; - unsigned long flags; - - DBG("preclose: dev=%p", dev); - - /* -* Unlink all pending CRTC events to make sure they won't be queued up -* by a pending asynchronous commit. -*/ - spin_lock_irqsave(&dev->event_lock, flags); - list_for_each_entry(event, &priv->commit.events, link) { - if (event->file_priv == file) { - file->event_space += event->event->length; - event->file_priv = NULL; - } - } - spin_unlock_irqrestore(&dev->event_lock, flags); -} - -static void dev_postclose(struct drm_device *dev, struct drm_file *file) -{ - DBG("postclose: dev=%p, file=%p", dev, file); -} - static const struct vm_operations_struct omap_gem_vm_ops = { .fault = omap_gem_fault, .open = drm_gem_vm_open, @@ -838,8 +798,6 @@ static struct drm_driver omap_drm_driver = { .unload = dev_unload, .open = dev_open, .lastclose = dev_lastclose, - .preclose = dev_preclose, - .postclose = dev_postclose, .set_busid = drm_platform_set_busid, .get_vblank_counter = drm_vblank_no_hw_counter, .enable_vblank = omap_irq_enable_vblank, diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h index 9e0030731c37..c23cbe6fe9e4 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h @@ -106,7 +106,6 @@ struct omap_drm_private { /* atomic commit */ struct { - struct list_head events;
[PATCH 08/15] drm/msm: Nuke preclose hooks
They only complete the page flip events to avoid oops when the drm file closes. The core takes care of that now and we can remove this code. Cc: Rob Clark Acked-by: Daniel Stone Reviewed-by: Alex Deucher Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-16-git-send-email-daniel.vetter at ffwll.ch Signed-off-by: Daniel Vetter --- drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 7 --- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 11 --- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h | 1 - drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 6 -- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 11 --- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h | 1 - 6 files changed, 37 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c index 28df397c3b04..909d74250de7 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c @@ -575,13 +575,6 @@ uint32_t mdp4_crtc_vblank(struct drm_crtc *crtc) return mdp4_crtc->vblank.irqmask; } -void mdp4_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file) -{ - struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); - DBG("%s: cancel: %p", mdp4_crtc->name, file); - complete_flip(crtc, file); -} - /* set dma config, ie. the format the encoder wants. */ void mdp4_crtc_set_config(struct drm_crtc *crtc, uint32_t config) { diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c index 5a8e3d6bcbff..1c8e330f8d98 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c @@ -179,16 +179,6 @@ static long mdp4_round_pixclk(struct msm_kms *kms, unsigned long rate, } } -static void mdp4_preclose(struct msm_kms *kms, struct drm_file *file) -{ - struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms)); - struct msm_drm_private *priv = mdp4_kms->dev->dev_private; - unsigned i; - - for (i = 0; i < priv->num_crtcs; i++) - mdp4_crtc_cancel_pending_flip(priv->crtcs[i], file); -} - static void mdp4_destroy(struct msm_kms *kms) { struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms)); @@ -213,7 +203,6 @@ static const struct mdp_kms_funcs kms_funcs = { .wait_for_crtc_commit_done = mdp4_wait_for_crtc_commit_done, .get_format = mdp_get_format, .round_pixclk= mdp4_round_pixclk, - .preclose= mdp4_preclose, .destroy = mdp4_destroy, }, .set_irqmask = mdp4_set_irqmask, diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h index d2c96ef431f4..9ec53b464662 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h @@ -199,7 +199,6 @@ struct drm_plane *mdp4_plane_init(struct drm_device *dev, enum mdp4_pipe pipe_id, bool private_plane); uint32_t mdp4_crtc_vblank(struct drm_crtc *crtc); -void mdp4_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file); void mdp4_crtc_set_config(struct drm_crtc *crtc, uint32_t config); void mdp4_crtc_set_intf(struct drm_crtc *crtc, enum mdp4_intf intf, int mixer); void mdp4_crtc_wait_for_commit_done(struct drm_crtc *crtc); diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c index 20cee5ce4071..46682aa8870c 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c @@ -721,12 +721,6 @@ uint32_t mdp5_crtc_vblank(struct drm_crtc *crtc) return mdp5_crtc->vblank.irqmask; } -void mdp5_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file) -{ - DBG("cancel: %p", file); - complete_flip(crtc, file); -} - void mdp5_crtc_set_pipeline(struct drm_crtc *crtc, struct mdp5_interface *intf, struct mdp5_ctl *ctl) { diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c index e115318402bd..5e4d16b399c7 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c @@ -117,16 +117,6 @@ static int mdp5_set_split_display(struct msm_kms *kms, return mdp5_encoder_set_split_display(encoder, slave_encoder); } -static void mdp5_preclose(struct msm_kms *kms, struct drm_file *file) -{ - struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms)); - struct msm_drm_private *priv = mdp5_kms->dev->dev_private; - unsigned i; - - for (i = 0; i < priv->num_crtcs; i++) - mdp5_crtc_cancel_pending_flip(priv->crtcs[i], file); -} - static void mdp5_destroy(struct msm_kms *kms) { struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms)); @@ -164,7 +154,6 @@ static const struct mdp_kms_funcs kms_funcs = { .get_format = mdp_get_format, .round_pixclk= mdp5_round_pi
[PATCH 07/15] drm/imx: Unconfuse preclose logic
So this one is special, since it tries to prevent races when userspace crashes simply by disabling the vblank machinery. Well except that imx always has vblanks enabled, and the disable_vblank hook actually just tries to cancel a pending pageflip. Without any locking whatsoever. Of course this is wrong, since it'll result in the hw not actually displaying what drm thinks is the current frontbuffer. Well since the core takes care of the disappearing DRM fd now. So we can nuke all this confused code without ill side-effects. Someone else needs to audit the locking for ->newfb and ->page_flip_event and fix it up. Common approach is to reuse dev->event_lock for this. Cc: Sascha Hauer Cc: Philipp Zabel Acked-by: Daniel Stone Reviewed-by: Alex Deucher Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-15-git-send-email-daniel.vetter at ffwll.ch Acked-by: Philipp Zabel Signed-off-by: Daniel Vetter --- drivers/gpu/drm/imx/imx-drm-core.c | 13 - drivers/gpu/drm/imx/ipuv3-crtc.c | 4 2 files changed, 17 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 2f57d7967417..7c4d1250e071 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -171,18 +171,6 @@ static void imx_drm_disable_vblank(struct drm_device *drm, unsigned int pipe) imx_drm_crtc->imx_drm_helper_funcs.disable_vblank(imx_drm_crtc->crtc); } -static void imx_drm_driver_preclose(struct drm_device *drm, - struct drm_file *file) -{ - int i; - - if (!file->is_master) - return; - - for (i = 0; i < MAX_CRTC; i++) - imx_drm_disable_vblank(drm, i); -} - static const struct file_operations imx_drm_driver_fops = { .owner = THIS_MODULE, .open = drm_open, @@ -463,7 +451,6 @@ static struct drm_driver imx_drm_driver = { .load = imx_drm_driver_load, .unload = imx_drm_driver_unload, .lastclose = imx_drm_driver_lastclose, - .preclose = imx_drm_driver_preclose, .set_busid = drm_platform_set_busid, .gem_free_object= drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 30a57185bdb4..846b5f558897 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -285,10 +285,6 @@ static int ipu_enable_vblank(struct drm_crtc *crtc) static void ipu_disable_vblank(struct drm_crtc *crtc) { - struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); - - ipu_crtc->page_flip_event = NULL; - ipu_crtc->newfb = NULL; } static int ipu_set_interface_pix_fmt(struct drm_crtc *crtc, -- 2.7.0.rc3
[PATCH 06/15] drm/exynos: Remove event cancelling from postclose
The core takes care of this now. And since kfree(NULL) is ok we can simplify the function even further now. Note: There's another spin on this patch, but for different reasons, in-flight already: http://www.spinics.net/lists/dri-devel/msg97922.html Cc: Inki Dae Acked-by: Daniel Stone Reviewed-by: Alex Deucher Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-14-git-send-email-daniel.vetter at ffwll.ch Acked-by: Inki Dae Signed-off-by: Daniel Vetter --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 68f0f36f6e7e..1e535f981240 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -340,20 +340,6 @@ static void exynos_drm_preclose(struct drm_device *dev, static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file) { - struct drm_pending_event *e, *et; - unsigned long flags; - - if (!file->driver_priv) - return; - - spin_lock_irqsave(&dev->event_lock, flags); - /* Release all events handled by page flip handler but not freed. */ - list_for_each_entry_safe(e, et, &file->event_list, link) { - list_del(&e->link); - e->destroy(e); - } - spin_unlock_irqrestore(&dev->event_lock, flags); - kfree(file->driver_priv); file->driver_priv = NULL; } -- 2.7.0.rc3
[PATCH 05/15] drm/atmel: Nuke preclose
The only thing this did was cancle pending flip events, and the core takes care of that now. Cc: Boris Brezillon Acked-by: Daniel Stone Reviewed-by: Alex Deucher Acked-by: Boris Brezillon Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-13-git-send-email-daniel.vetter at ffwll.ch Signed-off-by: Daniel Vetter --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 18 -- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 10 -- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 3 --- 3 files changed, 31 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 468a14f266a7..9863291a9a54 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -280,24 +280,6 @@ static void atmel_hlcdc_crtc_destroy(struct drm_crtc *c) kfree(crtc); } -void atmel_hlcdc_crtc_cancel_page_flip(struct drm_crtc *c, - struct drm_file *file) -{ - struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); - struct drm_pending_vblank_event *event; - struct drm_device *dev = c->dev; - unsigned long flags; - - spin_lock_irqsave(&dev->event_lock, flags); - event = crtc->event; - if (event && event->base.file_priv == file) { - event->base.destroy(&event->base); - drm_vblank_put(dev, crtc->id); - crtc->event = NULL; - } - spin_unlock_irqrestore(&dev->event_lock, flags); -} - static void atmel_hlcdc_crtc_finish_page_flip(struct atmel_hlcdc_crtc *crtc) { struct drm_device *dev = crtc->base.dev; diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index a45b32ba029e..3d8d16402d07 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -619,15 +619,6 @@ static void atmel_hlcdc_dc_connector_unplug_all(struct drm_device *dev) mutex_unlock(&dev->mode_config.mutex); } -static void atmel_hlcdc_dc_preclose(struct drm_device *dev, - struct drm_file *file) -{ - struct drm_crtc *crtc; - - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) - atmel_hlcdc_crtc_cancel_page_flip(crtc, file); -} - static void atmel_hlcdc_dc_lastclose(struct drm_device *dev) { struct atmel_hlcdc_dc *dc = dev->dev_private; @@ -698,7 +689,6 @@ static struct drm_driver atmel_hlcdc_dc_driver = { .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC, - .preclose = atmel_hlcdc_dc_preclose, .lastclose = atmel_hlcdc_dc_lastclose, .irq_handler = atmel_hlcdc_dc_irq_handler, .irq_preinstall = atmel_hlcdc_dc_irq_uninstall, diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h index cf6b375bc38d..fed517f297da 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h @@ -152,9 +152,6 @@ int atmel_hlcdc_plane_prepare_disc_area(struct drm_crtc_state *c_state); void atmel_hlcdc_crtc_irq(struct drm_crtc *c); -void atmel_hlcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, - struct drm_file *file); - void atmel_hlcdc_crtc_suspend(struct drm_crtc *crtc); void atmel_hlcdc_crtc_resume(struct drm_crtc *crtc); -- 2.7.0.rc3
[PATCH 04/15] drm/i915: Nuke intel_modeset_preclose
Now that the drm core unlinks/disarms events there's no need to do so ourselves anymore. Nuke the code. Acked-by: Daniel Stone Reviewed-by: Alex Deucher Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-12-git-send-email-daniel.vetter at ffwll.ch Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_dma.c | 2 -- drivers/gpu/drm/i915/intel_display.c | 21 - drivers/gpu/drm/i915/intel_drv.h | 1 - 3 files changed, 24 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index d70d96fe553b..1c3d2544fec4 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1261,8 +1261,6 @@ void i915_driver_preclose(struct drm_device *dev, struct drm_file *file) i915_gem_context_close(dev, file); i915_gem_release(dev, file); mutex_unlock(&dev->struct_mutex); - - intel_modeset_preclose(dev, file); } void i915_driver_postclose(struct drm_device *dev, struct drm_file *file) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 8104511ad302..7a5ed95f2cd9 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -16310,24 +16310,3 @@ intel_display_print_error_state(struct drm_i915_error_state_buf *m, err_printf(m, " VSYNC: %08x\n", error->transcoder[i].vsync); } } - -void intel_modeset_preclose(struct drm_device *dev, struct drm_file *file) -{ - struct intel_crtc *crtc; - - for_each_intel_crtc(dev, crtc) { - struct intel_unpin_work *work; - - spin_lock_irq(&dev->event_lock); - - work = crtc->unpin_work; - - if (work && work->event && - work->event->base.file_priv == file) { - kfree(work->event); - work->event = NULL; - } - - spin_unlock_irq(&dev->event_lock); - } -} diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index bc970125ec76..bf6f98134b50 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -1212,7 +1212,6 @@ enum intel_display_power_domain intel_display_port_aux_power_domain(struct intel_encoder *intel_encoder); void intel_mode_from_pipe_config(struct drm_display_mode *mode, struct intel_crtc_state *pipe_config); -void intel_modeset_preclose(struct drm_device *dev, struct drm_file *file); int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state); int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state); -- 2.7.0.rc3
[PATCH 03/15] drm: Nuke vblank event file cleanup code
The core code now takes care of unlinking drm_events from the file in a generic way, so this code isn't needed any more. For those wondering where the drm_vblank_put went to: With the new logic events only get unlinked, but still exist. Hence any resources (like vblank counters) don't need to be released since the event user will still process the event normally. In this case this is the callsites of send_vblank_event, which of course already have a drm_vblank_put. Cc: Laurent Pinchart Acked-by: Daniel Stone Reviewed-by: Alex Deucher Reviewed-by: Laurent Pinchart Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-11-git-send-email-daniel.vetter at ffwll.ch Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_fops.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index afe8c53e5aad..aeef58ed359b 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -354,19 +354,10 @@ static void drm_events_release(struct drm_file *file_priv) { struct drm_device *dev = file_priv->minor->dev; struct drm_pending_event *e, *et; - struct drm_pending_vblank_event *v, *vt; unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); - /* Remove pending flips */ - list_for_each_entry_safe(v, vt, &dev->vblank_event_list, base.link) - if (v->base.file_priv == file_priv) { - list_del(&v->base.link); - drm_vblank_put(dev, v->pipe); - v->base.destroy(&v->base); - } - /* Unlink pending events */ list_for_each_entry_safe(e, et, &file_priv->pending_event_list, pending_link) { -- 2.7.0.rc3
[PATCH 02/15] drm: Clean up pending events in the core
There's really no reason to not do so, instead of replicating this for every use-case and every driver. Now we can't just nuke the events, since that would still mean that all drm_event users would need to know when that has happened, since calling e.g. drm_send_event isn't allowed any more. Instead just unlink them from the file, and detect this case and handle it appropriately in all functions. v2: Adjust existing kerneldoc too. v3: Improve wording of the kerneldoc and split out vblank cleanup (Laurent). Cc: Alex Deucher Cc: Laurent Pinchart Acked-by: Daniel Stone Reviewed-by: Alex Deucher (v1) Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-10-git-send-email-daniel.vetter at ffwll.ch Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_fops.c | 30 +- include/drm/drmP.h | 2 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index eb6a02f78697..afe8c53e5aad 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -264,6 +264,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) INIT_LIST_HEAD(&priv->fbs); mutex_init(&priv->fbs_lock); INIT_LIST_HEAD(&priv->blobs); + INIT_LIST_HEAD(&priv->pending_event_list); INIT_LIST_HEAD(&priv->event_list); init_waitqueue_head(&priv->event_wait); priv->event_space = 4096; /* set aside 4k for event buffer */ @@ -366,6 +367,13 @@ static void drm_events_release(struct drm_file *file_priv) v->base.destroy(&v->base); } + /* Unlink pending events */ + list_for_each_entry_safe(e, et, &file_priv->pending_event_list, +pending_link) { + list_del(&e->pending_link); + e->file_priv = NULL; + } + /* Remove unconsumed events */ list_for_each_entry_safe(e, et, &file_priv->event_list, link) { list_del(&e->link); @@ -712,6 +720,7 @@ int drm_event_reserve_init_locked(struct drm_device *dev, file_priv->event_space -= e->length; p->event = e; + list_add(&p->pending_link, &file_priv->pending_event_list); p->file_priv = file_priv; /* we *could* pass this in as arg, but everyone uses kfree: */ @@ -774,7 +783,10 @@ void drm_event_cancel_free(struct drm_device *dev, { unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); - p->file_priv->event_space += p->event->length; + if (p->file_priv) { + p->file_priv->event_space += p->event->length; + list_del(&p->pending_link); + } spin_unlock_irqrestore(&dev->event_lock, flags); p->destroy(p); } @@ -788,11 +800,22 @@ EXPORT_SYMBOL(drm_event_cancel_free); * This function sends the event @e, initialized with drm_event_reserve_init(), * to its associated userspace DRM file. Callers must already hold * dev->event_lock, see drm_send_event() for the unlocked version. + * + * Note that the core will take care of unlinking and disarming events when the + * corresponding DRM file is closed. Drivers need not worry about whether the + * DRM file for this event still exists and can call this function upon + * completion of the asynchronous work unconditionally. */ void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e) { assert_spin_locked(&dev->event_lock); + if (!e->file_priv) { + e->destroy(e); + return; + } + + list_del(&e->pending_link); list_add_tail(&e->link, &e->file_priv->event_list); wake_up_interruptible(&e->file_priv->event_wait); @@ -807,6 +830,11 @@ EXPORT_SYMBOL(drm_send_event_locked); * This function sends the event @e, initialized with drm_event_reserve_init(), * to its associated userspace DRM file. This function acquires dev->event_lock, * see drm_send_event_locked() for callers which already hold this lock. + * + * Note that the core will take care of unlinking and disarming events when the + * corresponding DRM file is closed. Drivers need not worry about whether the + * DRM file for this event still exists and can call this function upon + * completion of the asynchronous work unconditionally. */ void drm_send_event(struct drm_device *dev, struct drm_pending_event *e) { diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 1b71852d0a55..3c8422c69572 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -283,6 +283,7 @@ struct drm_ioctl_desc { struct drm_pending_event { struct drm_event *event; struct list_head link; + struct list_head pending_link; struct drm_file *file_priv; pid_t pid; /* pid of requester, no guarantee it's valid by the time we deliver the event, for tracing only */ @@ -346,6 +347,7
[PATCH 01/15] drm/vblank: Use drm_event_reserve_init
Well we can't use that directly since that code must hold dev->event_lock already. Extract an _unlocked version. Embarrassingly I've totally forgotten about this patch and any kind of event-based vblank wait totally blew up, killing the kernel. Cc: Alex Deucher Cc: Daniel Stone Cc: Laurent Pinchart Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_fops.c | 64 +++--- drivers/gpu/drm/drm_irq.c | 10 +++- include/drm/drmP.h | 4 +++ 3 files changed, 56 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index e13501e3606e..eb6a02f78697 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -678,7 +678,7 @@ unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait) EXPORT_SYMBOL(drm_poll); /** - * drm_event_reserve_init - init a DRM event and reserve space for it + * drm_event_reserve_init_locked - init a DRM event and reserve space for it * @dev: DRM device * @file_priv: DRM file private data * @p: tracking structure for the pending event @@ -694,24 +694,20 @@ EXPORT_SYMBOL(drm_poll); * If callers embedded @p into a larger structure it must be allocated with * kmalloc and @p must be the first member element. * + * This is the locked version of drm_event_reserve_init() for callers which + * already hold dev->event_lock. + * * RETURNS: * * 0 on success or a negative error code on failure. */ -int drm_event_reserve_init(struct drm_device *dev, - struct drm_file *file_priv, - struct drm_pending_event *p, - struct drm_event *e) +int drm_event_reserve_init_locked(struct drm_device *dev, + struct drm_file *file_priv, + struct drm_pending_event *p, + struct drm_event *e) { - unsigned long flags; - int ret = 0; - - spin_lock_irqsave(&dev->event_lock, flags); - - if (file_priv->event_space < e->length) { - ret = -ENOMEM; - goto out; - } + if (file_priv->event_space < e->length) + return -ENOMEM; file_priv->event_space -= e->length; @@ -721,8 +717,46 @@ int drm_event_reserve_init(struct drm_device *dev, /* we *could* pass this in as arg, but everyone uses kfree: */ p->destroy = (void (*) (struct drm_pending_event *)) kfree; -out: + return 0; +} +EXPORT_SYMBOL(drm_event_reserve_init_locked); + +/** + * drm_event_reserve_init - init a DRM event and reserve space for it + * @dev: DRM device + * @file_priv: DRM file private data + * @p: tracking structure for the pending event + * @e: actual event data to deliver to userspace + * + * This function prepares the passed in event for eventual delivery. If the event + * doesn't get delivered (because the IOCTL fails later on, before queuing up + * anything) then the even must be cancelled and freed using + * drm_event_cancel_free(). Successfully initialized events should be sent out + * using drm_send_event() or drm_send_event_locked() to signal completion of the + * asynchronous event to userspace. + * + * If callers embedded @p into a larger structure it must be allocated with + * kmalloc and @p must be the first member element. + * + * Callers which already hold dev->event_lock should use + * drm_event_reserve_init() instead. + * + * RETURNS: + * + * 0 on success or a negative error code on failure. + */ +int drm_event_reserve_init(struct drm_device *dev, + struct drm_file *file_priv, + struct drm_pending_event *p, + struct drm_event *e) +{ + unsigned long flags; + int ret; + + spin_lock_irqsave(&dev->event_lock, flags); + ret = drm_event_reserve_init_locked(dev, file_priv, p, e); spin_unlock_irqrestore(&dev->event_lock, flags); + return ret; } EXPORT_SYMBOL(drm_event_reserve_init); diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 4ec8bca643ac..aa602199cb5d 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -1598,9 +1598,6 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe, e->event.base.type = DRM_EVENT_VBLANK; e->event.base.length = sizeof(e->event); e->event.user_data = vblwait->request.signal; - e->base.event = &e->event.base; - e->base.file_priv = file_priv; - e->base.destroy = (void (*) (struct drm_pending_event *)) kfree; spin_lock_irqsave(&dev->event_lock, flags); @@ -1616,12 +1613,11 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe, goto err_unlock; } - if (file_priv->event_space < sizeof(e->event)) { - ret = -EBUSY; + ret = drm_event_reserve_init_locked(dev, file_priv, &e->base, &e->event); + +
[Bug 91880] Radeonsi on Grenada cards (r9 390) exceptionally unstable and poorly performing
https://bugs.freedesktop.org/show_bug.cgi?id=91880 --- Comment #75 from Ioannis Panagiotopoulos --- (In reply to Alex Deucher from comment #73) > (In reply to Julian from comment #72) > > (In reply to Alex Deucher from comment #71) > > > Can you also test with the code and firmware from comment 32? > > > > To clarify, do you mean only with the code from > > http://cgit.freedesktop.org/~agd5f/linux/commit/?h=new_smc or the whole > > kernel under agd5f? > > Either use the kernel from that branch or cherry-pick the top 4 commits to > whatever kernel you want to use and then install the new firmware files. Also tried this since I have the same problem, compiled the new_smc branch, installed the kernel and the firmware, however the problem persists if I boot it without radeon.dpm=0. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/a82990e0/attachment.html>
[Bug 92944] [Fiji/LLVM/RadeonSI] CS:GO segfaults in llvm
https://bugs.freedesktop.org/show_bug.cgi?id=92944 Nicolai H�hnle changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #14 from Nicolai H�hnle --- Indeed, the offending shaders no longer crash. Not sure which of the recent LLVM changes is responsible, let's just be happy it works :) -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/130064ce/attachment.html>
[Bug 92944] [Fiji/LLVM/RadeonSI] CS:GO segfaults in llvm
https://bugs.freedesktop.org/show_bug.cgi?id=92944 --- Comment #13 from Ernst Sj�strand --- Couldn't reproduce this today. Could set shaders to very high, change graphics settings on the fly (though slow), run multiple matches in a row etc... Latest padoka-ppa + drm-next-4.6-wip kernel. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/fbad6033/attachment.html>
[PATCH 1/4] drm/fsl-dcu: Cleanup vblank interrupt mask and status setting code
Hi Meng Yi, As I wrote earlier (http://www.spinics.net/lists/dri-devel/msg95703.html), my fixes patchset contains a similar patch which also explicitly disable the VBLANK interrupt. I think it is the better solution... See: https://lkml.org/lkml/2015/11/18/951 I will soon prepare a git tree and plan to submit that for 4.6, currently I plan to include - Your "Fix no fb check bug" patch - My "fixes and enhancements" patchset - My "fix register initialization" and "use flat regmap cache" patch Let me know if you have any objections. -- Stefan On 2016-01-25 20:00, Meng Yi wrote: > From: Jianwei Wang > > Switch update interrupt mask bit with regmap_update_bits, and clear > interrupt status by writing 1 to relevant bit before setting mask in > fsl_dcu_drm_irq_init function. > > Signed-off-by: JianWei Wang > Signed-off-by: Meng Yi > --- > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 26 +++--- > 1 file changed, 7 insertions(+), 19 deletions(-) > > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > index fca97d3..cbef47c 100644 > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > @@ -38,21 +38,17 @@ static const struct regmap_config fsl_dcu_regmap_config = > { > static int fsl_dcu_drm_irq_init(struct drm_device *dev) > { > struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > - unsigned int value; > int ret; > > ret = drm_irq_install(dev, fsl_dev->irq); > if (ret < 0) > dev_err(dev->dev, "failed to install IRQ handler\n"); > > - ret = regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0); > + ret = regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0x); > if (ret) > dev_err(dev->dev, "set DCU_INT_STATUS failed\n"); > - ret = regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > - if (ret) > - dev_err(dev->dev, "read DCU_INT_MASK failed\n"); > - value &= DCU_INT_MASK_VBLANK; > - ret = regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > + ret = regmap_update_bits(fsl_dev->regmap, DCU_INT_MASK, > + DCU_INT_MASK_VBLANK, ~DCU_INT_MASK_VBLANK); > if (ret) > dev_err(dev->dev, "set DCU_INT_MASK failed\n"); > ret = regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE, > @@ -143,14 +139,10 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg) > static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, unsigned int > pipe) > { > struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > - unsigned int value; > int ret; > > - ret = regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > - if (ret) > - dev_err(dev->dev, "read DCU_INT_MASK failed\n"); > - value &= ~DCU_INT_MASK_VBLANK; > - ret = regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > + ret = regmap_update_bits(fsl_dev->regmap, DCU_INT_MASK, > + DCU_INT_MASK_VBLANK, ~DCU_INT_MASK_VBLANK); > if (ret) > dev_err(dev->dev, "set DCU_INT_MASK failed\n"); > return 0; > @@ -160,14 +152,10 @@ static void fsl_dcu_drm_disable_vblank(struct > drm_device *dev, > unsigned int pipe) > { > struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > - unsigned int value; > int ret; > > - ret = regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > - if (ret) > - dev_err(dev->dev, "read DCU_INT_MASK failed\n"); > - value |= DCU_INT_MASK_VBLANK; > - ret = regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > + ret = regmap_update_bits(fsl_dev->regmap, DCU_INT_MASK, > + DCU_INT_MASK_VBLANK, DCU_INT_MASK_VBLANK); > if (ret) > dev_err(dev->dev, "set DCU_INT_MASK failed\n"); > }
[Bug 92936] Tonga powerplay isssues
https://bugs.freedesktop.org/show_bug.cgi?id=92936 --- Comment #8 from Andy Furniss --- Issue(s) still exist in latest drm-next-4.6-wip. With the new sys interface I can also see pcie which seems OK. The message when trying to force a level after uvd use has "fixed" mclck has changed = [ 804.212722] Failed to send Message. [ 804.212726] Target_and_current_Profile_Index. Curr_Mclk_Index does not match the level [ 806.957942] Failed to send Previous Message. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/c80aeece/attachment.html>
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On Mon, Jan 25, 2016 at 08:30:14PM +0100, Mario Kleiner wrote: > > > On 01/25/2016 07:51 PM, Daniel Vetter wrote: > >On Mon, Jan 25, 2016 at 05:38:30PM +0100, Mario Kleiner wrote: > >>Readding Daniel, which somehow got dropped from the cc. > >> > >>On 01/25/2016 03:53 PM, Ville Syrjälä wrote: > >>>On Mon, Jan 25, 2016 at 02:44:53PM +0100, Mario Kleiner wrote: > > > On 01/25/2016 02:23 PM, Ville Syrjälä wrote: > >On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: > >> > >> > >>On 01/25/2016 05:15 AM, Michel Dänzer wrote: > >>>On 23.01.2016 00:18, Ville Syrjälä wrote: > On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: > > > >[ Trimming KDE folks from Cc ] > > > >On 21.01.2016 19:09, Daniel Vetter wrote: > >>On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: > >>>On 21.01.2016 16:58, Daniel Vetter wrote: > > Can you please point me at the vblank on/off jump bug please? > >>> > >>>AFAIR I originally reported it in response to > >>>http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html > >>>, but I can't find that in the archives, so maybe that was just on > >>>IRC. > >>>See > >>>http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html > >>>. Basically, I ran into the bug fixed by your patch because the > >>>counter > >>>jumped forward on every DPMS off, so it hit the 32-bit boundary > >>>after > >>>just a few days. > >> > >>Ok, so just uncovered the overflow bug. > > > >Not sure what you mean by "just", but to be clear: The > >drm_vblank_on/off > >counter jumping bug (similar to the bug this thread is about), which > >exposed the overflow bug, is still alive and kicking in 4.5. It seems > >to happen when turning off the CRTC: > > > >[drm:drm_update_vblank_count] updating vblank count on crtc 0: > >current=218104694, diff=0, hw=916 hw_last=916 > >[drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > >[drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 > >p(2199,-45)@ 7304.307354 -> 7304.308006 [e 0 us, 0 rep] > >[drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > >[drm:drm_update_vblank_count] updating vblank count on crtc 0: > >current=218104694, diff=16776301, hw=1 hw_last=916 > > Not sure what bug we're talking about here, but here the hw counter > clearly jumps backwards. > > >[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >[drm:drm_update_vblank_count] updating vblank count on crtc 1: > >current=0, diff=0, hw=0 hw_last=0 > >[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >[drm:drm_update_vblank_count] updating vblank count on crtc 2: > >current=0, diff=0, hw=0 hw_last=0 > >[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >[drm:drm_update_vblank_count] updating vblank count on crtc 3: > >current=0, diff=0, hw=0 hw_last=0 > >[drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > >[drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ > >7304.317140 -> 7304.317140 [e 0 us, 0 rep] > >[drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > >[drm:drm_update_vblank_count] updating vblank count on crtc 0: > >current=234880995, diff=16777215, hw=0 hw_last=1 > > Same here. > >>> > >>>At least one of the jumps is expected, because this is around turning > >>>off the CRTC for DPMS off. Don't know yet why there are two jumps back > >>>though. > >>> > >>> > These things just don't happen on i915 because drm_vblank_off() and > drm_vblank_on() are always called around the times when the hw counter > might get reset. Or at least that's how it should be. > >>> > >>>Which is of course the idea of Daniel's patch (which is what I'm > >>>getting > >>>the above with) or Mario's patch as well, but clearly something's still > >>>wrong. It's certainly possible that it's something in the driver, but > >>>since calling drm_vblank_pre/post_modeset from the same places seems to > >>>work fine (ignoring the regression discussed in this thread)... Do > >>>drm_vblank_on/off require something else to handle this correctly? > >>> > >>> > >> > >>I suspect it is because vblank_disable_and_save calls > >>drm_update_vblank_count() unconditionally, even
[PATCH v2 13/26] drm/fb_cma_helper: Remove implicit call to disable_unused_functions
Hi Daniel, On Monday 25 January 2016 08:29:38 Daniel Vetter wrote: > On Mon, Jan 25, 2016 at 12:19:27AM +0200, Laurent Pinchart wrote: > > On Friday 15 January 2016 11:17:30 Daniel Vetter wrote: > >> On Fri, Jan 15, 2016 at 01:13:05AM +0200, Laurent Pinchart wrote: > >>> On Thursday 14 January 2016 16:24:56 Maxime Ripard wrote: > The drm_fbdev_cma_init function always calls the > drm_helper_disable_unused_functions. Since it's part of the usual > probe process, all the drivers using that helper will end up having > their encoder and CRTC disable functions called at probe if their > device has not been reported as enabled. > > This could be fixed by reading out from the registers the current > state of the device if it is enabled, but even that will not handle > the case where the device is actually disabled. > > Moreover, the drivers using the atomic modesetting expect that their > enable and disable callback to be called when the device is already > enabled or disabled (respectively). > > We can however fix this issue by moving the call to > drm_helper_disable_unused_functions out of drm_fbdev_cma_init and > make the drivers needing it (all the drivers calling > drm_fbdev_cma_init and not using the atomic modesetting) explicitly > call it. > >>> > >>> I'd rather add it to all drivers that call drm_fbdev_cma_init(). All > >>> the atomic ones must have special code to cope with it that could be > >>> rendered useless by the removal of the > >>> drm_helper_disable_unused_functions() call. That code should be > >>> removed too, and it would be easier to check drivers one by one and > >>> fixing them individually (outside of this patch series, unless you > >>> insist ;-)) when removing the explicit > >>> drm_helper_disable_unused_functions() call. > >> > >> I had the same thought, but figured there's really no good reason ever > >> to do this. I suspect most of that disable_unused_function stuff we have > >> all over is supreme cargo-cult anyway ;-) > > > > I'm not sure you got my point. Yes, the > > drm_helper_disable_unused_functions() call should be removed from atomic > > drivers, but that will leave support code added for the sole reason of > > avoiding the crash in the drivers. That code will likely not be noticed > > and will stay there rotting. If we added > > drm_helper_disable_unused_functions() calls to all atomic drivers then > > driver authors will hopefully check carefully if there's any support code > > that can be removed when removing the function call. It would act as a > > kind of FIXME reminder. > > drm_helper_disable_unused_functions() already prefers the ->disable > callbacks over dpms, like atomic helpers. I don't think there's any dead > code due to this change. The problem was that driver/hw blew up since it > was disabled when the hw was off already. The rcar-du-drm driver keeps an internal CRTC enabled state for just this purpose. I expect other drivers to implement something similar that can be removed after dropping the drm_helper_disable_unused_functions() calls. -- Regards, Laurent Pinchart
[Bug 93862] [Bisected] "drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2" is bad
https://bugs.freedesktop.org/show_bug.cgi?id=93862 Bug ID: 93862 Summary: [Bisected] "drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2" is bad Product: DRI Version: DRI git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: DRM/AMDgpu Assignee: dri-devel at lists.freedesktop.org Reporter: ernstp at gmail.com Updating to the latest drm-next-4.6-wip I could no longer log in to Gnome through GDM, I just got a black screen after entering my passwd. startx + gnome-session worked though. However if I ran Unigine Heaven with Tessellation there, I saw I got the frames in the wrong order sometimes. This doesn't happen otherwise. Bisecting was easy and pointed to: 78d0e182b6c1f5336f6e8cbb197f403276dabc7f drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2 Reverting that commit on top of drm-next-4.6-wip also solved the problem. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/cac0401a/attachment.html>
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On 01/25/2016 07:51 PM, Daniel Vetter wrote: > On Mon, Jan 25, 2016 at 05:38:30PM +0100, Mario Kleiner wrote: >> Readding Daniel, which somehow got dropped from the cc. >> >> On 01/25/2016 03:53 PM, Ville Syrjälä wrote: >>> On Mon, Jan 25, 2016 at 02:44:53PM +0100, Mario Kleiner wrote: On 01/25/2016 02:23 PM, Ville Syrjälä wrote: > On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: >> >> >> On 01/25/2016 05:15 AM, Michel Dänzer wrote: >>> On 23.01.2016 00:18, Ville Syrjälä wrote: On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: > > [ Trimming KDE folks from Cc ] > > On 21.01.2016 19:09, Daniel Vetter wrote: >> On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: >>> On 21.01.2016 16:58, Daniel Vetter wrote: Can you please point me at the vblank on/off jump bug please? >>> >>> AFAIR I originally reported it in response to >>> http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html >>> , but I can't find that in the archives, so maybe that was just on >>> IRC. >>> See >>> http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html >>> . Basically, I ran into the bug fixed by your patch because the >>> counter >>> jumped forward on every DPMS off, so it hit the 32-bit boundary >>> after >>> just a few days. >> >> Ok, so just uncovered the overflow bug. > > Not sure what you mean by "just", but to be clear: The > drm_vblank_on/off > counter jumping bug (similar to the bug this thread is about), which > exposed the overflow bug, is still alive and kicking in 4.5. It seems > to happen when turning off the CRTC: > > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > current=218104694, diff=0, hw=916 hw_last=916 > [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 > p(2199,-45)@ 7304.307354 -> 7304.308006 [e 0 us, 0 rep] > [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > current=218104694, diff=16776301, hw=1 hw_last=916 Not sure what bug we're talking about here, but here the hw counter clearly jumps backwards. > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:drm_update_vblank_count] updating vblank count on crtc 1: > current=0, diff=0, hw=0 hw_last=0 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:drm_update_vblank_count] updating vblank count on crtc 2: > current=0, diff=0, hw=0 hw_last=0 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:drm_update_vblank_count] updating vblank count on crtc 3: > current=0, diff=0, hw=0 hw_last=0 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ > 7304.317140 -> 7304.317140 [e 0 us, 0 rep] > [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > current=234880995, diff=16777215, hw=0 hw_last=1 Same here. >>> >>> At least one of the jumps is expected, because this is around turning >>> off the CRTC for DPMS off. Don't know yet why there are two jumps back >>> though. >>> >>> These things just don't happen on i915 because drm_vblank_off() and drm_vblank_on() are always called around the times when the hw counter might get reset. Or at least that's how it should be. >>> >>> Which is of course the idea of Daniel's patch (which is what I'm getting >>> the above with) or Mario's patch as well, but clearly something's still >>> wrong. It's certainly possible that it's something in the driver, but >>> since calling drm_vblank_pre/post_modeset from the same places seems to >>> work fine (ignoring the regression discussed in this thread)... Do >>> drm_vblank_on/off require something else to handle this correctly? >>> >>> >> >> I suspect it is because vblank_disable_and_save calls >> drm_update_vblank_count() unconditionally, even if vblank irqs are >> already off. >> >> So on a manual display disable -> reenable you get something like >> >> At disable: >> >> Call to dpms-off --> atombios_crtc_dp
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On Mon, Jan 25, 2016 at 05:38:30PM +0100, Mario Kleiner wrote: > Readding Daniel, which somehow got dropped from the cc. > > On 01/25/2016 03:53 PM, Ville Syrjälä wrote: > >On Mon, Jan 25, 2016 at 02:44:53PM +0100, Mario Kleiner wrote: > >> > >> > >>On 01/25/2016 02:23 PM, Ville Syrjälä wrote: > >>>On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: > > > On 01/25/2016 05:15 AM, Michel Dänzer wrote: > >On 23.01.2016 00:18, Ville Syrjälä wrote: > >>On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: > >>> > >>>[ Trimming KDE folks from Cc ] > >>> > >>>On 21.01.2016 19:09, Daniel Vetter wrote: > On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: > >On 21.01.2016 16:58, Daniel Vetter wrote: > >> > >>Can you please point me at the vblank on/off jump bug please? > > > >AFAIR I originally reported it in response to > >http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html > >, but I can't find that in the archives, so maybe that was just on > >IRC. > >See > >http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html > >. Basically, I ran into the bug fixed by your patch because the > >counter > >jumped forward on every DPMS off, so it hit the 32-bit boundary after > >just a few days. > > Ok, so just uncovered the overflow bug. > >>> > >>>Not sure what you mean by "just", but to be clear: The > >>>drm_vblank_on/off > >>>counter jumping bug (similar to the bug this thread is about), which > >>>exposed the overflow bug, is still alive and kicking in 4.5. It seems > >>>to happen when turning off the CRTC: > >>> > >>>[drm:drm_update_vblank_count] updating vblank count on crtc 0: > >>>current=218104694, diff=0, hw=916 hw_last=916 > >>>[drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > >>>[drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 > >>>p(2199,-45)@ 7304.307354 -> 7304.308006 [e 0 us, 0 rep] > >>>[drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > >>>[drm:drm_update_vblank_count] updating vblank count on crtc 0: > >>>current=218104694, diff=16776301, hw=1 hw_last=916 > >> > >>Not sure what bug we're talking about here, but here the hw counter > >>clearly jumps backwards. > >> > >>>[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>>[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>>[drm:drm_update_vblank_count] updating vblank count on crtc 1: > >>>current=0, diff=0, hw=0 hw_last=0 > >>>[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>>[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>>[drm:drm_update_vblank_count] updating vblank count on crtc 2: > >>>current=0, diff=0, hw=0 hw_last=0 > >>>[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>>[drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>>[drm:drm_update_vblank_count] updating vblank count on crtc 3: > >>>current=0, diff=0, hw=0 hw_last=0 > >>>[drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > >>>[drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ > >>>7304.317140 -> 7304.317140 [e 0 us, 0 rep] > >>>[drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > >>>[drm:drm_update_vblank_count] updating vblank count on crtc 0: > >>>current=234880995, diff=16777215, hw=0 hw_last=1 > >> > >>Same here. > > > >At least one of the jumps is expected, because this is around turning > >off the CRTC for DPMS off. Don't know yet why there are two jumps back > >though. > > > > > >>These things just don't happen on i915 because drm_vblank_off() and > >>drm_vblank_on() are always called around the times when the hw counter > >>might get reset. Or at least that's how it should be. > > > >Which is of course the idea of Daniel's patch (which is what I'm getting > >the above with) or Mario's patch as well, but clearly something's still > >wrong. It's certainly possible that it's something in the driver, but > >since calling drm_vblank_pre/post_modeset from the same places seems to > >work fine (ignoring the regression discussed in this thread)... Do > >drm_vblank_on/off require something else to handle this correctly? > > > > > > I suspect it is because vblank_disable_and_save calls > drm_update_vblank_count() unconditionally, even if vblank irqs are > already off. > > So on a manual display disable -> reenable you get something like > > At disable: > > Call to dpms-off --> atombios_crtc_dpms(DPMS_OFF) --> drm_vblank_off -> > vblank_disable_and_save -> irqs off, drm_update_vblank_count() computes > final count. >
[PATCH] drm/radeon: only init fbdev if we have connectors
from a quick look, I think so.. It was something I ran across on an older kernel which didn't have amdgpu, but I don't see anything obvious that would cause drm_fb_helper_init() to be skipped in amdgpu if there are no connectors.. (but nouveau seems to check for dev->mode_config.num_crtc, for (I assume) similar reasons) BR, -R On Mon, Jan 25, 2016 at 6:57 PM, Mike Lothian wrote: > Is something similar required for AMDGPU too? > > On Mon, 25 Jan 2016 at 23:06 Rob Clark wrote: >> >> This fixes an issue that was noticed on an optimus/prime laptop with >> a kernel that was old enough to not support the integrated intel gfx >> (which was driving all the outputs), but did have support for the >> discrete radeon gpu. The end result was not falling back to VESA and >> leaving the user with a black screen. >> >> (Plus it is kind of silly to create an framebuffer device if there >> are no outputs hooked up to the gpu.) >> >> Signed-off-by: Rob Clark >> --- >> drivers/gpu/drm/radeon/radeon_display.c | 6 -- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/radeon/radeon_display.c >> b/drivers/gpu/drm/radeon/radeon_display.c >> index 1eca0ac..f8e776c 100644 >> --- a/drivers/gpu/drm/radeon/radeon_display.c >> +++ b/drivers/gpu/drm/radeon/radeon_display.c >> @@ -1670,8 +1670,10 @@ int radeon_modeset_init(struct radeon_device *rdev) >> /* setup afmt */ >> radeon_afmt_init(rdev); >> >> - radeon_fbdev_init(rdev); >> - drm_kms_helper_poll_init(rdev->ddev); >> + if (!list_empty(&rdev->ddev->mode_config.connector_list)) { >> + radeon_fbdev_init(rdev); >> + drm_kms_helper_poll_init(rdev->ddev); >> + } >> >> /* do pm late init */ >> ret = radeon_pm_late_init(rdev); >> -- >> 2.5.0 >> >> ___ >> dri-devel mailing list >> dri-devel at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/5] Fixes for MST (daisy-chain and 4k tiles)
Hi Dave, I've been running with lockdep with these changes for over a week now. Just ran another test with our daisy-chain displays and the 4k tiled display with no deadlocks or lockdep prints (other than "RCU lockdep checking is enabled."). Thanks, Harry From: Dave Airlie Sent: Sunday, January 24, 2016 11:53 PM To: Wentland, Harry Cc: dri-devel Subject: Re: [PATCH 0/5] Fixes for MST (daisy-chain and 4k tiles) On 23 January 2016 at 08:07, Harry Wentland wrote: > A couple of MST fixes to bugs in the framework that we encountered when > testing with > - three-display daisy-chain configurations > - 4k tiled displays Hi Harry, these all look pretty good to me, have you tested them with lockdep enabled? I had started to fix the CSN/GUID one here a little while back but it's sitting on a laptop I can't access at the moment. But if you can test with lockdep, and it doesn't deadlock, then I'm happy to accept these.. Reviewed-by: Dave Airlie Dave. > > Andrey Grodzovsky (1): > drm/dp/mst: Reverse order of MST enable and clearing VC payload table. > > Harry Wentland (2): > drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil > drm/dp/mst: Calculate MST PBN with 31.32 fixed point > > Hersen Wu (1): > drm/dp/mst: move GUID storage from mgr, port to only mst branch > > Mykola Lysenko (1): > drm/dp/mst: change MST detection scheme > > drivers/gpu/drm/drm_dp_mst_topology.c | 180 > +- > include/drm/drm_dp_mst_helper.h | 25 ++--- > include/drm/drm_fixed.h | 54 +- > 3 files changed, 154 insertions(+), 105 deletions(-) > > -- > 2.1.4 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 93546] Civilization 5 - Leaders in the diplomatic interactions screen appear completely black
https://bugs.freedesktop.org/show_bug.cgi?id=93546 --- Comment #5 from Hadrien --- Thanks Nicolai. I've been able to produce a trace file but it is huge and the replay gives some weird geometry rendering. However I've been able to get to the point where the character is drawn. The geometry is still incorrect but at least the pixels are black like during the live run of the game. It allowed me to perform step-by-step debugging into the r600 Mesa code after I rebuilt it from source with debugging options. The TGSI program looks a bit different than when I output it with the environment variable but I get the same error than with the original mesa libraries released with Ubuntu. What it looks like is that the temporary variables of the TGSI program are nearly directly mapped to registers, but the rv770 "only" have 128 registers. The TGSI program I dumped uses nearly 400 temporary variables. This might explain the error. Maybe some registers could be reused to keep below the limit? I've been browsing a bit about this kind of problem and it seems to be a typical computer-science compilation problem. A recurring solution I've read about is a graph coloring algorithm. However I do not know where any of the register allocation optimization should occur. In the r600 code or when the TGSI program is generated so all GPU specific code could benefit of it? In any case it looks like a tough problem. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/57b561a1/attachment-0001.html>
[PATCH v2 06/18] drm: Add drm_format_plane_width() and drm_format_plane_height()
On Wed, Jan 20, 2016 at 09:05:27PM +0200, ville.syrjala at linux.intel.com wrote: > From: Ville Syrjälä > > Add a few helpers to get the dimensions of the chroma plane(s). > > v2: Add kernel-doc (Daniel) > > Cc: dri-devel at lists.freedesktop.org > Signed-off-by: Ville Syrjälä > Reviewed-by: Daniel Vetter > --- > include/drm/drm_crtc.h | 30 ++ > 1 file changed, 30 insertions(+) > > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > index c65a212db77e..91195c403422 100644 > --- a/include/drm/drm_crtc.h > +++ b/include/drm/drm_crtc.h > @@ -2482,6 +2482,36 @@ extern int drm_format_num_planes(uint32_t format); > extern int drm_format_plane_cpp(uint32_t format, int plane); > extern int drm_format_horz_chroma_subsampling(uint32_t format); > extern int drm_format_vert_chroma_subsampling(uint32_t format); > +/** > + * drm_format_plane_width - width of the plane given the first plane > + * @width: width of the first plane > + * @format: pixel format > + * @plane: plane index > + * kerneldoc style is + * Returns: + * blabla > + * Returns the width of @plane, given that the width of the first plane > + * is @width. > + */ > +static inline int drm_format_plane_width(int width, uint32_t format, int > plane) > +{ For consistency with other helpers I think we should put an if (plane >= drm_format_num_planes(format)) return 0; here. Also I think static inline is overkill for these, and grouping them together with the others in drm_crtc.c will make it easier to extract them into a new file (since drm_crtc.c is kinda sprawling a bit). With those nitpicks applied: Reviewed-by: Daniel Vetter > + if (plane == 0) > + return width; > + return width / drm_format_horz_chroma_subsampling(format); > +} > +/** > + * drm_format_plane_height - height of the plane given the first plane > + * @height: height of the first plane > + * @format: pixel format > + * @plane: plane index > + * > + * Returns the height of @plane, given that the height of the first plane > + * is @height. > + */ > +static inline int drm_format_plane_height(int height, uint32_t format, int > plane) > +{ > + if (plane == 0) > + return height; > + return height / drm_format_vert_chroma_subsampling(format); > +} > extern const char *drm_get_format_name(uint32_t format); > extern struct drm_property *drm_mode_create_rotation_property(struct > drm_device *dev, > unsigned int > supported_rotations); > -- > 2.4.10 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH] drm/radeon: only init fbdev if we have connectors
This fixes an issue that was noticed on an optimus/prime laptop with a kernel that was old enough to not support the integrated intel gfx (which was driving all the outputs), but did have support for the discrete radeon gpu. The end result was not falling back to VESA and leaving the user with a black screen. (Plus it is kind of silly to create an framebuffer device if there are no outputs hooked up to the gpu.) Signed-off-by: Rob Clark --- drivers/gpu/drm/radeon/radeon_display.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 1eca0ac..f8e776c 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -1670,8 +1670,10 @@ int radeon_modeset_init(struct radeon_device *rdev) /* setup afmt */ radeon_afmt_init(rdev); - radeon_fbdev_init(rdev); - drm_kms_helper_poll_init(rdev->ddev); + if (!list_empty(&rdev->ddev->mode_config.connector_list)) { + radeon_fbdev_init(rdev); + drm_kms_helper_poll_init(rdev->ddev); + } /* do pm late init */ ret = radeon_pm_late_init(rdev); -- 2.5.0
[Bug 111271] Black stripe on screen with MGAG200 (PowerEdge R320) and modesetting
https://bugzilla.kernel.org/show_bug.cgi?id=111271 --- Comment #5 from Jean-Yves Faye --- Created attachment 201431 --> https://bugzilla.kernel.org/attachment.cgi?id=201431&action=edit Picture of screen This was caught on a CRT monitor and is quite visible. The strip follow the mouse cursor on the edge. The white section of screen outside what should be the drawing zone may help you too. -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 111271] Black stripe on screen with MGAG200 (PowerEdge R320) and modesetting
https://bugzilla.kernel.org/show_bug.cgi?id=111271 Ville Syrjala changed: What|Removed |Added CC||ville.syrjala at linux.intel.c ||om --- Comment #4 from Ville Syrjala --- commit 9125e6186822b2698da17690416cd1b55c030115 Author: Ville Syrjälä Date: Mon Jun 3 16:10:40 2013 +0300 drm: Add drm_plane_force_disable() just moves code around. So can't see how it could be related to this. Well, actually it does add a plane->fb NULL check, so I suppose that could be somehow related if something else is buggy and clears plane->fb while the plane is still enabled. But actually, the mgag200 driver doesn't even do planes (nor is the hardware even capable of turning off the primary plane independent of the crtc) so not sure why this would have anything to do with the problem. Without a picture it's a bit hard to know, but black horizontal lines at the left edge of the screen has a feel of underruns. I have seen such things plenty of times on my G550 when using the video overlay with eg. 1920x1080 mode with reduced blanking, if the overlay is postioned too close to the left edge of the screen. It's possible the hw cursor might suffer from similar issues. Looking at the driver the hiprilvl computations seem a bit dubious at best. Possibly by tweaking that stuff it might be possible to eliminate the underruns, but no guarantees. -- You are receiving this mail because: You are watching the assignee of the bug.
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
Readding Daniel, which somehow got dropped from the cc. On 01/25/2016 03:53 PM, Ville Syrjälä wrote: > On Mon, Jan 25, 2016 at 02:44:53PM +0100, Mario Kleiner wrote: >> >> >> On 01/25/2016 02:23 PM, Ville Syrjälä wrote: >>> On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: On 01/25/2016 05:15 AM, Michel Dänzer wrote: > On 23.01.2016 00:18, Ville Syrjälä wrote: >> On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: >>> >>> [ Trimming KDE folks from Cc ] >>> >>> On 21.01.2016 19:09, Daniel Vetter wrote: On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: > On 21.01.2016 16:58, Daniel Vetter wrote: >> >> Can you please point me at the vblank on/off jump bug please? > > AFAIR I originally reported it in response to > http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html > , but I can't find that in the archives, so maybe that was just on > IRC. > See > http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html > . Basically, I ran into the bug fixed by your patch because the > counter > jumped forward on every DPMS off, so it hit the 32-bit boundary after > just a few days. Ok, so just uncovered the overflow bug. >>> >>> Not sure what you mean by "just", but to be clear: The drm_vblank_on/off >>> counter jumping bug (similar to the bug this thread is about), which >>> exposed the overflow bug, is still alive and kicking in 4.5. It seems >>> to happen when turning off the CRTC: >>> >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=218104694, diff=0, hw=916 hw_last=916 >>> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 >>> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 p(2199,-45)@ >>> 7304.307354 -> 7304.308006 [e 0 us, 0 rep] >>> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=218104694, diff=16776301, hw=1 hw_last=916 >> >> Not sure what bug we're talking about here, but here the hw counter >> clearly jumps backwards. >> >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 1: >>> current=0, diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 2: >>> current=0, diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 3: >>> current=0, diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 >>> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ >>> 7304.317140 -> 7304.317140 [e 0 us, 0 rep] >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=234880995, diff=16777215, hw=0 hw_last=1 >> >> Same here. > > At least one of the jumps is expected, because this is around turning > off the CRTC for DPMS off. Don't know yet why there are two jumps back > though. > > >> These things just don't happen on i915 because drm_vblank_off() and >> drm_vblank_on() are always called around the times when the hw counter >> might get reset. Or at least that's how it should be. > > Which is of course the idea of Daniel's patch (which is what I'm getting > the above with) or Mario's patch as well, but clearly something's still > wrong. It's certainly possible that it's something in the driver, but > since calling drm_vblank_pre/post_modeset from the same places seems to > work fine (ignoring the regression discussed in this thread)... Do > drm_vblank_on/off require something else to handle this correctly? > > I suspect it is because vblank_disable_and_save calls drm_update_vblank_count() unconditionally, even if vblank irqs are already off. So on a manual display disable -> reenable you get something like At disable: Call to dpms-off --> atombios_crtc_dpms(DPMS_OFF) --> drm_vblank_off -> vblank_disable_and_save -> irqs off, drm_update_vblank_count() computes final count. Then the crtc is shut down and its hw counter resets to zero. At reenable: Modesetting -> drm_crtc_helper_set_mode -> crtc_funcs->prepare(crtc) -> atombios_crtc_prepare() ->
[Bug 111271] Black stripe on screen with MGAG200 (PowerEdge R320) and modesetting
https://bugzilla.kernel.org/show_bug.cgi?id=111271 --- Comment #3 from Jean-Yves Faye --- Created attachment 201421 --> https://bugzilla.kernel.org/attachment.cgi?id=201421&action=edit bisect log I've ran bisect between 3.10.40 and 3.18, but still present on 4.4 Linux localhost.adm 4.4.0 #21 SMP Mon Jan 25 16:08:56 CET 2016 x86_64 Intel(R) Xeon(R) CPU E5-1410 v2 @ 2.80GHz GenuineIntel GNU/Linux -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 111271] Black stripe on screen with MGAG200 (PowerEdge R320) and modesetting
https://bugzilla.kernel.org/show_bug.cgi?id=111271 --- Comment #2 from Jean-Yves Faye --- Created attachment 201411 --> https://bugzilla.kernel.org/attachment.cgi?id=201411&action=edit kernel config for our Dell R320 (no module) -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 111271] Black stripe on screen with MGAG200 (PowerEdge R320) and modesetting
https://bugzilla.kernel.org/show_bug.cgi?id=111271 --- Comment #1 from Jean-Yves Faye --- Created attachment 201401 --> https://bugzilla.kernel.org/attachment.cgi?id=201401&action=edit Xorg.0.log (4.4 kernel, disregard kernel command line) -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 111271] New: Black stripe on screen with MGAG200 (PowerEdge R320) and modesetting
https://bugzilla.kernel.org/show_bug.cgi?id=111271 Bug ID: 111271 Summary: Black stripe on screen with MGAG200 (PowerEdge R320) and modesetting Product: Drivers Version: 2.5 Kernel Version: 4.4 Hardware: x86-64 OS: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Video(DRI - non Intel) Assignee: drivers_video-dri at kernel-bugs.osdl.org Reporter: jean-yves.faye at c-s.fr Regression: No Created attachment 201391 --> https://bugzilla.kernel.org/attachment.cgi?id=201391&action=edit dmesg I use Xorg with modesetting driver on a R320 PowerEdge Dell server. I've upgraded kernel from 3.10.40 to a newer version. With the upgrade, a black horizontal stripe appears next to the pointer when moving the mouse to the left edge of the screen. The stripe darker and wider on a CRT screen than a LCD screen it seems. I've tested on 4.4 and the problem is still present. I'm using Xorg with the modesetting driver, and the MGAG200 kernel module (dmesg and Xorg.log attached) I've run a git bisect on the kernel and identified the commit causing the regression : # first bad commit: [9125e6186822b2698da17690416cd1b55c030115] drm: Add drm_plane_force_disable() Unfortunately I'm not familiar with the GPU/DRM part of the kernel, so I can't get this any further. -- You are receiving this mail because: You are watching the assignee of the bug.
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On Mon, Jan 25, 2016 at 02:44:53PM +0100, Mario Kleiner wrote: > > > On 01/25/2016 02:23 PM, Ville Syrjälä wrote: > > On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: > >> > >> > >> On 01/25/2016 05:15 AM, Michel Dänzer wrote: > >>> On 23.01.2016 00:18, Ville Syrjälä wrote: > On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: > > > > [ Trimming KDE folks from Cc ] > > > > On 21.01.2016 19:09, Daniel Vetter wrote: > >> On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: > >>> On 21.01.2016 16:58, Daniel Vetter wrote: > > Can you please point me at the vblank on/off jump bug please? > >>> > >>> AFAIR I originally reported it in response to > >>> http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html > >>> , but I can't find that in the archives, so maybe that was just on > >>> IRC. > >>> See > >>> http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html > >>> . Basically, I ran into the bug fixed by your patch because the > >>> counter > >>> jumped forward on every DPMS off, so it hit the 32-bit boundary after > >>> just a few days. > >> > >> Ok, so just uncovered the overflow bug. > > > > Not sure what you mean by "just", but to be clear: The drm_vblank_on/off > > counter jumping bug (similar to the bug this thread is about), which > > exposed the overflow bug, is still alive and kicking in 4.5. It seems > > to happen when turning off the CRTC: > > > > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > > current=218104694, diff=0, hw=916 hw_last=916 > > [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > > [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 p(2199,-45)@ > > 7304.307354 -> 7304.308006 [e 0 us, 0 rep] > > [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > > current=218104694, diff=16776301, hw=1 hw_last=916 > > Not sure what bug we're talking about here, but here the hw counter > clearly jumps backwards. > > > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > > [drm:drm_update_vblank_count] updating vblank count on crtc 1: > > current=0, diff=0, hw=0 hw_last=0 > > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > > [drm:drm_update_vblank_count] updating vblank count on crtc 2: > > current=0, diff=0, hw=0 hw_last=0 > > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > > [drm:drm_update_vblank_count] updating vblank count on crtc 3: > > current=0, diff=0, hw=0 hw_last=0 > > [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > > [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ > > 7304.317140 -> 7304.317140 [e 0 us, 0 rep] > > [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > > current=234880995, diff=16777215, hw=0 hw_last=1 > > Same here. > >>> > >>> At least one of the jumps is expected, because this is around turning > >>> off the CRTC for DPMS off. Don't know yet why there are two jumps back > >>> though. > >>> > >>> > These things just don't happen on i915 because drm_vblank_off() and > drm_vblank_on() are always called around the times when the hw counter > might get reset. Or at least that's how it should be. > >>> > >>> Which is of course the idea of Daniel's patch (which is what I'm getting > >>> the above with) or Mario's patch as well, but clearly something's still > >>> wrong. It's certainly possible that it's something in the driver, but > >>> since calling drm_vblank_pre/post_modeset from the same places seems to > >>> work fine (ignoring the regression discussed in this thread)... Do > >>> drm_vblank_on/off require something else to handle this correctly? > >>> > >>> > >> > >> I suspect it is because vblank_disable_and_save calls > >> drm_update_vblank_count() unconditionally, even if vblank irqs are > >> already off. > >> > >> So on a manual display disable -> reenable you get something like > >> > >> At disable: > >> > >> Call to dpms-off --> atombios_crtc_dpms(DPMS_OFF) --> drm_vblank_off -> > >> vblank_disable_and_save -> irqs off, drm_update_vblank_count() computes > >> final count. > >> > >> Then the crtc is shut down and its hw counter resets to zero. > >> > >> At reenable: > >> > >> Modesetting -> drm_crtc_helper_set_mode -> crtc_funcs->prepare(crtc) -> > >> atombios_crtc_prepare() -> atombios_crtc_dpms(DPMS_OFF) -> > >> drm_vblank_off -> vblank_disable_and_save -> A pointless > >> drm_upd
[PATCH] drm/crtc-helper: Add caveat to disable_unused_functions doc
On Wed, Jan 13, 2016 at 03:31:16PM +0100, Daniel Vetter wrote: > This shouldn't be used by atomic drivers any more, it confuses the > state tracking. > > Cc: Maxime Ripard > Cc: Laurent Pinchart > Acked-by: Laurent Pinchart > Signed-off-by: Daniel Vetter Applied this one to drm-misc. -Daniel > --- > drivers/gpu/drm/drm_crtc_helper.c | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/drm_crtc_helper.c > b/drivers/gpu/drm/drm_crtc_helper.c > index a02a7f9a6a9d..a278fbbe23e0 100644 > --- a/drivers/gpu/drm/drm_crtc_helper.c > +++ b/drivers/gpu/drm/drm_crtc_helper.c > @@ -220,6 +220,15 @@ static void __drm_helper_disable_unused_functions(struct > drm_device *dev) > * disconnected connectors. Then it will disable all unused encoders and > CRTCs > * either by calling their disable callback if available or by calling their > * dpms callback with DRM_MODE_DPMS_OFF. > + * > + * NOTE: > + * > + * This function is part of the legacy modeset helper library and will cause > + * major confusion with atomic drivers. This is because atomic helpers > guarantee > + * to never call ->disable() hooks on a disabled function, or ->enable() > hooks > + * on an enabled functions. drm_helper_disable_unused_functions() on the > other > + * hand throws such guarantees into the wind and calls disable hooks > + * unconditionally on unused functions. > */ > void drm_helper_disable_unused_functions(struct drm_device *dev) > { > -- > 2.7.0.rc3 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH v2] drm/i915: Remove select to deleted STOP_MACHINE from Kconfig
On Mon, Jan 25, 2016 at 12:41:19PM +0100, Andreas Ziegler wrote: > Commit 5bab6f60cb4d ("drm/i915: Serialise updates to GGTT with access > through GGTT on Braswell") depended upon a working stop_machine() and > so forced the selection of STOP_MACHINE. However, commit 86fffe4a61dd > ("kernel: remove stop_machine() Kconfig dependency") removed the option > STOP_MACHINE from init/Kconfig and ensured that stop_machine() > universally works. Due to the order in which the patches were applied, > removing the select from DRM_I915 got lost during merging. > > Remove the now obsolete select statement. > > Signed-off-by: Andreas Ziegler > Reviewed-by: Chris Wilson Applied, thanks. -Daniel > --- > Changes to v1: > - Tell the story right, suggested by Chris Wilson > > drivers/gpu/drm/i915/Kconfig | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig > index fcd77b2..051eab3 100644 > --- a/drivers/gpu/drm/i915/Kconfig > +++ b/drivers/gpu/drm/i915/Kconfig > @@ -10,7 +10,6 @@ config DRM_I915 > # the shmem_readpage() which depends upon tmpfs > select SHMEM > select TMPFS > - select STOP_MACHINE > select DRM_KMS_HELPER > select DRM_PANEL > select DRM_MIPI_DSI > -- > 1.9.1 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH] drm/radeon: Ensure radeon bo is unreserved in radeon_gem_va_ioctl
Am 25.01.2016 um 16:34 schrieb Matthew Dawson: > Found with lockdep while testing gpu reset. > > Signed-off-by: Matthew Dawson Reviewed-by: Christian König > --- > drivers/gpu/drm/radeon/radeon_gem.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/radeon/radeon_gem.c > b/drivers/gpu/drm/radeon/radeon_gem.c > index 3dcc573..e26c963 100644 > --- a/drivers/gpu/drm/radeon/radeon_gem.c > +++ b/drivers/gpu/drm/radeon/radeon_gem.c > @@ -663,6 +663,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void > *data, > bo_va = radeon_vm_bo_find(&fpriv->vm, rbo); > if (!bo_va) { > args->operation = RADEON_VA_RESULT_ERROR; > + radeon_bo_unreserve(rbo); > drm_gem_object_unreference_unlocked(gobj); > return -ENOENT; > }
[PATCH] drm: armada: use dma_addr_t properly
The armada_gem driver stores a DMA address token in a resource_size_t. This is safe because both are always at least 32 bits wide and can store any address that is accessible by this driver. However, it is a slight type mismatch when we assign it from/to an sg_dma_address() value, and we get a warning in any configuration in which resource_size_t is shorter than dma_addr_t: drivers/gpu/drm/armada/armada_gem.c: In function 'armada_gem_alloc_private_object': arch/arm/include/asm/dma-mapping.h:16:24: warning: large integer implicitly truncated to unsigned type [-Woverflow] #define DMA_ERROR_CODE (~(dma_addr_t)0x0) ^ drivers/gpu/drm/armada/armada_gem.c:204:18: note: in expansion of macro 'DMA_ERROR_CODE' obj->dev_addr = DMA_ERROR_CODE; ^ Changing the type to dma_addr_t solves both issues. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/armada/armada_gem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/armada/armada_gem.h b/drivers/gpu/drm/armada/armada_gem.h index b000ea3a829a..270cff02c1cd 100644 --- a/drivers/gpu/drm/armada/armada_gem.h +++ b/drivers/gpu/drm/armada/armada_gem.h @@ -15,7 +15,7 @@ struct armada_gem_object { struct drm_gem_object obj; void*addr; phys_addr_t phys_addr; - resource_size_t dev_addr; + dma_addr_t dev_addr; struct drm_mm_node *linear;/* for linear backed */ struct page *page; /* for page backed */ struct sg_table *sgt; /* for imported */ -- 2.7.0
[BUG/REGRESSION] Kernel 4.5-rc1 on Acube Sam460ex AMCC 460ex Power PC motherboards
On 1/25/2016 3:20 PM, Dan Williams wrote: > On Mon, Jan 25, 2016 at 4:46 AM, Julian Margetson wrote: >> Oops starting Xorg with kernel 4.5-rc1 on Acube Sam460ex amcc460ex powerpc >> motherboard. >> >> == >> 01c8f1c44b83a0825b573e7c723b033cece37b86 is the first bad commit >> commit 01c8f1c44b83a0825b573e7c723b033cece37b86 >> Author: Dan Williams >> Date: Fri Jan 15 16:56:40 2016 -0800 >> >> mm, dax, gpu: convert vm_insert_mixed to pfn_t >> >> Convert the raw unsigned long 'pfn' argument to pfn_t for the purpose of >> evaluating the PFN_MAP and PFN_DEV flags. When both are set it triggers >> _PAGE_DEVMAP to be set in the resulting pte. >> >> There are no functional changes to the gpu drivers as a result of this >> conversion. >> >> Signed-off-by: Dan Williams >> Cc: Dave Hansen >> Cc: David Airlie >> Signed-off-by: Andrew Morton >> Signed-off-by: Linus Torvalds >> >> :04 04 dc71b6dc188dea4b6ce95f5fd1e4e73cc3663cbe >> 8a745459a14cd2a6f4e1c71fda3e54333d023f43 M arch >> :04 04 9e8103b65698f677e17becdac53914ca029a6197 >> f656e15bffef4ea8c848176a79eb50a071ec323e M drivers >> :04 04 3ffc222d7e0f1067772798d08777aeb54136026e >> e2b423f85aaaf0cb25d48d1e15771fc5bddf7981 M fs >> :04 04 392d2dea8185ba8f0d1c101782831ceed9aa9812 >> 9e3001b04052daa1b3204b6f2a6e26138a4ed7dd M include >> :04 04 f81d8cfe3052b7259b75a58656a65efdaad40284 >> 969d0ff262020f27a695172ce89ae5f6088e8d44 M mm >> > Hmm, this commit could only cause a behavior change if it modifies the > value of the pfn as seen by insert_pfn(). Can you try the attached > debug patch to see if that assumption is being violated? Had to manually delete the lines in the second part of the patch. = U-Boot 2015.a (May 16 2015 - 14:20:11) CPU: AMCC PowerPC 460EX Rev. B at 1155 MHz (PLB=231 OPB=115 EBC=115) No Security/Kasumi support Bootstrap Option H - Boot ROM Location I2C (Addr 0x52) Internal PCI arbiter enabled 32 kB I-Cache 32 kB D-Cache Board: Sam460ex/cr, PCIe 4x + SATA-2 I2C: ready DRAM: 2 GiB (ECC not enabled, 462 MHz, CL4) PCI: Bus Dev VenId DevId Class Int 00 04 1095 3512 0104 00 00 06 126f 0501 0380 00 PCIE1: successfully set as root-complex 02 00 1002 683f 0300 ff Net: ppc_4xx_eth0 FPGA: Revision 03 (2010-10-07) SM502: found PERMD2:not found VGA: 1 VESA: OK [0.00] Using Canyonlands machine description [0.00] Linux version 4.5.0-rc1-Sam460ex (root at julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #1 PREEMPT Mon Jan 25 16:03:17 AST 2016 [0.00] Zone ranges: [0.00] DMA [mem 0x-0x2fff] [0.00] Normal empty [0.00] HighMem [mem 0x3000-0x7fff] [0.00] Movable zone start for each node [0.00] Early memory node ranges [0.00] node 0: [mem 0x-0x7fff] [0.00] Initmem setup node 0 [mem 0x-0x7fff] [0.00] MMU: Allocated 1088 bytes of context maps for 255 contexts [0.00] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 522752 [0.00] Kernel command line: root=/dev/sdb8 console=ttyS0,115200 console=tty0 [0.00] PID hash table entries: 4096 (order: 2, 16384 bytes) [0.00] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) [0.00] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) [0.00] Sorting __ex_table... [0.00] Memory: 2002928K/2097152K available (6792K kernel code, 288K rwdata, 3228K rodata, 236K init, 345K bss, 94224K reserved, 0K cma-reserved, 1310720K highmem) [0.00] Kernel virtual memory layout: [0.00] * 0xfffcf000..0xf000 : fixmap [0.00] * 0xffc0..0xffe0 : highmem PTEs [0.00] * 0xffa0..0xffc0 : consistent mem [0.00] * 0xffa0..0xffa0 : early ioremap [0.00] * 0xf100..0xffa0 : vmalloc & ioremap [0.00] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [0.00] Preemptible hierarchical RCU implementation. [0.00] Build-time adjustment of leaf fanout to 32. [0.00] NR_IRQS:512 nr_irqs:512 16 [0.00] UIC0 (32 IRQ sources) at DCR 0xc0 [0.00] UIC1 (32 IRQ sources) at DCR 0xd0 [0.00] UIC2 (32 IRQ sources) at DCR 0xe0 [0.00] UIC3 (32 IRQ sources) at DCR 0xf0 [0.14] clocksource: timebase: mask: 0x max_cycles: 0x10a60dda894, max_idle_ns: 440795207041 ns [0.26] clocksource: timebase mult[dda520] shift[24] registered [0.000153] Console: colour dummy device
[REGRESSION] [PATCH 09/22] drm: Clean up pending events in the core
Hey, Op 11-01-16 om 22:41 schreef Daniel Vetter: > There's really no reason to not do so, instead of replicating this > for every use-case and every driver. Now we can't just nuke the events, > since that would still mean that all drm_event users would need to know > when that has happened, since calling e.g. drm_send_event isn't allowed > any more. Instead just unlink them from the file, and detect this case > and handle it appropriately in all functions. > > v2: Adjust existing kerneldoc too. > > v3: Improve wording of the kerneldoc and split out vblank cleanup (Laurent). > > Cc: Alex Deucher > Cc: Laurent Pinchart > Acked-by: Daniel Stone > Reviewed-by: Alex Deucher (v1) > Signed-off-by: Daniel Vetter This patch breaks kms_flip.basic-flip-vs-wf_vblank and probably other tests as well. > drivers/gpu/drm/drm_fops.c | 30 +- > include/drm/drmP.h | 2 ++ > 2 files changed, 31 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c > index d85af1b2a238..109903f5b68a 100644 > --- a/drivers/gpu/drm/drm_fops.c > +++ b/drivers/gpu/drm/drm_fops.c > @@ -264,6 +264,7 @@ static int drm_open_helper(struct file *filp, struct > drm_minor *minor) > INIT_LIST_HEAD(&priv->fbs); > mutex_init(&priv->fbs_lock); > INIT_LIST_HEAD(&priv->blobs); > + INIT_LIST_HEAD(&priv->pending_event_list); > INIT_LIST_HEAD(&priv->event_list); > init_waitqueue_head(&priv->event_wait); > priv->event_space = 4096; /* set aside 4k for event buffer */ > @@ -366,6 +367,13 @@ static void drm_events_release(struct drm_file > *file_priv) > v->base.destroy(&v->base); > } > > + /* Unlink pending events */ > + list_for_each_entry_safe(e, et, &file_priv->pending_event_list, > + pending_link) { > + list_del(&e->pending_link); > + e->file_priv = NULL; > + } > + > /* Remove unconsumed events */ > list_for_each_entry_safe(e, et, &file_priv->event_list, link) { > list_del(&e->link); > @@ -712,6 +720,7 @@ int drm_event_reserve_init(struct drm_device *dev, > file_priv->event_space -= e->length; > > p->event = e; > + list_add(&p->pending_link, &file_priv->pending_event_list); > p->file_priv = file_priv; > > /* we *could* pass this in as arg, but everyone uses kfree: */ > @@ -736,7 +745,10 @@ void drm_event_cancel_free(struct drm_device *dev, > { > unsigned long flags; > spin_lock_irqsave(&dev->event_lock, flags); > - p->file_priv->event_space += p->event->length; > + if (p->file_priv) { > + p->file_priv->event_space += p->event->length; > + list_del(&p->pending_link); > + } > spin_unlock_irqrestore(&dev->event_lock, flags); > p->destroy(p); > } > @@ -750,11 +762,22 @@ EXPORT_SYMBOL(drm_event_cancel_free); > * This function sends the event @e, initialized with > drm_event_reserve_init(), > * to its associated userspace DRM file. Callers must already hold > * dev->event_lock, see drm_send_event() for the unlocked version. > + * > + * Note that the core will take care of unlinking and disarming events when > the > + * corresponding DRM file is closed. Drivers need not worry about whether the > + * DRM file for this event still exists and can call this function upon > + * completion of the asynchronous work unconditionally. > */ > void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event > *e) > { > assert_spin_locked(&dev->event_lock); > > + if (!e->file_priv) { > + e->destroy(e); > + return; > + } > + > + list_del(&e->pending_link); > list_add_tail(&e->link, > &e->file_priv->event_list); > wake_up_interruptible(&e->file_priv->event_wait); > @@ -769,6 +792,11 @@ EXPORT_SYMBOL(drm_send_event_locked); > * This function sends the event @e, initialized with > drm_event_reserve_init(), > * to its associated userspace DRM file. This function acquires > dev->event_lock, > * see drm_send_event_locked() for callers which already hold this lock. > + * > + * Note that the core will take care of unlinking and disarming events when > the > + * corresponding DRM file is closed. Drivers need not worry about whether the > + * DRM file for this event still exists and can call this function upon > + * completion of the asynchronous work unconditionally. > */ > void drm_send_event(struct drm_device *dev, struct drm_pending_event *e) > { > diff --git a/include/drm/drmP.h b/include/drm/drmP.h > index ae73abf5c2cf..3d78a7406d54 100644 > --- a/include/drm/drmP.h > +++ b/include/drm/drmP.h > @@ -283,6 +283,7 @@ struct drm_ioctl_desc { > struct drm_pending_event { > struct drm_event *event; > struct list_head link; > + struct list_head pending_link; > struct drm_file *file_priv; > pid_t pid; /*
[PATCH 3/3] vc4: Add headers and .pc files for VC4 userspace development.
On Mon, Jan 25, 2016 at 2:27 PM, Eric Anholt wrote: > The headers were originally written in Mesa, imported to the kernel, > and improved upon in vc4-gpu-tools. These come from the v-g-t copies > and will replace the Mesa and v-g-t copies, and hopefully be used from > new tests in igt, as well. > > Signed-off-by: Eric Anholt > --- > --- /dev/null > +++ b/vc4/libdrm_vc4.pc.in > @@ -0,0 +1,11 @@ > +prefix=@prefix@ > +exec_prefix=@exec_prefix@ > +libdir=@libdir@ > +includedir=@includedir@ > + > +Name: libdrm_vc4 > +Description: Userspace interface to vc4 kernel DRM services > +Version: @PACKAGE_VERSION@ > +Requires: libdrm > +Libs: -L${libdir} -ldrm_intel This probably wants to be -ldrm_vc4? Or nothing if there's no such lib yet? > +Cflags: -I${includedir} -I${includedir}/libdrm
[Bug 93648] Random lines being rendered when playing Dolphin (geometry shaders related, w/ apitrace)
https://bugs.freedesktop.org/show_bug.cgi?id=93648 Nicolai H�hnle changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #7 from Nicolai H�hnle --- The fix is now in Mesa master: commit 004fcd423011d45f746d571be47062feeea75455 Author: Nicolai H�hnle Date: Fri Jan 22 17:04:48 2016 -0500 radeonsi: ensure that VGT_GS_MODE is sent when necessary -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/9e7cb5fa/attachment.html>
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: > > > On 01/25/2016 05:15 AM, Michel Dänzer wrote: > > On 23.01.2016 00:18, Ville Syrjälä wrote: > >> On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: > >>> > >>> [ Trimming KDE folks from Cc ] > >>> > >>> On 21.01.2016 19:09, Daniel Vetter wrote: > On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: > > On 21.01.2016 16:58, Daniel Vetter wrote: > >> > >> Can you please point me at the vblank on/off jump bug please? > > > > AFAIR I originally reported it in response to > > http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html > > , but I can't find that in the archives, so maybe that was just on IRC. > > See > > http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html > > . Basically, I ran into the bug fixed by your patch because the counter > > jumped forward on every DPMS off, so it hit the 32-bit boundary after > > just a few days. > > Ok, so just uncovered the overflow bug. > >>> > >>> Not sure what you mean by "just", but to be clear: The drm_vblank_on/off > >>> counter jumping bug (similar to the bug this thread is about), which > >>> exposed the overflow bug, is still alive and kicking in 4.5. It seems > >>> to happen when turning off the CRTC: > >>> > >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: > >>> current=218104694, diff=0, hw=916 hw_last=916 > >>> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > >>> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 p(2199,-45)@ > >>> 7304.307354 -> 7304.308006 [e 0 us, 0 rep] > >>> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: > >>> current=218104694, diff=16776301, hw=1 hw_last=916 > >> > >> Not sure what bug we're talking about here, but here the hw counter > >> clearly jumps backwards. > >> > >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>> [drm:drm_update_vblank_count] updating vblank count on crtc 1: current=0, > >>> diff=0, hw=0 hw_last=0 > >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>> [drm:drm_update_vblank_count] updating vblank count on crtc 2: current=0, > >>> diff=0, hw=0 hw_last=0 > >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > >>> [drm:drm_update_vblank_count] updating vblank count on crtc 3: current=0, > >>> diff=0, hw=0 hw_last=0 > >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > >>> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ > >>> 7304.317140 -> 7304.317140 [e 0 us, 0 rep] > >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: > >>> current=234880995, diff=16777215, hw=0 hw_last=1 > >> > >> Same here. > > > > At least one of the jumps is expected, because this is around turning > > off the CRTC for DPMS off. Don't know yet why there are two jumps back > > though. > > > > > >> These things just don't happen on i915 because drm_vblank_off() and > >> drm_vblank_on() are always called around the times when the hw counter > >> might get reset. Or at least that's how it should be. > > > > Which is of course the idea of Daniel's patch (which is what I'm getting > > the above with) or Mario's patch as well, but clearly something's still > > wrong. It's certainly possible that it's something in the driver, but > > since calling drm_vblank_pre/post_modeset from the same places seems to > > work fine (ignoring the regression discussed in this thread)... Do > > drm_vblank_on/off require something else to handle this correctly? > > > > > > I suspect it is because vblank_disable_and_save calls > drm_update_vblank_count() unconditionally, even if vblank irqs are > already off. > > So on a manual display disable -> reenable you get something like > > At disable: > > Call to dpms-off --> atombios_crtc_dpms(DPMS_OFF) --> drm_vblank_off -> > vblank_disable_and_save -> irqs off, drm_update_vblank_count() computes > final count. > > Then the crtc is shut down and its hw counter resets to zero. > > At reenable: > > Modesetting -> drm_crtc_helper_set_mode -> crtc_funcs->prepare(crtc) -> > atombios_crtc_prepare() -> atombios_crtc_dpms(DPMS_OFF) -> > drm_vblank_off -> vblank_disable_and_save -> A pointless > drm_update_vblank_count() while the hw counter is already reset to zero > --> Unwanted counter jump. > > > The problem doesn't happen on a pure modeset to a different video > resolution/refresh rate, as then we only have one call into > atombios_crtc_dpms(DPMS_OFF). > > I think the fix is to fix vblank_disable_and_save() to only call > drm_update_vblan
[PATCH] GPU-host1x: Use a signed return type for do_relocs()
On Sat, Dec 19, 2015 at 12:56:54PM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sat, 19 Dec 2015 12:48:31 +0100 > > The return type "unsigned int" was used by the do_relocs() function > despite of the aspect that it will eventually return a negative error code. > Improve this implementation detail by deletion of the type qualifier then. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > drivers/gpu/host1x/job.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Good catch. Applied, thanks. Thierry -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/3de98e24/attachment.sig>
[PATCH] gpu: host1x: bus: Add missing of_node_put
On Sun, Jan 24, 2016 at 10:02:10PM +0530, Amitoj Kaur Chawla wrote: > for_each_child_of_node performs an of_node_get on each iteration, so > to break out of the loop an of_node_put is required. > > Found using Coccinelle. The semantic patch used for this is as follows: > > // > @@ > expression e; > local idexpression n; > @@ > > for_each_child_of_node(..., n) { >... when != of_node_put(n) >when != e = n > ( >return n; > | > + of_node_put(n); > ? return ...; > ) >... > } > // > > Signed-off-by: Amitoj Kaur Chawla > --- > drivers/gpu/host1x/bus.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Applied, thanks. Thierry -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/6d1a41b6/attachment-0001.sig>
[PATCH 0/5] Fixes for MST (daisy-chain and 4k tiles)
On 23 January 2016 at 08:07, Harry Wentland wrote: > A couple of MST fixes to bugs in the framework that we encountered when > testing with > - three-display daisy-chain configurations > - 4k tiled displays Hi Harry, these all look pretty good to me, have you tested them with lockdep enabled? I had started to fix the CSN/GUID one here a little while back but it's sitting on a laptop I can't access at the moment. But if you can test with lockdep, and it doesn't deadlock, then I'm happy to accept these.. Reviewed-by: Dave Airlie Dave. > > Andrey Grodzovsky (1): > drm/dp/mst: Reverse order of MST enable and clearing VC payload table. > > Harry Wentland (2): > drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil > drm/dp/mst: Calculate MST PBN with 31.32 fixed point > > Hersen Wu (1): > drm/dp/mst: move GUID storage from mgr, port to only mst branch > > Mykola Lysenko (1): > drm/dp/mst: change MST detection scheme > > drivers/gpu/drm/drm_dp_mst_topology.c | 180 > +- > include/drm/drm_dp_mst_helper.h | 25 ++--- > include/drm/drm_fixed.h | 54 +- > 3 files changed, 154 insertions(+), 105 deletions(-) > > -- > 2.1.4 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On 01/25/2016 02:23 PM, Ville Syrjälä wrote: > On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: >> >> >> On 01/25/2016 05:15 AM, Michel Dänzer wrote: >>> On 23.01.2016 00:18, Ville Syrjälä wrote: On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: > > [ Trimming KDE folks from Cc ] > > On 21.01.2016 19:09, Daniel Vetter wrote: >> On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: >>> On 21.01.2016 16:58, Daniel Vetter wrote: Can you please point me at the vblank on/off jump bug please? >>> >>> AFAIR I originally reported it in response to >>> http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html >>> , but I can't find that in the archives, so maybe that was just on IRC. >>> See >>> http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html >>> . Basically, I ran into the bug fixed by your patch because the counter >>> jumped forward on every DPMS off, so it hit the 32-bit boundary after >>> just a few days. >> >> Ok, so just uncovered the overflow bug. > > Not sure what you mean by "just", but to be clear: The drm_vblank_on/off > counter jumping bug (similar to the bug this thread is about), which > exposed the overflow bug, is still alive and kicking in 4.5. It seems > to happen when turning off the CRTC: > > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > current=218104694, diff=0, hw=916 hw_last=916 > [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 p(2199,-45)@ > 7304.307354 -> 7304.308006 [e 0 us, 0 rep] > [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > current=218104694, diff=16776301, hw=1 hw_last=916 Not sure what bug we're talking about here, but here the hw counter clearly jumps backwards. > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:drm_update_vblank_count] updating vblank count on crtc 1: current=0, > diff=0, hw=0 hw_last=0 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:drm_update_vblank_count] updating vblank count on crtc 2: current=0, > diff=0, hw=0 hw_last=0 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 > [drm:drm_update_vblank_count] updating vblank count on crtc 3: current=0, > diff=0, hw=0 hw_last=0 > [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ > 7304.317140 -> 7304.317140 [e 0 us, 0 rep] > [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 > [drm:drm_update_vblank_count] updating vblank count on crtc 0: > current=234880995, diff=16777215, hw=0 hw_last=1 Same here. >>> >>> At least one of the jumps is expected, because this is around turning >>> off the CRTC for DPMS off. Don't know yet why there are two jumps back >>> though. >>> >>> These things just don't happen on i915 because drm_vblank_off() and drm_vblank_on() are always called around the times when the hw counter might get reset. Or at least that's how it should be. >>> >>> Which is of course the idea of Daniel's patch (which is what I'm getting >>> the above with) or Mario's patch as well, but clearly something's still >>> wrong. It's certainly possible that it's something in the driver, but >>> since calling drm_vblank_pre/post_modeset from the same places seems to >>> work fine (ignoring the regression discussed in this thread)... Do >>> drm_vblank_on/off require something else to handle this correctly? >>> >>> >> >> I suspect it is because vblank_disable_and_save calls >> drm_update_vblank_count() unconditionally, even if vblank irqs are >> already off. >> >> So on a manual display disable -> reenable you get something like >> >> At disable: >> >> Call to dpms-off --> atombios_crtc_dpms(DPMS_OFF) --> drm_vblank_off -> >> vblank_disable_and_save -> irqs off, drm_update_vblank_count() computes >> final count. >> >> Then the crtc is shut down and its hw counter resets to zero. >> >> At reenable: >> >> Modesetting -> drm_crtc_helper_set_mode -> crtc_funcs->prepare(crtc) -> >> atombios_crtc_prepare() -> atombios_crtc_dpms(DPMS_OFF) -> >> drm_vblank_off -> vblank_disable_and_save -> A pointless >> drm_update_vblank_count() while the hw counter is already reset to zero >> --> Unwanted counter jump. >> >> >> The problem doesn't happen on a pure modeset to a different video >> resolution/refresh rate, as then we only have one call into >> atombios_crtc_dpms(DPMS_OFF). >> >> I think the fix is to f
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On 01/25/2016 05:15 AM, Michel Dänzer wrote: > On 23.01.2016 00:18, Ville Syrjälä wrote: >> On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: >>> >>> [ Trimming KDE folks from Cc ] >>> >>> On 21.01.2016 19:09, Daniel Vetter wrote: On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: > On 21.01.2016 16:58, Daniel Vetter wrote: >> >> Can you please point me at the vblank on/off jump bug please? > > AFAIR I originally reported it in response to > http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html > , but I can't find that in the archives, so maybe that was just on IRC. > See > http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html > . Basically, I ran into the bug fixed by your patch because the counter > jumped forward on every DPMS off, so it hit the 32-bit boundary after > just a few days. Ok, so just uncovered the overflow bug. >>> >>> Not sure what you mean by "just", but to be clear: The drm_vblank_on/off >>> counter jumping bug (similar to the bug this thread is about), which >>> exposed the overflow bug, is still alive and kicking in 4.5. It seems >>> to happen when turning off the CRTC: >>> >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=218104694, diff=0, hw=916 hw_last=916 >>> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 >>> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 p(2199,-45)@ >>> 7304.307354 -> 7304.308006 [e 0 us, 0 rep] >>> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=218104694, diff=16776301, hw=1 hw_last=916 >> >> Not sure what bug we're talking about here, but here the hw counter >> clearly jumps backwards. >> >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 1: current=0, >>> diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 2: current=0, >>> diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 3: current=0, >>> diff=0, hw=0 hw_last=0 >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 >>> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ >>> 7304.317140 -> 7304.317140 [e 0 us, 0 rep] >>> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 >>> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >>> current=234880995, diff=16777215, hw=0 hw_last=1 >> >> Same here. > > At least one of the jumps is expected, because this is around turning > off the CRTC for DPMS off. Don't know yet why there are two jumps back > though. > > >> These things just don't happen on i915 because drm_vblank_off() and >> drm_vblank_on() are always called around the times when the hw counter >> might get reset. Or at least that's how it should be. > > Which is of course the idea of Daniel's patch (which is what I'm getting > the above with) or Mario's patch as well, but clearly something's still > wrong. It's certainly possible that it's something in the driver, but > since calling drm_vblank_pre/post_modeset from the same places seems to > work fine (ignoring the regression discussed in this thread)... Do > drm_vblank_on/off require something else to handle this correctly? > > I suspect it is because vblank_disable_and_save calls drm_update_vblank_count() unconditionally, even if vblank irqs are already off. So on a manual display disable -> reenable you get something like At disable: Call to dpms-off --> atombios_crtc_dpms(DPMS_OFF) --> drm_vblank_off -> vblank_disable_and_save -> irqs off, drm_update_vblank_count() computes final count. Then the crtc is shut down and its hw counter resets to zero. At reenable: Modesetting -> drm_crtc_helper_set_mode -> crtc_funcs->prepare(crtc) -> atombios_crtc_prepare() -> atombios_crtc_dpms(DPMS_OFF) -> drm_vblank_off -> vblank_disable_and_save -> A pointless drm_update_vblank_count() while the hw counter is already reset to zero --> Unwanted counter jump. The problem doesn't happen on a pure modeset to a different video resolution/refresh rate, as then we only have one call into atombios_crtc_dpms(DPMS_OFF). I think the fix is to fix vblank_disable_and_save() to only call drm_update_vblank_count() if vblank irqs get actually disabled, not on no-op calls. I will try that now. Otherwise kms drivers would have to be careful to never call drm_vblank_off multiple times before calling drm_vblank_on, but the help text to drm_vblank_on() claims that unbalanced calls to
[PATCH v6 0/1] Introduce Innosilicon HDMI driver on Rockchip platforms
Am Montag, 25. Januar 2016, 09:43:17 schrieb Yakir Yang: > Here are a brief introduction to Innosilicon HDMI IP: > - Support HDMI 1.4a, HDCP 1.2 and DVI 1.0 standard compliant transmitter > - Support HDMI1.4 a/b 3D function defined in HDMI 1.4 a/b spec > - Digital video interface supports a pixel size of 24, 30, 36, 48bits > color depth in RGB - S/PDIF output supports PCM, Dolby Digital, DTS digital > audio transmission (32-192kHz Fs) using IEC60958 and IEC 61937 > - The EDID and CEC function are also supported by Innosilicon HDMI > Transmitter Controlle have you lost separate the devicetree-binding patch somewhere? I don't remember it getting applied and Mark may miss it if it's only contained in some old series. Heiko
linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon
On 23.01.2016 00:18, Ville Syrjälä wrote: > On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: >> >> [ Trimming KDE folks from Cc ] >> >> On 21.01.2016 19:09, Daniel Vetter wrote: >>> On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: On 21.01.2016 16:58, Daniel Vetter wrote: > > Can you please point me at the vblank on/off jump bug please? AFAIR I originally reported it in response to http://lists.freedesktop.org/archives/dri-devel/2015-August/087841.html , but I can't find that in the archives, so maybe that was just on IRC. See http://lists.freedesktop.org/archives/dri-devel/2016-January/099122.html . Basically, I ran into the bug fixed by your patch because the counter jumped forward on every DPMS off, so it hit the 32-bit boundary after just a few days. >>> >>> Ok, so just uncovered the overflow bug. >> >> Not sure what you mean by "just", but to be clear: The drm_vblank_on/off >> counter jumping bug (similar to the bug this thread is about), which >> exposed the overflow bug, is still alive and kicking in 4.5. It seems >> to happen when turning off the CRTC: >> >> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >> current=218104694, diff=0, hw=916 hw_last=916 >> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 >> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x7 p(2199,-45)@ >> 7304.307354 -> 7304.308006 [e 0 us, 0 rep] >> [drm:radeon_get_vblank_counter_kms] crtc 0: dist from vblank start 3 >> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >> current=218104694, diff=16776301, hw=1 hw_last=916 > > Not sure what bug we're talking about here, but here the hw counter > clearly jumps backwards. > >> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >> [drm:drm_update_vblank_count] updating vblank count on crtc 1: current=0, >> diff=0, hw=0 hw_last=0 >> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >> [drm:drm_update_vblank_count] updating vblank count on crtc 2: current=0, >> diff=0, hw=0 hw_last=0 >> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >> [drm:radeon_get_vblank_counter_kms] Query failed! stat 3 >> [drm:drm_update_vblank_count] updating vblank count on crtc 3: current=0, >> diff=0, hw=0 hw_last=0 >> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 >> [drm:drm_calc_vbltimestamp_from_scanoutpos] crtc 0 : v 0x1 p(0,0)@ >> 7304.317140 -> 7304.317140 [e 0 us, 0 rep] >> [drm:radeon_get_vblank_counter_kms] Query failed! stat 1 >> [drm:drm_update_vblank_count] updating vblank count on crtc 0: >> current=234880995, diff=16777215, hw=0 hw_last=1 > > Same here. At least one of the jumps is expected, because this is around turning off the CRTC for DPMS off. Don't know yet why there are two jumps back though. > These things just don't happen on i915 because drm_vblank_off() and > drm_vblank_on() are always called around the times when the hw counter > might get reset. Or at least that's how it should be. Which is of course the idea of Daniel's patch (which is what I'm getting the above with) or Mario's patch as well, but clearly something's still wrong. It's certainly possible that it's something in the driver, but since calling drm_vblank_pre/post_modeset from the same places seems to work fine (ignoring the regression discussed in this thread)... Do drm_vblank_on/off require something else to handle this correctly? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer
[PATCH 13/13] dt/bindings: drm/msm/hdmi: Add hdmi phy bindings
On 1/22/2016 4:56 AM, Rob Herring wrote: > On Thu, Jan 21, 2016 at 12:39:41PM +0530, Archit Taneja wrote: >> Add hdmi phy bindings. Update the example to use hdmi phy. >> >> Add a missing power-domains property in the hdmi core bindings. >> >> Cc: devicetree at vger.kernel.org >> Cc: Rob Herring >> >> Signed-off-by: Archit Taneja >> --- >> .../devicetree/bindings/display/msm/hdmi.txt | 39 >> +- >> 1 file changed, 38 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/devicetree/bindings/display/msm/hdmi.txt >> b/Documentation/devicetree/bindings/display/msm/hdmi.txt >> index 379ee2e..21590ee 100644 >> --- a/Documentation/devicetree/bindings/display/msm/hdmi.txt >> +++ b/Documentation/devicetree/bindings/display/msm/hdmi.txt >> @@ -11,6 +11,7 @@ Required properties: >> - reg: Physical base address and length of the controller's registers >> - reg-names: "core_physical" >> - interrupts: The interrupt signal from the hdmi block. >> +- power-domains: Should be <&mmcc MDSS_GDSC>. >> - clocks: device clocks >> See ../clocks/clock-bindings.txt for details. >> - qcom,hdmi-tx-ddc-clk-gpio: ddc clk pin >> @@ -18,6 +19,7 @@ Required properties: >> - qcom,hdmi-tx-hpd-gpio: hpd pin >> - core-vdda-supply: phandle to supply regulator >> - hdmi-mux-supply: phandle to mux regulator >> +- qcom,dsi-phy: phandle to HDMI PHY device node > > dsi? Sorry, this is a typo. It should be qcom,hdmi-phy. > > Why does this not use the phy binding? The PHY in the HDMI and DSI blocks can't be implemented using the common phy framework. The PHY blocks have a PLL sub-block within them which acts as a pixel clock source for the display processor block. This dependency causes the need to split the phy power on sequence into 2 parts (one to enable resources to enable the PLL, and the other to enable the phy itself), which the phy framework can't do. That's the main reason not to use it. There are some more complex use cases for DSI PHY (drive two PHYs with the same DSI PLL) which the phy framework can't support. Thanks, Archit > > Rob > -- > To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
[PATCH] drm/etnaviv: fix memory leak in IOMMU init path
Plug in error handling to free any allocated ressources in the IOMMU init path. Signed-off-by: Lucas Stach --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 92e80c0c5b55..d212319a173d 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -588,12 +588,10 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu) goto fail; } - /* TODO: we will leak here memory - fix it! */ - gpu->mmu = etnaviv_iommu_new(gpu, iommu, version); if (!gpu->mmu) { ret = -ENOMEM; - goto fail; + goto free_domain; } /* Create buffer: */ @@ -601,7 +599,7 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu) if (!gpu->buffer) { ret = -ENOMEM; dev_err(gpu->dev, "could not create command buffer\n"); - goto fail; + goto destroy_iommu; } if (gpu->buffer->paddr - gpu->memory_base > 0x8000) { ret = -EINVAL; @@ -631,6 +629,11 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu) free_buffer: etnaviv_gpu_cmdbuf_free(gpu->buffer); gpu->buffer = NULL; +destroy_iommu: + etnaviv_iommu_destroy(gpu->mmu); + gpu->mmu = NULL; +free_domain: + iommu_domain_free(iommu); fail: pm_runtime_mark_last_busy(gpu->dev); pm_runtime_put_autosuspend(gpu->dev); -- 2.7.0.rc3
[PATCH v2] drm/i915: Remove select to deleted STOP_MACHINE from Kconfig
Commit 5bab6f60cb4d ("drm/i915: Serialise updates to GGTT with access through GGTT on Braswell") depended upon a working stop_machine() and so forced the selection of STOP_MACHINE. However, commit 86fffe4a61dd ("kernel: remove stop_machine() Kconfig dependency") removed the option STOP_MACHINE from init/Kconfig and ensured that stop_machine() universally works. Due to the order in which the patches were applied, removing the select from DRM_I915 got lost during merging. Remove the now obsolete select statement. Signed-off-by: Andreas Ziegler Reviewed-by: Chris Wilson --- Changes to v1: - Tell the story right, suggested by Chris Wilson drivers/gpu/drm/i915/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index fcd77b2..051eab3 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -10,7 +10,6 @@ config DRM_I915 # the shmem_readpage() which depends upon tmpfs select SHMEM select TMPFS - select STOP_MACHINE select DRM_KMS_HELPER select DRM_PANEL select DRM_MIPI_DSI -- 1.9.1
[PATCH 00/11] sync framework de-staging: part 1 - clean up
Hey, Op 21-01-16 om 13:49 schreef Gustavo Padovan: > From: Gustavo Padovan > > Hi, > > The following patches are some clean ups on the sync framework before > we start the actual de-staging. The main changes here are the move of > SW_SYNC_USER to debugfs. Removal of struct sync_pt in favor of direct > use of struct fence. And the rename of sync_fence to sync_file, a name > to better reflect what it is for, a struct that connects struct fence(s) > to a file. > > Please review. Thanks. > > Gustavo Padovan (11): > staging/android: fix sync framework documentation > staging/android: sync: remove interfaces that are not used > staging/android: remove not used sync_timeline ops > staging/android: create a 'sync' dir for debugfs information > staging/android: move SW_SYNC_USER to a debugfs file > staging/android: rename sync_fence to sync_file > staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb > staging/android: remove struct sync_pt > staging/android: remove unused var from sync_timeline_signal() > staging/android: remove pointless sync_timeline_signal at destroy > phase > staging/android: remove sync_fence_create_dma() > For whole series: Reviewed-by: Maarten Lankhorst Renaming sync_fence to sync_file makes sense, it should hopefully reduce confusion.
[PATCH] drm/i915: Remove select to deleted STOP_MACHINE from Kconfig
Commit 86fffe4a61dd ("kernel: remove stop_machine() Kconfig dependency") removed the option STOP_MACHINE from init/Kconfig, but missed a select to this option from the DRM_I915 option. Remove this now obsolete select statement. Signed-off-by: Andreas Ziegler --- drivers/gpu/drm/i915/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index fcd77b2..051eab3 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -10,7 +10,6 @@ config DRM_I915 # the shmem_readpage() which depends upon tmpfs select SHMEM select TMPFS - select STOP_MACHINE select DRM_KMS_HELPER select DRM_PANEL select DRM_MIPI_DSI -- 1.9.1
[PATCH 1/2] drm/rockchip: Don't build rockchip_drm_vop as modules
Am Montag, 25. Januar 2016, 11:54:07 schrieb Sjoerd Simons: > On Wed, 2016-01-13 at 16:22 +0800, Mark Yao wrote: > > rockchip_drm_vop's module init had moved to rockchip_vop_reg.c > > so no need to build rockchip_drm_vop.ko > > Looks like this didn't make it for the Linux 4.5 merge window, which > unfortunately means in 4.5-rc1 DRM on rockchip is broken :/ but it is in the fixes pull request Mark sent to Dave on friday
[PATCH 0/5] Etnaviv updates
Am Sonntag, den 24.01.2016, 17:35 + schrieb Russell King - ARM Linux: > Here's some updates to etnaviv, which augment the features and GPU > specifications which we export to userspace. This will allow us to > fix the (currently incorrect) number of varyings that GPUs such as > GC880 and GC2000 supposedly have. > > While making this change, I'm also increasing the number of feature > words we export up to the largest number known from the current > Vivante galcore code. > > drivers/gpu/drm/etnaviv/common.xml.h | 59 ++-- > drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 161 > ++--- > drivers/gpu/drm/etnaviv/etnaviv_gpu.h | 9 ++ > drivers/gpu/drm/etnaviv/state_hi.xml.h | 26 +- > include/uapi/drm/etnaviv_drm.h | 3 + > 5 files changed, 196 insertions(+), 62 deletions(-) > I've applied this series with the prefix changed to drm/etnaviv. Thanks, Lucas -- Pengutronix e.K. | Lucas Stach | Industrial Linux Solutions | http://www.pengutronix.de/ |
[PATCH 3/5] drm: etnaviv: add helper to extract bitfields
Am Sonntag, den 24.01.2016, 17:35 + schrieb Russell King: > Add a helper to extract etnaviv bitfields from register values. > > Acked-by: Christian Gmeiner > Signed-off-by: Russell King Applied with the following folded in. If you are not okay with this please speak up. ->8 diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 1269b6316c51..5fd3110d9691 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -296,12 +296,10 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) chipIdentity = gpu_read(gpu, VIVS_HI_CHIP_IDENTITY); /* Special case for older graphic cores. */ - if (((chipIdentity & VIVS_HI_CHIP_IDENTITY_FAMILY__MASK) ->> VIVS_HI_CHIP_IDENTITY_FAMILY__SHIFT) == 0x01) { + if (etnaviv_field(chipIdentity, VIVS_HI_CHIP_IDENTITY_FAMILY) == 0x01) { gpu->identity.model= chipModel_GC500; - gpu->identity.revision = - (chipIdentity & VIVS_HI_CHIP_IDENTITY_REVISION__MASK) - >> VIVS_HI_CHIP_IDENTITY_REVISION__SHIFT; + gpu->identity.revision = etnaviv_field(chipIdentity, +VIVS_HI_CHIP_IDENTITY_REVISION); } else { gpu->identity.model = gpu_read(gpu, VIVS_HI_CHIP_MODEL); -- Pengutronix e.K. | Lucas Stach | Industrial Linux Solutions | http://www.pengutronix.de/ |
[PATCH] drm/i915: refine qemu south bridge detection
Hi, > 0x1af4 != 0x1a4f Good catch, new patch sent. thanks, Gerd
[PATCH v2] drm/i915: refine qemu south bridge detection
The test for the qemu q35 south bridge added by commit "39bfcd52 drm/i915: more virtual south bridge detection" also matches on real hardware. Having the check for virtual systems last in the list is not enough to avoid that ... Refine the check by additionally verifying the pci subsystem id to see whenever it *really* is qemu. [ v2: fix subvendor tyops ] Reported-by: Bjørn Mork Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/i915/i915_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 3ac616d..f357058 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -501,7 +501,9 @@ void intel_detect_pch(struct drm_device *dev) WARN_ON(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev)); } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) || - (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE)) { + ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) && + pch->subsystem_vendor == 0x1af4 && + pch->subsystem_device == 0x1100)) { dev_priv->pch_type = intel_virt_detect_pch(dev); } else continue; -- 1.8.3.1
[PATCH 1/2] drm/rockchip: Don't build rockchip_drm_vop as modules
On Wed, 2016-01-13 at 16:22 +0800, Mark Yao wrote: > rockchip_drm_vop's module init had moved to rockchip_vop_reg.c > so no need to build rockchip_drm_vop.ko Looks like this didn't make it for the Linux 4.5 merge window, which unfortunately means in 4.5-rc1 DRM on rockchip is broken :/ > Signed-off-by: Mark Yao > --- > Â drivers/gpu/drm/rockchip/Makefile |Â Â Â Â 5 ++--- > Â 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/Makefile > b/drivers/gpu/drm/rockchip/Makefile > index a9d380f..9e6e992 100644 > --- a/drivers/gpu/drm/rockchip/Makefile > +++ b/drivers/gpu/drm/rockchip/Makefile > @@ -3,9 +3,8 @@ > Â # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. > Â > Â rockchipdrm-y := rockchip_drm_drv.o rockchip_drm_fb.o > rockchip_drm_fbdev.o \ > - rockchip_drm_gem.o > + rockchip_drm_gem.o rockchip_drm_vop.o > Â > Â obj-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o > Â > -obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o rockchip_drm_vop.o \ > - rockchip_vop_reg.o > +obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o rockchip_vop_reg.o -- Sjoerd Simons Collabora Ltd.
[PATCH 3/3] vc4: Add headers and .pc files for VC4 userspace development.
The headers were originally written in Mesa, imported to the kernel, and improved upon in vc4-gpu-tools. These come from the v-g-t copies and will replace the Mesa and v-g-t copies, and hopefully be used from new tests in igt, as well. Signed-off-by: Eric Anholt --- Makefile.am | 6 + configure.ac | 19 +++ vc4/Makefile.am | 34 + vc4/Makefile.sources | 3 + vc4/libdrm_vc4.pc.in | 11 ++ vc4/vc4_packet.h | 397 ++ vc4/vc4_qpu_defines.h | 274 ++ 7 files changed, 744 insertions(+) create mode 100644 vc4/Makefile.am create mode 100644 vc4/Makefile.sources create mode 100644 vc4/libdrm_vc4.pc.in create mode 100644 vc4/vc4_packet.h create mode 100644 vc4/vc4_qpu_defines.h diff --git a/Makefile.am b/Makefile.am index ca41508..feecba7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,6 +29,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \ --enable-radeon \ --enable-amdgpu \ --enable-nouveau \ + --enable-vc4 \ --enable-vmwgfx \ --enable-omap-experimental-api \ --enable-exynos-experimental-api \ @@ -79,6 +80,10 @@ if HAVE_TEGRA TEGRA_SUBDIR = tegra endif +if HAVE_VC4 +VC4_SUBDIR = vc4 +endif + if BUILD_MANPAGES if HAVE_MANPAGES_STYLESHEET MAN_SUBDIR = man @@ -96,6 +101,7 @@ SUBDIRS = \ $(EXYNOS_SUBDIR) \ $(FREEDRENO_SUBDIR) \ $(TEGRA_SUBDIR) \ + $(VC4_SUBDIR) \ tests \ $(MAN_SUBDIR) diff --git a/configure.ac b/configure.ac index a09be61..4dc5394 100644 --- a/configure.ac +++ b/configure.ac @@ -126,6 +126,11 @@ AC_ARG_ENABLE(tegra-experimental-api, [Enable support for Tegra's experimental API (default: disabled)]), [TEGRA=$enableval], [TEGRA=no]) +AC_ARG_ENABLE(vc4, + AS_HELP_STRING([--disable-vc4], + [Enable support for vc4's API (default: auto, enabled on arm)]), + [VC4=$enableval], [VC4=auto]) + AC_ARG_ENABLE(install-test-programs, AS_HELP_STRING([--enable-install-test-programs], [Install test programs (default: no)]), @@ -290,6 +295,12 @@ else *) FREEDRENO=no ;; esac fi + if test "x$VC4" = xauto; then + case $host_cpu in + arm*|aarch64) VC4=yes ;; + *) VC4=no ;; + esac + fi fi if test "x$INTEL" != "xno"; then @@ -396,6 +407,11 @@ if test "x$TEGRA" = xyes; then AC_DEFINE(HAVE_TEGRA, 1, [Have Tegra support]) fi +AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) +if test "x$VC4" = xyes; then + AC_DEFINE(HAVE_VC4, 1, [Have VC4 support]) +fi + AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes]) if test "x$INSTALL_TESTS" = xyes; then AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs]) @@ -505,6 +521,8 @@ AC_CONFIG_FILES([ freedreno/libdrm_freedreno.pc tegra/Makefile tegra/libdrm_tegra.pc + vc4/Makefile + vc4/libdrm_vc4.pc tests/Makefile tests/modeprint/Makefile tests/modetest/Makefile @@ -535,4 +553,5 @@ echo " OMAP API $OMAP" echo " EXYNOS API $EXYNOS" echo " Freedreno API $FREEDRENO (kgsl: $FREEDRENO_KGSL)" echo " Tegra API $TEGRA" +echo " VC4 API$VC4" echo "" diff --git a/vc4/Makefile.am b/vc4/Makefile.am new file mode 100644 index 000..7e486b4 --- /dev/null +++ b/vc4/Makefile.am @@ -0,0 +1,34 @@ +# Copyright © 2016 Broadcom +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +include Makefile.sources + +AM_CFLAGS = \ + $(WARN_CFLAGS) \ + -I$(top_srcdir) \ + $(PTHREADSTUBS_CFLAGS) \ + $(VALGRIND_CFLAGS) \ + -I$(top_srcdir)/include/drm + +libdrm_vc4includedir = ${includedir}/libdrm +libdrm_vc4include_HEADERS = $(LIBDRM_V
[PATCH 2/3] util: Add support for vc4.
This lets allows using modetest for overlay plane testing. Signed-off-by: Eric Anholt --- tests/util/kms.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/util/kms.c b/tests/util/kms.c index 57b0191..4038c36 100644 --- a/tests/util/kms.c +++ b/tests/util/kms.c @@ -139,6 +139,7 @@ static const char * const modules[] = { "imx-drm", "rockchip", "atmel-hlcdc", + "vc4", }; int util_open(const char *device, const char *module) -- 2.6.4
[PATCH 1/3] vc4: Add the DRM header file.
I'll build some libdrm C code soon, but for lets libdrm users use vc4 ioctls. Produced from headers_install of 1df59b8497f47495e873c23abd6d3d290c730505 (drm-next) in the kernel. Signed-off-by: Eric Anholt --- Makefile.sources | 1 + include/drm/vc4_drm.h | 279 ++ 2 files changed, 280 insertions(+) create mode 100644 include/drm/vc4_drm.h diff --git a/Makefile.sources b/Makefile.sources index a77f48d..1a1f0fe 100644 --- a/Makefile.sources +++ b/Makefile.sources @@ -32,6 +32,7 @@ LIBDRM_INCLUDE_H_FILES := \ include/drm/savage_drm.h \ include/drm/sis_drm.h \ include/drm/tegra_drm.h \ + include/drm/vc4_drm.h \ include/drm/via_drm.h LIBDRM_INCLUDE_VMWGFX_H_FILES := \ diff --git a/include/drm/vc4_drm.h b/include/drm/vc4_drm.h new file mode 100644 index 000..da3caa0 --- /dev/null +++ b/include/drm/vc4_drm.h @@ -0,0 +1,279 @@ +/* + * Copyright © 2014-2015 Broadcom + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef _VC4_DRM_H_ +#define _VC4_DRM_H_ + +#include "drm.h" + +#define DRM_VC4_SUBMIT_CL 0x00 +#define DRM_VC4_WAIT_SEQNO0x01 +#define DRM_VC4_WAIT_BO 0x02 +#define DRM_VC4_CREATE_BO 0x03 +#define DRM_VC4_MMAP_BO 0x04 +#define DRM_VC4_CREATE_SHADER_BO 0x05 +#define DRM_VC4_GET_HANG_STATE0x06 + +#define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) +#define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) +#define DRM_IOCTL_VC4_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_BO, struct drm_vc4_wait_bo) +#define DRM_IOCTL_VC4_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_BO, struct drm_vc4_create_bo) +#define DRM_IOCTL_VC4_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo) +#define DRM_IOCTL_VC4_CREATE_SHADER_BODRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) +#define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) + +struct drm_vc4_submit_rcl_surface { + __u32 hindex; /* Handle index, or ~0 if not present. */ + __u32 offset; /* Offset to start of buffer. */ + /* +* Bits for either render config (color_write) or load/store packet. +* Bits should all be 0 for MSAA load/stores. +*/ + __u16 bits; + +#define VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES(1 << 0) + __u16 flags; +}; + +/** + * struct drm_vc4_submit_cl - ioctl argument for submitting commands to the 3D + * engine. + * + * Drivers typically use GPU BOs to store batchbuffers / command lists and + * their associated state. However, because the VC4 lacks an MMU, we have to + * do validation of memory accesses by the GPU commands. If we were to store + * our commands in BOs, we'd need to do uncached readback from them to do the + * validation process, which is too expensive. Instead, userspace accumulates + * commands and associated state in plain memory, then the kernel copies the + * data to its own address space, and then validates and stores it in a GPU + * BO. + */ +struct drm_vc4_submit_cl { + /* Pointer to the binner command list. +* +* This is the first set of commands executed, which runs the +* coordinate shader to determine where primitives land on the screen, +* then writes out the state updates and draw calls necessary per tile +* to the tile allocation BO. +*/ + __u64 bin_cl; + + /* Pointer to the shader records. +* +* Shader records are the structures read by th
[PATCH] drm/i915: Remove select to deleted STOP_MACHINE from Kconfig
On Mon, Jan 25, 2016 at 12:14:41PM +0100, Andreas Ziegler wrote: > Commit 86fffe4a61dd ("kernel: remove stop_machine() Kconfig > dependency") removed the option STOP_MACHINE from init/Kconfig, but > missed a select to this option from the DRM_I915 option. The select didn't exist on the branch on which the patch was applied, so it couldn't remove it. Commit 5bab6f60cb4 ("drm/i915: Serialise updates to GGTT with access through GGTT on Braswel") depended upon a working stop_machine() and so forced its selection. However, commit 86fffe4a61dd ("kernel: remove stop_machine() Kconfig dependency") removed the option STOP_MACHINE from init/Kconfig and ensured that stop_machine() universally works. Remove this now obsolete select statement. > Signed-off-by: Andreas Ziegler With a little bit of story correction, Revieweed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre
[BUG/REGRESSION] Kernel 4.5-rc1 on Acube Sam460ex AMCC 460ex Power PC motherboards
On Mon, Jan 25, 2016 at 4:46 AM, Julian Margetson wrote: > Oops starting Xorg with kernel 4.5-rc1 on Acube Sam460ex amcc460ex powerpc > motherboard. > > == > 01c8f1c44b83a0825b573e7c723b033cece37b86 is the first bad commit > commit 01c8f1c44b83a0825b573e7c723b033cece37b86 > Author: Dan Williams > Date: Fri Jan 15 16:56:40 2016 -0800 > > mm, dax, gpu: convert vm_insert_mixed to pfn_t > > Convert the raw unsigned long 'pfn' argument to pfn_t for the purpose of > evaluating the PFN_MAP and PFN_DEV flags. When both are set it triggers > _PAGE_DEVMAP to be set in the resulting pte. > > There are no functional changes to the gpu drivers as a result of this > conversion. > > Signed-off-by: Dan Williams > Cc: Dave Hansen > Cc: David Airlie > Signed-off-by: Andrew Morton > Signed-off-by: Linus Torvalds > > :04 04 dc71b6dc188dea4b6ce95f5fd1e4e73cc3663cbe > 8a745459a14cd2a6f4e1c71fda3e54333d023f43 M arch > :04 04 9e8103b65698f677e17becdac53914ca029a6197 > f656e15bffef4ea8c848176a79eb50a071ec323e M drivers > :04 04 3ffc222d7e0f1067772798d08777aeb54136026e > e2b423f85aaaf0cb25d48d1e15771fc5bddf7981 M fs > :04 04 392d2dea8185ba8f0d1c101782831ceed9aa9812 > 9e3001b04052daa1b3204b6f2a6e26138a4ed7dd M include > :04 04 f81d8cfe3052b7259b75a58656a65efdaad40284 > 969d0ff262020f27a695172ce89ae5f6088e8d44 M mm > Hmm, this commit could only cause a behavior change if it modifies the value of the pfn as seen by insert_pfn(). Can you try the attached debug patch to see if that assumption is being violated? -- next part -- A non-text attachment was scrubbed... Name: pfn-debug.patch Type: text/x-patch Size: 1303 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/07c32d1f/attachment-0001.bin>
[PATCH] drm/radeon: Ensure radeon bo is unreserved in radeon_gem_va_ioctl
On Mon, Jan 25, 2016 at 10:38 AM, Christian König wrote: > Am 25.01.2016 um 16:34 schrieb Matthew Dawson: >> >> Found with lockdep while testing gpu reset. >> >> Signed-off-by: Matthew Dawson > > > Reviewed-by: Christian König Applied. Thanks! Alex > >> --- >> drivers/gpu/drm/radeon/radeon_gem.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c >> b/drivers/gpu/drm/radeon/radeon_gem.c >> index 3dcc573..e26c963 100644 >> --- a/drivers/gpu/drm/radeon/radeon_gem.c >> +++ b/drivers/gpu/drm/radeon/radeon_gem.c >> @@ -663,6 +663,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void >> *data, >> bo_va = radeon_vm_bo_find(&fpriv->vm, rbo); >> if (!bo_va) { >> args->operation = RADEON_VA_RESULT_ERROR; >> + radeon_bo_unreserve(rbo); >> drm_gem_object_unreference_unlocked(gobj); >> return -ENOENT; >> } > > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 5/5] drm/imx: ipuv3 plane: Replace dev_info with dev_dbg if a plane's CRTC changes
Hi Liu, Am Freitag, den 22.01.2016, 10:29 +0800 schrieb Liu Ying: > Hi Philipp, > > 2015-11-23 19:48 GMT+08:00 Philipp Zabel : > > Am Freitag, den 20.11.2015, 16:14 +0800 schrieb Liu Ying: > >> This patch changes the dev_info() call to dev_dbg() in ipu_plane_update() > >> to print out the information that a plane's CRTC is changed, because this > >> kind of information is only useful for debugging. > >> > >> Signed-off-by: Liu Ying > >> --- > >> This patch applies to the imx-drm/fixes branch of Philipp Zabel's open git. > >> > >> drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c > >> b/drivers/gpu/drm/imx/ipuv3-plane.c > >> index b3ed207..b24bf94 100644 > >> --- a/drivers/gpu/drm/imx/ipuv3-plane.c > >> +++ b/drivers/gpu/drm/imx/ipuv3-plane.c > >> @@ -338,7 +338,7 @@ static int ipu_update_plane(struct drm_plane *plane, > >> struct drm_crtc *crtc, > >> } > >> > >> if (crtc != plane->crtc) > >> - dev_info(plane->dev->dev, "crtc change: %p -> %p\n", > >> + dev_dbg(plane->dev->dev, "crtc change: %p -> %p\n", > >> plane->crtc, crtc); > >> plane->crtc = crtc; > > > > This change is separate from the others, I have applied it. > > I don't find this patch on any imx-drm branch in your open git repository. > Do I miss anything? It's in the imx-drm/next branch, I have waited for v4.5-rc1 before pushing it. regards Philipp
[PATCH] drm/radeon: Ensure radeon bo is unreserved in radeon_gem_va_ioctl
Found with lockdep while testing gpu reset. Signed-off-by: Matthew Dawson --- drivers/gpu/drm/radeon/radeon_gem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 3dcc573..e26c963 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -663,6 +663,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data, bo_va = radeon_vm_bo_find(&fpriv->vm, rbo); if (!bo_va) { args->operation = RADEON_VA_RESULT_ERROR; + radeon_bo_unreserve(rbo); drm_gem_object_unreference_unlocked(gobj); return -ENOENT; } -- 2.7.0
[PATCH] drm/i915: refine qemu south bridge detection
On Mon, 25 Jan 2016, Gerd Hoffmann wrote: > The test for the qemu q35 south bridge added by commit > "39bfcd52 drm/i915: more virtual south bridge detection" > also matches on real hardware. Having the check for > virtual systems last in the list is not enough to avoid > that ... > > Refine the check by additionally verifying the pci > subsystem id to see whenever it *really* is qemu. > > Reported-by: Bjørn Mork > Signed-off-by: Gerd Hoffmann Already sent the revert in [1], but I'm fine with this if it works for Bjørn. BR, Jani. [1] http://mid.gmane.org/1453710360-30099-1-git-send-email-jani.nikula at intel.com > --- > drivers/gpu/drm/i915/i915_drv.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c > index 3ac616d..9668162 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -501,7 +501,9 @@ void intel_detect_pch(struct drm_device *dev) > WARN_ON(!IS_SKYLAKE(dev) && > !IS_KABYLAKE(dev)); > } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) || > -(id == INTEL_PCH_QEMU_DEVICE_ID_TYPE)) { > +((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) && > + pch->subsystem_vendor == 0x1a4f && > + pch->subsystem_device == 0x1100)) { > dev_priv->pch_type = intel_virt_detect_pch(dev); > } else > continue; -- Jani Nikula, Intel Open Source Technology Center
[PATCH] drm/i915: refine qemu south bridge detection
Jani Nikula writes: > On Mon, 25 Jan 2016, Gerd Hoffmann wrote: >> The test for the qemu q35 south bridge added by commit >> "39bfcd52 drm/i915: more virtual south bridge detection" >> also matches on real hardware. Having the check for >> virtual systems last in the list is not enough to avoid >> that ... >> >> Refine the check by additionally verifying the pci >> subsystem id to see whenever it *really* is qemu. >> >> Reported-by: Bjørn Mork >> Signed-off-by: Gerd Hoffmann > > Already sent the revert in [1], but I'm fine with this if it works for > Bjørn. Gerd's fix works fine for me (of course). Tested it now just to be 100% sure, although it was pretty obvious from the code that it would have the same effect as an revert on my system. But I have a feeling Gerd might want to send you a v2 of it in any case... I was curious about this QEMU subsystem vendor ID, so I went grepping for it - and found nothing! |> + pch->subsystem_vendor == 0x1a4f && |> + pch->subsystem_device == 0x1100)) { Looks like a typo: bjorn at nemi:/usr/local/src/git/qemu$ git grep PCI_SUBVENDOR_ID_REDHAT_QUMRANET hw/pci/pci.c:static uint16_t pci_default_sub_vendor_id = PCI_SUBVENDOR_ID_REDHAT_QUMRANET; include/hw/pci/pci.h:#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 0x1af4 != 0x1a4f Thanks a lot both of you for a really fast fix. But it seems Gerd was a little too fast :) Bjørn
[PATCH v6] drm/rockchip: hdmi: add Innosilicon HDMI support
The Innosilicon HDMI is a low power HDMI 1.4 transmitter IP, and it have been integrated on some rockchip CPUs (like RK3036, RK312x). Signed-off-by: Yakir Yang --- Changes in v6: - Rebase the Makefile/Kconfig files which add by Chris's rockchip-mipi driver (Caeser) Changes in v5: - Use hdmi_infoframe helper functions to packed the infoframe (Russell) - Remove the unused double wait_for_completion_timeout for ddc transfer (Russell) - Remove the unused local variable in "inno_hdmi_i2c_write()" function (Russell) Changes in v4: - Modify the commit title "drm/rockchip: hdmi: ..." (Mark) - Correct the "DKMS" to "DPMS" (Mark) - Fix over 80 characters problems (Mark) - Remove encoder .prepare/.commit helper functions, and move the vop mode configure function into encoder .enable helper functions. (Mark) Changes in v3: - Use encoder enable/disable function, and remove the encoder DPMS function - Keep HDMI PLL power on in standby mode Changes in v2: - Using DRM atomic helper functions for connector init (Mark) - Remove "hdmi->connector.encoder = encoder;" (Mark) drivers/gpu/drm/rockchip/Kconfig | 8 + drivers/gpu/drm/rockchip/Makefile| 1 + drivers/gpu/drm/rockchip/inno_hdmi.c | 941 +++ drivers/gpu/drm/rockchip/inno_hdmi.h | 362 ++ 4 files changed, 1312 insertions(+) create mode 100644 drivers/gpu/drm/rockchip/inno_hdmi.c create mode 100644 drivers/gpu/drm/rockchip/inno_hdmi.h diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig index 8573985..e15bf47 100644 --- a/drivers/gpu/drm/rockchip/Kconfig +++ b/drivers/gpu/drm/rockchip/Kconfig @@ -35,3 +35,11 @@ config ROCKCHIP_DW_MIPI_DSI for the Synopsys DesignWare HDMI driver. If you want to enable MIPI DSI on RK3288 based SoC, you should selet this option. + +config ROCKCHIP_INNO_HDMI + tristate "Rockchip specific extensions for Innosilicon HDMI" +depends on DRM_ROCKCHIP +help + This selects support for Rockchip SoC specific extensions + for the Innosilicon HDMI driver. If you want to enable + HDMI on RK3036 based SoC, you should selet this option. diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/rockchip/Makefile index f6a809a..df8fbef 100644 --- a/drivers/gpu/drm/rockchip/Makefile +++ b/drivers/gpu/drm/rockchip/Makefile @@ -8,5 +8,6 @@ rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += rockchip_drm_fbdev.o obj-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o obj-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o +obj-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o rockchip_vop_reg.o diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c new file mode 100644 index 000..4da3020 --- /dev/null +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -0,0 +1,941 @@ +/* + * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd + *Zheng Yang + *Yakir Yang + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "rockchip_drm_drv.h" +#include "rockchip_drm_vop.h" + +#include "inno_hdmi.h" + +#define to_inno_hdmi(x)container_of(x, struct inno_hdmi, x) + +struct hdmi_data_info { + int vic; + bool sink_is_hdmi; + bool sink_has_audio; + unsigned int enc_in_format; + unsigned int enc_out_format; + unsigned int colorimetry; +}; + +struct inno_hdmi_i2c { + struct i2c_adapter adap; + + u8 ddc_addr; + u8 segment_addr; + + struct mutex lock; + struct completion cmp; +}; + +struct inno_hdmi { + struct device *dev; + struct drm_device *drm_dev; + + int irq; + struct clk *pclk; + void __iomem *regs; + + struct drm_connectorconnector; + struct drm_encoder encoder; + + struct inno_hdmi_i2c *i2c; + struct i2c_adapter *ddc; + + unsigned int tmds_rate; + + struct hdmi_data_info hdmi_data; + struct drm_display_mode previous_mode; +}; + +enum { + CSC_ITU601_16_235_TO_RGB_0_255_8BIT, + CSC_ITU601_0_255_TO_RGB_0_255_8BIT, + CSC_ITU709_16_235_TO_RGB_0_255_8BIT, + CSC_RGB_0_255_TO_ITU601_16_235_8BIT, + CSC_RGB_0_255_TO_ITU709_16_235_8BIT, + CSC_RGB_0_255_TO_RGB_16_235_8BIT, +}; + +static const char coeff_csc[][24] = { + /* +* YUV2RGB:601 SD mode(Y[16:235
[PATCH v6 0/1] Introduce Innosilicon HDMI driver on Rockchip platforms
Here are a brief introduction to Innosilicon HDMI IP: - Support HDMI 1.4a, HDCP 1.2 and DVI 1.0 standard compliant transmitter - Support HDMI1.4 a/b 3D function defined in HDMI 1.4 a/b spec - Digital video interface supports a pixel size of 24, 30, 36, 48bits color depth in RGB - S/PDIF output supports PCM, Dolby Digital, DTS digital audio transmission (32-192kHz Fs) using IEC60958 and IEC 61937 - The EDID and CEC function are also supported by Innosilicon HDMI Transmitter Controlle Changes in v6: - Rebase the Makefile/Kconfig files which add by Chris's rockchip-mipi driver (Caeser) Changes in v5: - Use hdmi_infoframe helper functions to packed the infoframe (Russell) - Remove the unused double wait_for_completion_timeout for ddc transfer (Russell) - Remove the unused local variable in "inno_hdmi_i2c_write()" function (Russell) Changes in v4: - Modify the commit title "drm/rockchip: hdmi: ..." (Mark) - Correct the "DKMS" to "DPMS" (Mark) - Fix over 80 characters problems (Mark) - Remove encoder .prepare/.commit helper functions, and move the vop mode configure function into encoder .enable helper functions. (Mark) Changes in v3: - Use encoder enable/disable function, and remove the encoder DPMS function - Keep HDMI PLL power on in standby mode Changes in v2: - Using DRM atomic helper functions for connector init (Mark) - Remove "hdmi->connector.encoder = encoder;" (Mark) Yakir Yang (1): drm/rockchip: hdmi: add Innosilicon HDMI support drivers/gpu/drm/rockchip/Kconfig | 8 + drivers/gpu/drm/rockchip/Makefile| 1 + drivers/gpu/drm/rockchip/inno_hdmi.c | 941 +++ drivers/gpu/drm/rockchip/inno_hdmi.h | 362 ++ 4 files changed, 1312 insertions(+) create mode 100644 drivers/gpu/drm/rockchip/inno_hdmi.c create mode 100644 drivers/gpu/drm/rockchip/inno_hdmi.h -- 1.9.1
[RFC libdrm] intel: Add support for softpin
On Wed, Sep 09, 2015 at 04:07:10PM +0200, MichaÅ Winiarski wrote: > Softpin allows userspace to take greater control of GPU virtual address > space and eliminates the need of relocations. It can also be used to > mirror addresses between GPU and CPU (shared virtual memory). > Calls to drm_intel_bo_emit_reloc are still required to build the list of > drm_i915_gem_exec_objects at exec time, but no entries in relocs are > created. Self-relocs don't make any sense for softpinned objects and can > indicate a programming errors, thus are forbidden. Softpinned objects > are marked by asterisk in debug dumps. This patch gets the kernel interface wrong. > static int > +drm_intel_gem_bo_add_softpin_target(drm_intel_bo *bo, drm_intel_bo > *target_bo) > +{ > + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; > + drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; > + drm_intel_bo_gem *target_bo_gem = (drm_intel_bo_gem *) target_bo; > + if (bo_gem->has_error) > + return -ENOMEM; > + > + if (target_bo_gem->has_error) { > + bo_gem->has_error = true; > + return -ENOMEM; > + } > + > + if (!target_bo_gem->is_softpin) > + return -EINVAL; > + if (target_bo_gem == bo_gem) > + return -EINVAL; > + > + if (bo_gem->softpin_target_count == bo_gem->softpin_target_size) { > + int new_size = bo_gem->softpin_target_size * 2; > + if (new_size == 0) > + new_size = bufmgr_gem->max_relocs; > + > + bo_gem->softpin_target = realloc(bo_gem->softpin_target, > new_size * > + sizeof(drm_intel_bo *)); > + if (!bo_gem->softpin_target) > + return -ENOMEM; > + > + bo_gem->softpin_target_size = new_size; > + } > + bo_gem->softpin_target[bo_gem->softpin_target_count] = target_bo; > + drm_intel_gem_bo_reference(target_bo); > + bo_gem->softpin_target_count++; > + > + return 0; > +} Short-circuiting the reloc handling like this is broken without instructing the kernel via the alternative mechanisms about the special handling the buffer requires EXEC_OBJECT_WRITE, EXEC_OBJECT_NEEDS_GTT). > void > drm_intel_gem_bo_clear_relocs(drm_intel_bo *bo, int start) > @@ -1998,6 +2084,12 @@ drm_intel_gem_bo_clear_relocs(drm_intel_bo *bo, int > start) > } > bo_gem->reloc_count = start; > > + for (i = 0; i < bo_gem->softpin_target_count; i++) { > + drm_intel_bo_gem *target_bo_gem = (drm_intel_bo_gem *) > bo_gem->softpin_target[i]; > + drm_intel_gem_bo_unreference_locked_timed(&target_bo_gem->bo, > time.tv_sec); > + } > + bo_gem->softpin_target_count = 0; This would have better pursued using a batch manager. -Chris -- Chris Wilson, Intel Open Source Technology Centre
Build regressions/improvements in v4.5-rc1
On Mon, Jan 25, 2016 at 9:18 AM, Geert Uytterhoeven wrote: > Below is the list of build error/warning regressions/improvements in > v4.5-rc1[1] compared to v4.4[2]. > > Summarized: > - build errors: +15/-23 > [1] http://kisskb.ellerman.id.au/kisskb/head/9841/ (all 261 configs) > [2] http://kisskb.ellerman.id.au/kisskb/head/9774/ (259 out of 261 configs) > > > *** ERRORS *** > > 15 error regressions: > + /home/kisskb/slave/src/arch/sh/drivers/dma/dma-sh.c: error: 'DMTE6_IRQ' > undeclared (first use in this function): => 58:21 sh-randconfig > + /home/kisskb/slave/src/drivers/gpu/drm/vc4/vc4_v3d.c: error: called > object '0u' is not a function: => 157:29, 159:27 cris-allmodconfig cris-allyesconfig m32r/m32700ut.smp_defconfig m68k-allmodconfig parisc-allmodconfig sh-randconfig xtensa-allmodconfig > + /home/kisskb/slave/src/sound/core/compress_offload.c: error: case label > does not reduce to an integer constant: => 804:2 ppc64le/allmodconfig+ppc64le > + /tmp/ccDC0dZh.s: Error: can't resolve `_start' {*UND* section} - `L0 ' > {.text section}: => 378, 49 > + /tmp/ccGniXga.s: Error: can't resolve `_start' {*UND* section} - `L0 ' > {.text section}: => 43 > + /tmp/ccci5ABy.s: Error: can't resolve `_start' {*UND* section} - `L0 ' > {.text section}: => 366, 49 > + /tmp/cccq2wZf.s: Error: can't resolve `_start' {*UND* section} - `L0 ' > {.text section}: => 43 > + /tmp/cchnfEGb.s: Error: can't resolve `_start' {*UND* section} - `L0 ' > {.text section}: => 43 (reported before) mips-allnoconfig mips-defconfig ip27_defconfig > + error: No rule to make target include/config/auto.conf: => N/A arm-randconfig (reported before) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
[PATCH v3 1/2] drm: rockchip/hdmi: add Innosilicon HDMI support
Hi Caesar, On 01/24/2016 03:34 PM, Caesar Wang wrote: > Hi > > å¨ 2016å¹´01æ18æ¥ 09:21, Mark yao åé: >> Hi Yakir >> >> I'd like you can change your patch title into "drm/rockchip/hdmi", so >> when I search patches use "drm/rockchip" can find your patch. >> >> and I have some advices mail inline. >> >> Thanks:-) >> >> On 2016å¹´01æ15æ¥ 17:38, Yakir Yang wrote: >>> The Innosilicon HDMI is a low power HDMI 1.4 transmitter >>> IP, and it have been integrated on some rockchip CPUs >>> (like RK3036, RK312x). >>> >>> Signed-off-by: Yakir Yang >>> --- >>> Changes in v3: >>> - Use encoder enable/disable function, and remove the encoder DPMS >>> function >>> - Keep HDMI PLL power on in standby mode >>> >>> Changes in v2: >>> - Using DRM atomic helper functions for connector init (Mark) >>> - Remove "hdmi->connector.encoder = encoder;" (Mark) >>> >>> drivers/gpu/drm/rockchip/Kconfig | 8 + >>> drivers/gpu/drm/rockchip/Makefile| 1 + >>> drivers/gpu/drm/rockchip/inno_hdmi.c | 999 >>> +++ >>> drivers/gpu/drm/rockchip/inno_hdmi.h | 364 + >>> 4 files changed, 1372 insertions(+) >>> create mode 100644 drivers/gpu/drm/rockchip/inno_hdmi.c >>> create mode 100644 drivers/gpu/drm/rockchip/inno_hdmi.h >>> >>> diff --git a/drivers/gpu/drm/rockchip/Kconfig >>> b/drivers/gpu/drm/rockchip/Kconfig >>> index 35215f6..a5014e0 100644 >>> --- a/drivers/gpu/drm/rockchip/Kconfig >>> +++ b/drivers/gpu/drm/rockchip/Kconfig >>> @@ -25,3 +25,11 @@ config ROCKCHIP_DW_HDMI >>> for the Synopsys DesignWare HDMI driver. If you want to >>> enable HDMI on RK3288 based SoC, you should selet this >>> option. >>> + >>> +config ROCKCHIP_INNO_HDMI >>> +tristate "Rockchip specific extensions for Innosilicon HDMI" >>> +depends on DRM_ROCKCHIP >>> +help >>> + This selects support for Rockchip SoC specific extensions >>> + for the Innosilicon HDMI driver. If you want to enable >>> + HDMI on RK3036 based SoC, you should selet this option. > > That's seem has some conflicts since the MIPI driver land in mainline. > So you need update it based on the lastest kernel. > Yep, thanks for your reminder, need to update the patch. And by the way the latest version of this patch have been updated to v5 :) https://patchwork.kernel.org/patch/8058061/ >>> diff --git a/drivers/gpu/drm/rockchip/Makefile >>> b/drivers/gpu/drm/rockchip/Makefile >>> index a9d380f..da2bf76 100644 >>> --- a/drivers/gpu/drm/rockchip/Makefile >>> +++ b/drivers/gpu/drm/rockchip/Makefile >>> @@ -6,6 +6,7 @@ rockchipdrm-y := rockchip_drm_drv.o >>> rockchip_drm_fb.o rockchip_drm_fbdev.o \ >>> rockchip_drm_gem.o >>> obj-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o >>> +obj-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o >>> obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o rockchip_drm_vop.o \ >>> rockchip_vop_reg.o >>> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c >>> b/drivers/gpu/drm/rockchip/inno_hdmi.c >>> new file mode 100644 >>> index 000..dc98179 >>> --- /dev/null >>> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c >>> @@ -0,0 +1,999 @@ >>> +/* >>> + * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd >>> + *Zheng Yang >>> + *Yakir Yang >>> + * >>> + * This software is licensed under the terms of the GNU General Public >>> + * License version 2, as published by the Free Software Foundation, >>> and >>> + * may be copied, distributed, and modified under those terms. >>> + * >>> + * This program is distributed in the hope that it will be useful, >>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >>> + * GNU General Public License for more details. >>> + */ >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#include "rockchip_drm_drv.h" >>> +#include "rockchip_drm_vop.h" >>> + >>> +#include "inno_hdmi.h" >>> + >>> +#define to_inno_hdmi(x)container_of(x, struct inno_hdmi, x) >>> + >>> +struct hdmi_data_info { >>> +int vic; >>> +bool sink_is_hdmi; >>> +bool sink_has_audio; >>> +unsigned int enc_in_format; >>> +unsigned int enc_out_format; >>> +unsigned int colorimetry; >>> +}; >>> + >>> +struct inno_hdmi_i2c { >>> +struct i2c_adapter adap; >>> + >>> +u8 ddc_addr; >>> +u8 segment_addr; >>> + >>> +struct mutex lock; >>> +struct completion cmp; >>> +}; >>> + >>> +struct inno_hdmi { >>> +struct device *dev; >>> +struct drm_device *drm_dev; >>> + >>> +int irq; >>> +struct clk *pclk; >>> +void __iomem *regs; >>> + >>> +struct drm_connectorconnector; >>> +struct drm_encoderencoder; >>> + >>> +struct inno_hdmi_i2c *i2c; >>> +struct i2c_ada
[PATCH] drm/i915: refine qemu south bridge detection
The test for the qemu q35 south bridge added by commit "39bfcd52 drm/i915: more virtual south bridge detection" also matches on real hardware. Having the check for virtual systems last in the list is not enough to avoid that ... Refine the check by additionally verifying the pci subsystem id to see whenever it *really* is qemu. Reported-by: Bjørn Mork Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/i915/i915_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 3ac616d..9668162 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -501,7 +501,9 @@ void intel_detect_pch(struct drm_device *dev) WARN_ON(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev)); } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) || - (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE)) { + ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) && + pch->subsystem_vendor == 0x1a4f && + pch->subsystem_device == 0x1100)) { dev_priv->pch_type = intel_virt_detect_pch(dev); } else continue; -- 1.8.3.1
[PATCH 00/22] drm_event cleanup, round 2
On Mon, Jan 11, 2016 at 10:40:54PM +0100, Daniel Vetter wrote: > Hi all, > > Mostly just small changes from review feedback (plus a few misplaced hunks, > silly me). Plus an attempt at better kerneldoc to explain how this works. > Since > that caused questions both from Thomas and Laurent let me explain things also > here: > > Currently anyone using drm_events (vblank code, atomic/legacy flips, drivers > like exynos) need to handle event setup, sending to the drm file and handling > when the drm file disappears themselves. This patch series provides functions > to > encapsulate all these steps. Furthermore the file closing is handled > differently: Events are no longer completely destroyed in preclose hooks like > all current users do, but instead they're just unlinked from the file. The new > drm_send_event can still be called, but instead of transmitting the event to > the > file it'll destroy it right away. > > This means that when the drm file disappears it's entirely transparent to > drivers, and we can remove all the special tracking and cleanup code around > preclose functions. > > The other consequence is that it's opt-in - drivers are still free to remove > events explicitly when the file disappears, it's just needless code. Which > means > the patch series can be split up really nicely into core parts + driver > patches. > The only patch I didn't split up in this fashion is the one that creates > drm_send_event - it's imo easier to review this way, and the driver changes > are > really simple. -rc1 is out, so I pulled this all into drm-misc. Thanks a lot for all the reviews&comments. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[BUG/REGRESSION] Kernel 4.5-rc1 on Acube Sam460ex AMCC 460ex Power PC motherboards
#1 [ 54.372186] task: ecf92280 ti: ee042000 task.ti: ee042000 [ 54.377880] NIP: 1fc9e484 LR: 1fc9e404 CTR: 1fc9e4d0 [ 54.383123] REGS: ee043f10 TRAP: 0214 Tainted: G D (4.5.0-rc1-Sam460ex) [ 54.391567] MSR: 0002f900 CR: 44004242 XER: 2000 [ 54.398712] GPR00: 1f162134 bff30c20 b78dc6f0 b709effc b68b5008 0778 0004 GPR08: b709effc bff30bd0 1fc9e404 20539ff4 0780 GPR16: 0020 1e00 20bee650 0438 b68b5008 GPR24: 0780 bff30c78 20bd8760 b709f000 b709f000 b68b5008 1fda6ff4 1e00 [ 54.430563] NIP [1fc9e484] 0x1fc9e484 [ 54.434424] LR [1fc9e404] 0x1fc9e404 [ 54.438198] Call Trace: [ 54.440782] ---[ end trace ef11bac1eb629228 ]--- [ 54.445404] [ 57.821361] Machine check in kernel mode. [ 57.825399] Data Write PLB Error [ 57.828625] Machine Check exception is imprecise [ 57.833251] Vector: 214 at [ecf59f10] [ 57.837001] pc: 201be480 [ 57.839917] lr: 201be404 [ 57.842835] sp: bff7cf20 [ 57.845717]msr: 2f900 [ 57.848339] current = 0xecf905c0 [ 57.851742] pid = 689, comm = Xorg [ 57.855668] Linux version 4.5.0-rc1-Sam460ex (root at julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #1 PREEMPT Sun Jan 24 19:50:54 AST 2016 [ 57.869593] enter ? for help [ 57.872479] mon> [ 59.875768] Oops: Machine check, sig: 7 [#4] [ 59.880290] PREEMPT Canyonlands [ 59.883616] Modules linked in: [ 59.886860] CPU: 0 PID: 689 Comm: Xorg Tainted: G D 4.5.0-rc1-Sam460ex #1 [ 59.895216] task: ecf905c0 ti: ecf58000 task.ti: ecf58000 [ 59.900917] NIP: 201be480 LR: 201be404 CTR: 201be4d0 [ 59.906152] REGS: ecf59f10 TRAP: 0214 Tainted: G D (4.5.0-rc1-Sam460ex) [ 59.914596] MSR: 0002f900 CR: 24004242 XER: [ 59.921741] GPR00: 1f682134 bff7cf20 b7c926f0 b7454ffc b6c6b008 0780 0004 GPR08: b7454ffc bff7ced0 201be404 20a59ff4 0780 GPR16: 0020 1e00 20d97650 0438 b6c6b008 GPR24: 0780 bff7cf78 20d81730 b7455000 b7455000 b6c6b008 202c6ff4 1e00 [ 60.039495] NIP [201be480] 0x201be480 [ 60.060632] LR [201be404] 0x201be404 [ 60.081524] Call Trace: [ 60.101070] ---[ end trace ef11bac1eb629229 ]--- [ 60.105691] [ 64.041702] Machine check in kernel mode. [ 64.045736] Data Write PLB Error [ 64.048963] Machine Check exception is imprecise [ 64.053589] Vector: 214 at [ecd7bf10] [ 64.057340] pc: 20090484 [ 64.060256] lr: 20090404 [ 64.063173] sp: bf821230 [ 64.066055]msr: 2f900 [ 64.068677] current = 0xee647980 [ 64.072081] pid = 751, comm = Xorg [ 64.076006] Linux version 4.5.0-rc1-Sam460ex (root at julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #1 PREEMPT Sun Jan 24 19:50:54 AST 2016 [ 64.089932] enter ? for help [ 64.092818] mon> -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/81eda922/attachment-0001.html>
[Bug 93826] 144Hz graphic glitches and bad refresh rate
https://bugs.freedesktop.org/show_bug.cgi?id=93826 --- Comment #14 from Damien --- Grub uses the old VGA driver and can not handle the 290x @144hz. It's the same issue with the opensource which works correctly only @60 Hz... I fixed the problem by forcing a resolution with grub. But impossible to solve the issue with the xf86-video-ati driver. Also tried the git version. Remember, no issue with windows & linux with Catalyst fglrx driver so I do not trust a hardware issue. There must be a diff�rence in refresh rate management if catalyst wedge to 144Hz immediately after installation while the opensource driver made a bizarre 139Hz with artifacts (see attachments). Can be an important point to clarify: I use DisplayPort 1.2. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/1a2654b1/attachment.html>
[PATCH] PCI: QEMU top-level IDs for (sub)vendor & device
Introduce PCI_VENDOR/PCI_SUBVENDOR/PCI_SUBDEVICE defines to replace the constants scattered in the kernel already used to detect QEMU. They are defined in the QEMU codebase per docs/specs/pci-ids.txt. Signed-off-by: Robin H. Johnson --- This change prompted by a near-miss in the review of recent change: 'drm/i915: refine qemu south bridge detection' Signed-off-by: Robin H. Johnson --- drivers/gpu/drm/bochs/bochs_drv.c | 4 ++-- drivers/gpu/drm/cirrus/cirrus_drv.c | 5 +++-- drivers/virtio/virtio_pci_common.c | 2 +- include/linux/pci_ids.h | 4 sound/pci/intel8x0.c| 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 7f1a360..b332b4d3 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b/drivers/gpu/drm/bochs/bochs_drv.c @@ -182,8 +182,8 @@ static const struct pci_device_id bochs_pci_tbl[] = { { .vendor = 0x1234, .device = 0x, - .subvendor = 0x1af4, - .subdevice = 0x1100, + .subvendor = PCI_SUBVENDOR_ID_REDHAT_QUMRANET, + .subdevice = PCI_SUBDEVICE_ID_QEMU, .driver_data = BOCHS_QEMU_STDVGA, }, { diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index b1619e2..7bc394e 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c @@ -33,8 +33,9 @@ static struct drm_driver driver; /* only bind to the cirrus chip in qemu */ static const struct pci_device_id pciidlist[] = { - { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, 0x1af4, 0x1100, 0, - 0, 0 }, + { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, + PCI_SUBVENDOR_ID_REDHAT_QUMRANET, PCI_SUBDEVICE_ID_QEMU, + 0, 0, 0 }, { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, PCI_VENDOR_ID_XEN, 0x0001, 0, 0, 0 }, {0,} diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 36205c2..127dfe4 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -467,7 +467,7 @@ static const struct dev_pm_ops virtio_pci_pm_ops = { /* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */ static const struct pci_device_id virtio_pci_id_table[] = { - { PCI_DEVICE(0x1af4, PCI_ANY_ID) }, + { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) }, { 0 } }; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 37f05cb..6d249d3 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2506,6 +2506,10 @@ #define PCI_VENDOR_ID_AZWAVE 0x1a3b +#define PCI_VENDOR_ID_REDHAT_QUMRANET0x1af4 +#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 +#define PCI_SUBDEVICE_ID_QEMU0x1100 + #define PCI_VENDOR_ID_ASMEDIA 0x1b21 #define PCI_VENDOR_ID_CIRCUITCO0x1cc8 diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 42bcbac..12c2c18 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2980,8 +2980,8 @@ static int snd_intel8x0_inside_vm(struct pci_dev *pci) goto fini; /* check for known (emulated) devices */ - if (pci->subsystem_vendor == 0x1af4 && - pci->subsystem_device == 0x1100) { + if (pci->subsystem_vendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET && + pci->subsystem_device == PCI_SUBDEVICE_ID_QEMU) { /* KVM emulated sound, PCI SSID: 1af4:1100 */ msg = "enable KVM"; } else if (pci->subsystem_vendor == 0x1ab8) { -- 2.3.0
[PATCH] drm/fbdev-helper: Explain how to debug console_lock fun
On Sun, Jan 24, 2016 at 10:33:57PM +0200, Laurent Pinchart wrote: > Hi Daniel, > > Thank you for the patch. > > On Friday 22 January 2016 08:53:45 Daniel Vetter wrote: > > Every new KMS driver writer seems to run into this and wonder how > > exactly drm_fb_helper_initial_config can die doing nothing at all. > > Set up some big warnings signs around this newbie trap to avoid future > > frustration and wasting everyone's time. > > > > Cc: Carlos Palminha > > Cc: Xinliang Liu > > Cc: laurent.pinchart at ideasonboard.com > > Signed-off-by: Daniel Vetter > > --- > > drivers/gpu/drm/drm_fb_helper.c | 22 ++ > > 1 file changed, 22 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_fb_helper.c > > b/drivers/gpu/drm/drm_fb_helper.c index 1e103c4c6ee0..9bf84b227613 100644 > > --- a/drivers/gpu/drm/drm_fb_helper.c > > +++ b/drivers/gpu/drm/drm_fb_helper.c > > @@ -2091,6 +2091,28 @@ out: > > * drm_fb_helper_fill_fix() are provided as helpers to setup simple default > > * values for the fbdev info structure. > > * > > + * HANG DEBUGGING: > > + * > > + * When you have fbcon support built-in or already loaded, this function > > will do > > + * a full modeset to setup the fbdev console. And due to locking misdesign > > No need to start the sentence with "And", s/And due/Due/ will do. > > > in > > + * the VT/fbdev subsystem that entire modeset sequence has to be done while > > + * holding console_lock. And until console_unlock is called no dmesg lines > > Same here. > > > will > > + * be sent out to consoles, not even serial console. Which means when your > > Similarly, s/Which means when/This means that if/ > > > + * driver crashes, you will see absolutely nothing else but a system stuck > > in > > + * this function, with no further output. And any kind of printk() you > > s/And any/Any/ > > Apart from that, > > Reviewed-by: Laurent Pinchart Thanks for the review, added your changes and merged the patch. > Very useful addition to the documentation, I got bitten by this more than > once. I wonder whether we could make this information even easier to find. I figured most likely when debugging hangs you will notice eventually that the hang is in this function and then stumble over the kerneldoc. Everywhere else it will probably get ignored. That's why I placed it here. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH v2 13/26] drm/fb_cma_helper: Remove implicit call to disable_unused_functions
On Mon, Jan 25, 2016 at 12:19:27AM +0200, Laurent Pinchart wrote: > Hi Daniel, > > On Friday 15 January 2016 11:17:30 Daniel Vetter wrote: > > On Fri, Jan 15, 2016 at 01:13:05AM +0200, Laurent Pinchart wrote: > > > On Thursday 14 January 2016 16:24:56 Maxime Ripard wrote: > > >> The drm_fbdev_cma_init function always calls the > > >> drm_helper_disable_unused_functions. Since it's part of the usual probe > > >> process, all the drivers using that helper will end up having their > > >> encoder and CRTC disable functions called at probe if their device has > > >> not been reported as enabled. > > >> > > >> This could be fixed by reading out from the registers the current state > > >> of the device if it is enabled, but even that will not handle the case > > >> where the device is actually disabled. > > >> > > >> Moreover, the drivers using the atomic modesetting expect that their > > >> enable and disable callback to be called when the device is already > > >> enabled or disabled (respectively). > > >> > > >> We can however fix this issue by moving the call to > > >> drm_helper_disable_unused_functions out of drm_fbdev_cma_init and make > > >> the drivers needing it (all the drivers calling drm_fbdev_cma_init and > > >> not using the atomic modesetting) explicitly call it. > > > > > > I'd rather add it to all drivers that call drm_fbdev_cma_init(). All the > > > atomic ones must have special code to cope with it that could be rendered > > > useless by the removal of the drm_helper_disable_unused_functions() call. > > > That code should be removed too, and it would be easier to check drivers > > > one by one and fixing them individually (outside of this patch series, > > > unless you insist ;-)) when removing the explicit > > > drm_helper_disable_unused_functions() call. > > > > I had the same thought, but figured there's really no good reason ever to > > do this. I suspect most of that disable_unused_function stuff we have all > > over is supreme cargo-cult anyway ;-) > > I'm not sure you got my point. Yes, the drm_helper_disable_unused_functions() > call should be removed from atomic drivers, but that will leave support code > added for the sole reason of avoiding the crash in the drivers. That code > will > likely not be noticed and will stay there rotting. If we added > drm_helper_disable_unused_functions() calls to all atomic drivers then driver > authors will hopefully check carefully if there's any support code that can > be > removed when removing the function call. It would act as a kind of FIXME > reminder. drm_helper_disable_unused_functions() already prefers the ->disable callbacks over dpms, like atomic helpers. I don't think there's any dead code due to this change. The problem was that driver/hw blew up since it was disabled when the hw was off already. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[Bug 93826] 144Hz graphic glitches and bad refresh rate
https://bugs.freedesktop.org/show_bug.cgi?id=93826 --- Comment #13 from Michel D�nzer --- grub doesn't use this driver, so there might be a hardware/VBIOS issue. Maybe the other drivers work around that somehow. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20160125/d8b67d28/attachment-0001.html>
[PATCH 10/22] drm: Nuke vblank event file cleanup code
Hi Daniel, Thank you for the patch. On Monday 11 January 2016 22:41:04 Daniel Vetter wrote: > The core code now takes care of unlinking drm_events from the file in > a generic way, so this code isn't needed any more. > > For those wondering where the drm_vblank_put went to: With the new > logic events only get unlinked, but still exist. Hence any resources > (like vblank counters) don't need to be released since the event user > will still process the event normally. In this case this is the > callsites of send_vblank_event, which of course already have a > drm_vblank_put. > > Cc: Laurent Pinchart > Acked-by: Daniel Stone > Reviewed-by: Alex Deucher > Signed-off-by: Daniel Vetter Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/drm_fops.c | 9 - > 1 file changed, 9 deletions(-) > > diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c > index 109903f5b68a..faae642390a6 100644 > --- a/drivers/gpu/drm/drm_fops.c > +++ b/drivers/gpu/drm/drm_fops.c > @@ -354,19 +354,10 @@ static void drm_events_release(struct drm_file > *file_priv) { > struct drm_device *dev = file_priv->minor->dev; > struct drm_pending_event *e, *et; > - struct drm_pending_vblank_event *v, *vt; > unsigned long flags; > > spin_lock_irqsave(&dev->event_lock, flags); > > - /* Remove pending flips */ > - list_for_each_entry_safe(v, vt, &dev->vblank_event_list, base.link) > - if (v->base.file_priv == file_priv) { > - list_del(&v->base.link); > - drm_vblank_put(dev, v->pipe); > - v->base.destroy(&v->base); > - } > - > /* Unlink pending events */ > list_for_each_entry_safe(e, et, &file_priv->pending_event_list, >pending_link) { -- Regards, Laurent Pinchart
[Bug 105041] System constantly freezes up when waking from suspend2ram
https://bugzilla.kernel.org/show_bug.cgi?id=105041 Aaron Lu changed: What|Removed |Added Status|NEEDINFO|ASSIGNED Component|Hibernation/Suspend |Video(DRI - non Intel) Assignee|rjw at rjwysocki.net |drivers_video-dri at kernel-bu ||gs.osdl.org Product|Power Management|Drivers --- Comment #13 from Aaron Lu --- Then I'm moving this bug to Drivers/DRM-non-intel for nouveau people to take a look. -- You are receiving this mail because: You are watching the assignee of the bug.