Re: XDC 2017 : Call for paper
On Tue, Jun 6, 2017 at 4:19 PM, Martin Pereswrote: > Hello, > > I have the pleasure to announce that the X.org Developer Conference 2017 > will be held in Mountain View, California from September 20th to > September 22nd. The venue is located at the Googleplex. > > The official page for the event is http://www.x.org/wiki/Events/XDC2017 > while the call for paper is at http://www.x.org/wiki/Other/Press/CFP2017/ > > As usual, we are open to talks across the layers of the graphics stack, > from the kernel to desktop environments / graphical applications and > about how to make things better for the developers who build them. > Given that the conference is located at Google, we would welcome topics > related to Android and Chromebooks. We would also like to hear about > Virtual Reality and end-to-end buffer format negociation. If you're not > sure if something might fit, mail me or add it to the ideas list found > in the program page. > > The conference is free of charge and open to the general public. If > you plan on coming, please add yourself to the attendees list. We'll > use this list to make badges and plan for the catering, so if you are > attending please add your name as early as possible. > > I am looking forward to seeing you there. If you have any > inquiries/questions, please send them to Stéphane Marchesin (please also > CC: board at foundation.x.org). Hi all, For logistical reasons, we would like to be able to finalize the attendee list by September 8. If at all possible, please register on the wiki (or email me if you don't have access and I will add you). Thanks, Stéphane > > Martin Peres ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 99292] GPU hang in High Fidelity
https://bugs.freedesktop.org/show_bug.cgi?id=99292 Christoph Haagchanged: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #6 from Christoph Haag --- Just tried it again and it does not hang the GPU now. They changed the starting environment to another one and had many commits since I last tried, so could be the driver or the app who fixed it. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 1/2] drm/gem: drm_gem_dumb_map_offset(): reject dma-buf
Daniel Vetterwrites: > On Fri, Aug 18, 2017 at 01:34:45PM -0700, Eric Anholt wrote: >> Daniel Vetter writes: >> >> > On Fri, Aug 18, 2017 at 10:41:21AM -0700, Eric Anholt wrote: >> >> Noralf Trønnes writes: >> >> > Den 18.08.2017 09.46, skrev Daniel Vetter: >> >> >> On Thu, Aug 17, 2017 at 06:21:30PM +0200, Noralf Trønnes wrote: >> >> >>> Reject mapping an imported dma-buf since is's an invalid use-case. >> >> >>> >> >> >>> Cc: Philipp Zabel >> >> >>> Cc: Laurent Pinchart >> >> >>> Cc: Sean Paul >> >> >>> Cc: Daniel Vetter >> >> >>> Signed-off-by: Noralf Trønnes >> >> >> I think acks from someone using mali would be good too. amdgpu already >> >> >> has >> >> >> such checks, so I think on the desktop side we're ok. >> >> >> >> >> >> Acked-by: Daniel Vetter >> >> >> >> >> >> But I think this one here definitely needs a few more acks. I could >> >> >> break >> >> >> uabi if we're unlucky, so let's not rush it. >> >> > >> >> > Ok, I've CC'ed the affected parties to increase the odds that they look >> >> > at this. These are the drivers using drm_gem_dumb_map_offset() >> >> > (hopefully I got the list right): >> >> >> >> If I understand the affected path right, this would break the PL111+VC4 >> >> combination: PL111 makes (dumb) buffers for scanout, and VC4 imports >> >> them and uses them for rendering. A vc4 glReadPixels of the window >> >> system buffer would map it and fail. >> > >> > It only rejects the map call on dumb buffers, and mmap on imported dma-buf >> > tends to not really work well, or at least break a few abstractions. Are >> > you sure this works currently? >> >> OK, that's right -- vc4 would be doing its "native" map call (the same >> code), not dumb map. >> >> Furthermore, I had it backwards (I had written things both ways at >> different points, iirc). We have VC4 making the buffers and PL111 >> dma-buf importing them. I don't see X11 mapping those buffers if glamor >> is enabled, so this should be OK for vc4. >> >> GBM's dumb mapping looks safe to me. X11 does some dumb maps, but I >> don't think any of those would be on imports. > > Yeah the idea is only to lock down the dumb mmap and make sure abi abuse > (which might work on a specific combo of exporters/kms drivers) is caught > for this generic interface. dumb really should only be used for > unaccelarated rendering on exactly that driver. > > So ack from you? I'm hesitant, but that's mostly because I don't see the reason we're trying to lock it down, so it just looks like a chance of breakage from my perspective. However, given that some drivers are banning it already, let's make things consistent until we find we need to relax it globally. Acked-by: Eric Anholt signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 1/2] drm/gem: drm_gem_dumb_map_offset(): reject dma-buf
On Fri, Aug 18, 2017 at 01:34:45PM -0700, Eric Anholt wrote: > Daniel Vetterwrites: > > > On Fri, Aug 18, 2017 at 10:41:21AM -0700, Eric Anholt wrote: > >> Noralf Trønnes writes: > >> > Den 18.08.2017 09.46, skrev Daniel Vetter: > >> >> On Thu, Aug 17, 2017 at 06:21:30PM +0200, Noralf Trønnes wrote: > >> >>> Reject mapping an imported dma-buf since is's an invalid use-case. > >> >>> > >> >>> Cc: Philipp Zabel > >> >>> Cc: Laurent Pinchart > >> >>> Cc: Sean Paul > >> >>> Cc: Daniel Vetter > >> >>> Signed-off-by: Noralf Trønnes > >> >> I think acks from someone using mali would be good too. amdgpu already > >> >> has > >> >> such checks, so I think on the desktop side we're ok. > >> >> > >> >> Acked-by: Daniel Vetter > >> >> > >> >> But I think this one here definitely needs a few more acks. I could > >> >> break > >> >> uabi if we're unlucky, so let's not rush it. > >> > > >> > Ok, I've CC'ed the affected parties to increase the odds that they look > >> > at this. These are the drivers using drm_gem_dumb_map_offset() > >> > (hopefully I got the list right): > >> > >> If I understand the affected path right, this would break the PL111+VC4 > >> combination: PL111 makes (dumb) buffers for scanout, and VC4 imports > >> them and uses them for rendering. A vc4 glReadPixels of the window > >> system buffer would map it and fail. > > > > It only rejects the map call on dumb buffers, and mmap on imported dma-buf > > tends to not really work well, or at least break a few abstractions. Are > > you sure this works currently? > > OK, that's right -- vc4 would be doing its "native" map call (the same > code), not dumb map. > > Furthermore, I had it backwards (I had written things both ways at > different points, iirc). We have VC4 making the buffers and PL111 > dma-buf importing them. I don't see X11 mapping those buffers if glamor > is enabled, so this should be OK for vc4. > > GBM's dumb mapping looks safe to me. X11 does some dumb maps, but I > don't think any of those would be on imports. Yeah the idea is only to lock down the dumb mmap and make sure abi abuse (which might work on a specific combo of exporters/kms drivers) is caught for this generic interface. dumb really should only be used for unaccelarated rendering on exactly that driver. So ack from you? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 1/2] drm/gem: drm_gem_dumb_map_offset(): reject dma-buf
Daniel Vetterwrites: > On Fri, Aug 18, 2017 at 10:41:21AM -0700, Eric Anholt wrote: >> Noralf Trønnes writes: >> > Den 18.08.2017 09.46, skrev Daniel Vetter: >> >> On Thu, Aug 17, 2017 at 06:21:30PM +0200, Noralf Trønnes wrote: >> >>> Reject mapping an imported dma-buf since is's an invalid use-case. >> >>> >> >>> Cc: Philipp Zabel >> >>> Cc: Laurent Pinchart >> >>> Cc: Sean Paul >> >>> Cc: Daniel Vetter >> >>> Signed-off-by: Noralf Trønnes >> >> I think acks from someone using mali would be good too. amdgpu already has >> >> such checks, so I think on the desktop side we're ok. >> >> >> >> Acked-by: Daniel Vetter >> >> >> >> But I think this one here definitely needs a few more acks. I could break >> >> uabi if we're unlucky, so let's not rush it. >> > >> > Ok, I've CC'ed the affected parties to increase the odds that they look >> > at this. These are the drivers using drm_gem_dumb_map_offset() >> > (hopefully I got the list right): >> >> If I understand the affected path right, this would break the PL111+VC4 >> combination: PL111 makes (dumb) buffers for scanout, and VC4 imports >> them and uses them for rendering. A vc4 glReadPixels of the window >> system buffer would map it and fail. > > It only rejects the map call on dumb buffers, and mmap on imported dma-buf > tends to not really work well, or at least break a few abstractions. Are > you sure this works currently? OK, that's right -- vc4 would be doing its "native" map call (the same code), not dumb map. Furthermore, I had it backwards (I had written things both ways at different points, iirc). We have VC4 making the buffers and PL111 dma-buf importing them. I don't see X11 mapping those buffers if glamor is enabled, so this should be OK for vc4. GBM's dumb mapping looks safe to me. X11 does some dumb maps, but I don't think any of those would be on imports. signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PULL] drm-misc-fixes
On Fri, Aug 18, 2017 at 4:19 PM, Daniel Vetterwrote: > On Fri, Aug 18, 2017 at 11:57:34AM -0400, Sean Paul wrote: >> Hi Dave, >> Here's the latest and greatest from drm-misc-fixes. We have a couple nice >> cleanups from Maarten centered around properly handling errors (and >> specifically >> EDEADLK) in atomic_check. > > They're not cleanups, stuff actually blows up in our CI (hooray for > finally running like all the igts we have). Hence cc: stable. Apologies, I did not mean to imply they weren't proper fixes. Sean > -Daniel > >> >> I probably would have liked Mark's DRM_ERROR patch to go through -misc-next, >> but >> hopefully it's harmless enough to not lose sleep over. >> >> >> drm-misc-fixes-2017-08-18: >> Core Changes: >> - Fix framebuffer leak in setplane error condition (Nikil) >> - Prevent BUG in atomic_ioctl by properly resetting state on EDEADLK >> (Maarten) >> - Add missing return in atomic_check_only if atomic_check fails (Maarten) >> >> Driver Changes: >> - rockchip: Don't try to suspend if device not initialized (Jeffy) >> >> Cc: Jeffy Chen >> Cc: Nikhil Mahale >> Cc: Maarten Lankhorst >> >> Cheers, Daniel ;-) >> >> >> The following changes since commit ef954844c7ace62f773f4f23e28d2d915adc419f: >> >> Linux 4.13-rc5 (2017-08-13 16:01:32 -0700) >> >> are available in the git repository at: >> >> git://anongit.freedesktop.org/git/drm-misc tags/drm-misc-fixes-2017-08-18 >> >> for you to fetch changes up to a0ffc51e20e90e0c1c2491de2b4b03f48b6caaba: >> >> drm/atomic: If the atomic check fails, return its value first (2017-08-15 >> 12:38:05 +0200) >> >> >> Core Changes: >> - Fix framebuffer leak in setplane error condition (Nikil) >> - Prevent BUG in atomic_ioctl by properly resetting state on EDEADLK >> (Maarten) >> - Add missing return in atomic_check_only if atomic_check fails (Maarten) >> >> Driver Changes: >> - rockchip: Don't try to suspend if device not initialized (Jeffy) >> >> Cc: Jeffy Chen >> Cc: Nikhil Mahale >> Cc: Maarten Lankhorst >> >> >> Jeffy Chen (1): >> drm/rockchip: Fix suspend crash when drm is not bound >> >> Maarten Lankhorst (2): >> drm/atomic: Handle -EDEADLK with out-fences correctly >> drm/atomic: If the atomic check fails, return its value first >> >> Nikhil Mahale (1): >> drm: Fix framebuffer leak >> >> Sean Paul (1): >> Merge origin/master into drm-misc-fixes >> >> drivers/gpu/drm/drm_atomic.c| 11 --- >> drivers/gpu/drm/drm_plane.c | 1 + >> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 12 ++-- >> 3 files changed, 19 insertions(+), 5 deletions(-) >> >> -- >> Sean Paul, Software Engineer, Google / Chromium OS > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PULL] drm-misc-fixes
On Fri, Aug 18, 2017 at 11:57:34AM -0400, Sean Paul wrote: > Hi Dave, > Here's the latest and greatest from drm-misc-fixes. We have a couple nice > cleanups from Maarten centered around properly handling errors (and > specifically > EDEADLK) in atomic_check. They're not cleanups, stuff actually blows up in our CI (hooray for finally running like all the igts we have). Hence cc: stable. -Daniel > > I probably would have liked Mark's DRM_ERROR patch to go through -misc-next, > but > hopefully it's harmless enough to not lose sleep over. > > > drm-misc-fixes-2017-08-18: > Core Changes: > - Fix framebuffer leak in setplane error condition (Nikil) > - Prevent BUG in atomic_ioctl by properly resetting state on EDEADLK (Maarten) > - Add missing return in atomic_check_only if atomic_check fails (Maarten) > > Driver Changes: > - rockchip: Don't try to suspend if device not initialized (Jeffy) > > Cc: Jeffy Chen> Cc: Nikhil Mahale > Cc: Maarten Lankhorst > > Cheers, Daniel ;-) > > > The following changes since commit ef954844c7ace62f773f4f23e28d2d915adc419f: > > Linux 4.13-rc5 (2017-08-13 16:01:32 -0700) > > are available in the git repository at: > > git://anongit.freedesktop.org/git/drm-misc tags/drm-misc-fixes-2017-08-18 > > for you to fetch changes up to a0ffc51e20e90e0c1c2491de2b4b03f48b6caaba: > > drm/atomic: If the atomic check fails, return its value first (2017-08-15 > 12:38:05 +0200) > > > Core Changes: > - Fix framebuffer leak in setplane error condition (Nikil) > - Prevent BUG in atomic_ioctl by properly resetting state on EDEADLK (Maarten) > - Add missing return in atomic_check_only if atomic_check fails (Maarten) > > Driver Changes: > - rockchip: Don't try to suspend if device not initialized (Jeffy) > > Cc: Jeffy Chen > Cc: Nikhil Mahale > Cc: Maarten Lankhorst > > > Jeffy Chen (1): > drm/rockchip: Fix suspend crash when drm is not bound > > Maarten Lankhorst (2): > drm/atomic: Handle -EDEADLK with out-fences correctly > drm/atomic: If the atomic check fails, return its value first > > Nikhil Mahale (1): > drm: Fix framebuffer leak > > Sean Paul (1): > Merge origin/master into drm-misc-fixes > > drivers/gpu/drm/drm_atomic.c| 11 --- > drivers/gpu/drm/drm_plane.c | 1 + > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 12 ++-- > 3 files changed, 19 insertions(+), 5 deletions(-) > > -- > Sean Paul, Software Engineer, Google / Chromium OS -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 1/2] drm/gem: drm_gem_dumb_map_offset(): reject dma-buf
On Fri, Aug 18, 2017 at 10:41:21AM -0700, Eric Anholt wrote: > Noralf Trønneswrites: > > Den 18.08.2017 09.46, skrev Daniel Vetter: > >> On Thu, Aug 17, 2017 at 06:21:30PM +0200, Noralf Trønnes wrote: > >>> Reject mapping an imported dma-buf since is's an invalid use-case. > >>> > >>> Cc: Philipp Zabel > >>> Cc: Laurent Pinchart > >>> Cc: Sean Paul > >>> Cc: Daniel Vetter > >>> Signed-off-by: Noralf Trønnes > >> I think acks from someone using mali would be good too. amdgpu already has > >> such checks, so I think on the desktop side we're ok. > >> > >> Acked-by: Daniel Vetter > >> > >> But I think this one here definitely needs a few more acks. I could break > >> uabi if we're unlucky, so let's not rush it. > > > > Ok, I've CC'ed the affected parties to increase the odds that they look > > at this. These are the drivers using drm_gem_dumb_map_offset() > > (hopefully I got the list right): > > If I understand the affected path right, this would break the PL111+VC4 > combination: PL111 makes (dumb) buffers for scanout, and VC4 imports > them and uses them for rendering. A vc4 glReadPixels of the window > system buffer would map it and fail. It only rejects the map call on dumb buffers, and mmap on imported dma-buf tends to not really work well, or at least break a few abstractions. Are you sure this works currently? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/atomic: Handle -EDEADLK with out-fences correctly
On Fri, Aug 18, 2017 at 10:13:08PM +0200, Daniel Vetter wrote: > On Fri, Aug 18, 2017 at 01:59:10PM -0300, Gustavo Padovan wrote: > > 2017-08-14 Maarten Lankhorst: > > > > > complete_crtc_signaling is freeing fence_state, but when retrying > > > num_fences and fence_state are not zero'd. This caused duplicate > > > fd's in the fence_state array, followed by a BUG_ON in fs/file.c > > > because we reallocate freed memory, and installing over an existing > > > fd, or potential other fun. > > > > > > Zero fence_state and num_fences correctly in the retry loop, which > > > allows kms_atomic_transition to pass. > > > > > > Fixes: beaf5af48034 ("drm/fence: add out-fences support") > > > Cc: Gustavo Padovan > > > Cc: Brian Starkey (v10) > > > Cc: Sean Paul > > > Cc: Daniel Vetter > > > Cc: Jani Nikula > > > Cc: David Airlie > > > Signed-off-by: Maarten Lankhorst > > > Cc: # v4.10+ > > > Testcase: kms_atomic_transitions.plane-all-modeset-transition-fencing > > > (with CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y) > > > --- > > > drivers/gpu/drm/drm_atomic.c | 6 -- > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > Reviewed-by: Gustavo Padovan > > Hm somehow this fell through, applied to drm-misc-fixes. Actually it was merged already, I was on an old -fixes. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/atomic: Handle -EDEADLK with out-fences correctly
On Fri, Aug 18, 2017 at 01:59:10PM -0300, Gustavo Padovan wrote: > 2017-08-14 Maarten Lankhorst: > > > complete_crtc_signaling is freeing fence_state, but when retrying > > num_fences and fence_state are not zero'd. This caused duplicate > > fd's in the fence_state array, followed by a BUG_ON in fs/file.c > > because we reallocate freed memory, and installing over an existing > > fd, or potential other fun. > > > > Zero fence_state and num_fences correctly in the retry loop, which > > allows kms_atomic_transition to pass. > > > > Fixes: beaf5af48034 ("drm/fence: add out-fences support") > > Cc: Gustavo Padovan > > Cc: Brian Starkey (v10) > > Cc: Sean Paul > > Cc: Daniel Vetter > > Cc: Jani Nikula > > Cc: David Airlie > > Signed-off-by: Maarten Lankhorst > > Cc: # v4.10+ > > Testcase: kms_atomic_transitions.plane-all-modeset-transition-fencing > > (with CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y) > > --- > > drivers/gpu/drm/drm_atomic.c | 6 -- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > Reviewed-by: Gustavo Padovan Hm somehow this fell through, applied to drm-misc-fixes. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[GIT PULL] Allwinner sun4i DRM changes for 4.14
Hi Dave, Here is our usual changes for the next pull request. They've all been in next for around a month, so they shouldn't cause any particular problems. Thanks! Maxime The following changes since commit 5771a8c08880cdca3bfb4a3fc6d309d6bba20877: Linux v4.13-rc1 (2017-07-15 15:22:10 -0700) are available in the git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git tags/sunxi-drm-for-4.14 for you to fetch changes up to 998140d26723bcddef5857e39077898b0d1bdb8f: sun4i_hdmi: add CEC support (2017-07-18 18:27:50 +0200) Allwinner DRM changes for 4.14 A few changes, but most notably improving the HDMI support merged in 4.13, by reporting the DDC adapter as an i2c bus, and by adding CEC support through the CEC framework. Arvind Yadav (1): drm/sun4i: constify drm_plane_helper_funcs Chen-Yu Tsai (1): dt-bindings: display: sunxi: Improve endpoint ID scheme readability Hans Verkuil (1): sun4i_hdmi: add CEC support Jonathan Liu (1): drm/sun4i: hdmi: Implement I2C adapter for A10s DDC bus Maxime Ripard (3): drm/sun4i: Add if statement instead of depends on drm/sun4i: Remove useless atomic_check drm/sun4i: tcon: remove unused function .../bindings/display/sunxi/sun4i-drm.txt | 36 +++- drivers/gpu/drm/sun4i/Kconfig | 16 +- drivers/gpu/drm/sun4i/Makefile | 1 + drivers/gpu/drm/sun4i/sun4i_hdmi.h | 32 +++ drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 156 ++- drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 220 + drivers/gpu/drm/sun4i/sun4i_layer.c| 9 +- drivers/gpu/drm/sun4i/sun4i_rgb.c | 8 - drivers/gpu/drm/sun4i/sun4i_tcon.h | 2 - drivers/gpu/drm/sun4i/sun4i_tv.c | 8 - 10 files changed, 359 insertions(+), 129 deletions(-) create mode 100644 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[GIT PULL] Allwinner sun4i DRM fixes for 4.13
Hi David, Please pull the following tag for the next merge window. Thanks! Maxime The following changes since commit 5771a8c08880cdca3bfb4a3fc6d309d6bba20877: Linux v4.13-rc1 (2017-07-15 15:22:10 -0700) are available in the git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git sunxi-drm-fixes-for-4.13 for you to fetch changes up to 2a596fc9d974bb040eda9ab70bf8756fcaaa6afe: drm/sun4i: Implement drm_driver lastclose to restore fbdev console (2017-07-17 08:22:03 +0200) Allwinner DRM fixes for 4.13 A single commit to restore the framebuffer console when there's no DRM users left. Jonathan Liu (1): drm/sun4i: Implement drm_driver lastclose to restore fbdev console drivers/gpu/drm/sun4i/sun4i_drv.c | 8 1 file changed, 8 insertions(+) -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102300] Second monitor shows black screen but has signal
https://bugs.freedesktop.org/show_bug.cgi?id=102300 --- Comment #2 from f...@mt2015.com --- Created attachment 133616 --> https://bugs.freedesktop.org/attachment.cgi?id=133616=edit dmesg and xorg logs Logs are from Gallium 0.4 on AMD TONGA (DRM 3.15.0 / 4.12.8-1-ARCH, LLVM 4.0.1) and other ones from git versions. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102300] Second monitor shows black screen but has signal
https://bugs.freedesktop.org/show_bug.cgi?id=102300 --- Comment #1 from Alex Deucher--- Please attach your xorg log and dmesg output. If this is a regression can you bisect? -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102301] 4.12, AMD A10-9600P, AMD-Vi: Completion-Wait loop timed out.
https://bugs.freedesktop.org/show_bug.cgi?id=102301 Bug ID: 102301 Summary: 4.12, AMD A10-9600P, AMD-Vi: Completion-Wait loop timed out. Product: DRI Version: unspecified Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: DRM/AMDgpu Assignee: dri-devel@lists.freedesktop.org Reporter: ahamming...@mail.ru Created attachment 133615 --> https://bugs.freedesktop.org/attachment.cgi?id=133615=edit dmesg, showing a boot without iommu=soft Hello amd devs, and whomever it might affect or who is interested. Kernel: 4.12.8 linux-firmware-amd-20170622 xf86-video-amdgpu-1.3.0 CPU: AMD A10-9600P GPU: Radeon R7 (M440 or sth.) After boot when presented with the login screen, the system repeatedly outputs "AMD-Vi: Completion-Wait loop timed out." and most of the time this corrupts the file system while doing this. Booting the kernel with iommu=soft circumvents the problem, but introduces other issues on this machine. I am following this issue for some time now. A have a fairly recent notebook (yes, I know. it's a lot to ask for support on too recent hardware). But i see hope, as there already has been succesfull patching by the amd crew! I found a bugreport on launchpad [1] (strange enough they posted it there), which led to a patch on freedesktop [2], and i happily got it to work with 4.11. System was bootable without the iommu=soft command. With linux now advancing to 4.12, the patch is not applyable anymore, so here i am now, reporting the issue again, in the hope to get new info and a tiny bit of help/advice. Thanks in advance. [1]: https://bugs.freedesktop.org/show_bug.cgi?id=101029 [2]: https://patchwork.freedesktop.org/series/21684/ _ # lspci -vv | grep -A 3 -i "display" 03:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Topaz XT [Radeon R7 M260/M265 / M340/M360 / M440/M445] (rev ff) (prog-if ff) !!! Unknown header type 7f Kernel driver in use: amdgpu Kernel modules: amdgpu -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102300] Second monitor shows black screen but has signal
https://bugs.freedesktop.org/show_bug.cgi?id=102300 Bug ID: 102300 Summary: Second monitor shows black screen but has signal Product: DRI Version: XOrg git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: DRM/AMDgpu Assignee: dri-devel@lists.freedesktop.org Reporter: f...@mt2015.com I can't set my second monitor to 1920x1080 mode in linux. This problem started 2-3 weeks ago. Disabling and enabling monitor with xrandr or XFCE settings used to restore signal (until next restart, sleep doesn't cause bug) but that doesn't help anymore and adding custom mode doesn't help either. I can set xrandr supported lower resolutions and they work. This happens in Archlinux with linux 4.12 / Mesa 17.1 / amdgpu 1.3.0 but also happens with linux 4.13rc5 / mesa-git / amdgpu-git. Everything works in grub and windows 7, but right after linux starts to boot it switches resolution (fb -> amdgpudrmfb i guess?) and ASUS monitor goes black. So the problem only happens in linux. it's UEFI boot for both OS. Ryzen 1700 ASUS Prime B350+ Radeon R9 285 Dell U2414H DVI-D-0 (HDMI -> DVI-D cable) ASUS VE247 DVI-I-1 (DVI-I cable) If logs are needed just tell what to show. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[maintainer-tools PATCH] dim: Add drm-misc-commit-flow.svg to clean target
Clean up drm-misc-commit-flow.svg when running make clean. Signed-off-by: Sean Paul--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 44fcdc9..8daa912 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,6 @@ mancheck: check: shellcheck mancheck all clean: - rm -f drm-intel.html drm-intel-flow.svg dim.html drm-misc.html + rm -f drm-intel.html drm-intel-flow.svg dim.html drm-misc.html drm-misc-commit-flow.svg .PHONY: all clean -- 2.14.1.480.gb18f417b89-goog ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] i915,drm/fourcc: Improve the CCS modifier documentation
This updates the documentation on the intel CCS modifiers for a couple of reasons: 1) The old documentation required that the CCS modifier only be used with formats. While i915 currently only supports CCS scanout with formats (and advertises such through the blob format), CCS can be used with many other formats. Mesa, in particular, can handle CCS on the full range of formats supported by the hardware. For image sharing entirely within userspace, we don't want this restriction. 2) The old documentation specified the scaling factor in terms of pixels which breaks down when you start using formats which are not 32-bit. By specifying it in terms of cache lines and tiles, we can properly specify the scale-down relationship with no format size assumptions. 3) The new comment provides more detail about the "real" layout of CCS on Sky Lake and also points out that the reason why Y tiling is important is because it affects row pitch calculations. 4) We shouldn't be documenting the Yf CCS modifier yet. Userspace is incapable of generating it right now and we don't fully know how it works yet. Trying to fully describe it is premature. Signed-off-by: Jason EkstrandCc: Ben Widawsky Cc: Ville Syrjälä --- include/uapi/drm/drm_fourcc.h | 35 ++- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 3ad838d..9670da4 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -266,21 +266,30 @@ extern "C" { /* * Intel color control surface (CCS) for render compression * - * The framebuffer format must be one of the 8:8:8:8 RGB formats. - * The main surface will be plane index 0 and must be Y/Yf-tiled, - * the CCS will be plane index 1. - * - * Each CCS tile matches a 1024x512 pixel area of the main surface. - * To match certain aspects of the 3D hardware the CCS is - * considered to be made up of normal 128Bx32 Y tiles, Thus - * the CCS pitch must be specified in multiples of 128 bytes. - * - * In reality the CCS tile appears to be a 64Bx64 Y tile, composed - * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks. - * But that fact is not relevant unless the memory is accessed - * directly. + * The image format must be compatible with CCS_E (lossless render + * compression) as specified in the PRM for the relevant hardware. + * The main surface will be plane index 0 and must be Y-tiled, + * the CCS will be plane index 1 and is also Y-tiled. + * + * Each 64B cache line in the CCS (a region of 16B x 4 rows when + * Y-tiled) corresponds to a region of 32x16 cache lines in the main + * surface. (As a corollary, each CCS tile corresponds to an area of + * 32x16 tiles in the main surface.) This relationship holds regardless + * of the size of the number of bits per pixel of the image format. + * + * In reality, the cache lines in the CCS tile are proportioned in an + * 8B x 8 row configuration with each byte being 2x2 2-bit CCS entries. + * However, CCS is documented as Y-tiled with the scaling relationship + * described in terms of cache lines as above so we consider it to be + * Y-tiled for the purpose of specifying this modifier. This means that + * the row pitch for the CCS assumes 128B/tile. */ #define I915_FORMAT_MOD_Y_TILED_CCSfourcc_mod_code(INTEL, 4) + +/* Reserved for the Yf version of the TILED_CCS modifier. + * + * Exact definition TBD. + */ #define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5) /* -- 2.5.0.400.gff86faf ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] dma-buf/sync_file: document flags field
2017-08-01 Sumit Semwal: > Hi Gustavo, > > On 1 August 2017 at 01:06, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > Documentation for it was missing. > > > > Signed-off-by: Gustavo Padovan > Acked-by: Sumit Semwal Thanks. Pushed to drm-misc-next. Gustavo ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #10 from Andy Furniss--- Disabling dual instance does avoid it. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/6 v2] ASoC: AMD: DMA driver changes for Stoney Platform
From: Vijendar MukundaAdded DMA driver changes for Stoney platform. Below are the key differences between Stoney and CZ In Stoney, Memory Gating is disabled.SRAM Banks won't be turned off.No Of SRAM Banks reduced to 6. DAGB Garlic Interface used and 16 bit resolution is supported. SRAM bank 1 & SRAM bank 2 will be used for playback scenario. SRAM Bank 3 & SRAM Bank 4 will be used for Capture scenario. Reviewed-by: Alex Deucher Signed-off-by: Vijendar Mukunda Signed-off-by: Alex Deucher --- v2: Added switch cases for asic type. v3: Add R-b, resend sound/soc/amd/acp-pcm-dma.c | 87 + sound/soc/amd/acp.h | 2 ++ 2 files changed, 67 insertions(+), 22 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index f00b6b9..f16e0b8 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -137,8 +137,8 @@ static void config_dma_descriptor_in_sram(void __iomem *acp_mmio, * system memory <-> ACP SRAM */ static void set_acp_sysmem_dma_descriptors(void __iomem *acp_mmio, - u32 size, int direction, - u32 pte_offset) + u32 size, int direction, + u32 pte_offset, u32 asic_type) { u16 i; u16 dma_dscr_idx = PLAYBACK_START_DMA_DESCR_CH12; @@ -152,20 +152,42 @@ static void set_acp_sysmem_dma_descriptors(void __iomem *acp_mmio, (size / 2) - (i * (size/2)); dmadscr[i].src = ACP_INTERNAL_APERTURE_WINDOW_0_ADDRESS + (pte_offset * SZ_4K) + (i * (size/2)); - dmadscr[i].xfer_val |= - (ACP_DMA_ATTRIBUTES_DAGB_ONION_TO_SHAREDMEM << 16) | - (size / 2); + switch (asic_type) { + case CHIP_STONEY: + dmadscr[i].xfer_val |= + (ACP_DMA_ATTRIBUTES_DAGB_GARLIC_TO_SHAREDMEM << 16) | + (size / 2); + break; + default: + dmadscr[i].xfer_val |= + (ACP_DMA_ATTRIBUTES_DAGB_ONION_TO_SHAREDMEM << 16) | + (size / 2); + } } else { dma_dscr_idx = CAPTURE_START_DMA_DESCR_CH14 + i; - dmadscr[i].src = ACP_SHARED_RAM_BANK_5_ADDRESS + - (i * (size/2)); - dmadscr[i].dest = ACP_INTERNAL_APERTURE_WINDOW_0_ADDRESS - + (pte_offset * SZ_4K) + - (i * (size/2)); - dmadscr[i].xfer_val |= - BIT(22) | - (ACP_DMA_ATTRIBUTES_SHAREDMEM_TO_DAGB_ONION << 16) | - (size / 2); + switch (asic_type) { + case CHIP_STONEY: + dmadscr[i].src = ACP_SHARED_RAM_BANK_3_ADDRESS + + (i * (size/2)); + dmadscr[i].dest = + ACP_INTERNAL_APERTURE_WINDOW_0_ADDRESS + + (pte_offset * SZ_4K) + (i * (size/2)); + dmadscr[i].xfer_val |= + BIT(22) | + (ACP_DMA_ATTRIBUTES_SHARED_MEM_TO_DAGB_GARLIC << 16) | + (size / 2); + break; + default: + dmadscr[i].src = ACP_SHARED_RAM_BANK_5_ADDRESS + + (i * (size/2)); + dmadscr[i].dest = + ACP_INTERNAL_APERTURE_WINDOW_0_ADDRESS + + (pte_offset * SZ_4K) + (i * (size/2)); + dmadscr[i].xfer_val |= + BIT(22) | + (ACP_DMA_ATTRIBUTES_SHAREDMEM_TO_DAGB_ONION << 16) | + (size / 2); + } } config_dma_descriptor_in_sram(acp_mmio, dma_dscr_idx, [i]); @@ -186,7 +208,8 @@ static void set_acp_sysmem_dma_descriptors(void __iomem *acp_mmio, * ACP SRAM <-> I2S */ static void set_acp_to_i2s_dma_descriptors(void __iomem *acp_mmio, - u32 size, int direction) + u32 size, int direction, + u32
[PATCH 3/6 v3] ASoC: AMD: disabling memory gating in stoney platform
From: Vijendar MukundaFor Stoney platform, Memory gating is disabled.i.e SRAM Banks won't be turned off. By Default, SRAM Bank state set to ON. Added condition checks to skip SRAM Bank state set logic for Stoney platform. Reviewed-by: Alex Deucher Signed-off-by: Vijendar Mukunda Signed-off-by: Alex Deucher --- v2: Added comments in code and removed locally defined macros for STONEY and Carrizo. v3: add R-b, resend sound/soc/amd/acp-pcm-dma.c | 79 +++-- 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index dcbf997..f00b6b9 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -20,7 +20,7 @@ #include #include - +#include #include "acp.h" #define PLAYBACK_MIN_NUM_PERIODS2 @@ -419,7 +419,7 @@ static void acp_set_sram_bank_state(void __iomem *acp_mmio, u16 bank, } /* Initialize and bring ACP hardware to default state. */ -static int acp_init(void __iomem *acp_mmio) +static int acp_init(void __iomem *acp_mmio, u32 asic_type) { u16 bank; u32 val, count, sram_pte_offset; @@ -493,9 +493,14 @@ static int acp_init(void __iomem *acp_mmio) /* When ACP_TILE_P1 is turned on, all SRAM banks get turned on. * Now, turn off all of them. This can't be done in 'poweron' of * ACP pm domain, as this requires ACP to be initialized. + * For Stoney, Memory gating is disabled,i.e SRAM Banks + * won't be turned off. The default state for SRAM banks is ON. + * Setting SRAM bank state code skipped for STONEY platform. */ - for (bank = 1; bank < 48; bank++) - acp_set_sram_bank_state(acp_mmio, bank, false); + if (asic_type != CHIP_STONEY) { + for (bank = 1; bank < 48; bank++) + acp_set_sram_bank_state(acp_mmio, bank, false); + } return 0; } @@ -646,14 +651,22 @@ static int acp_dma_open(struct snd_pcm_substream *substream) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { intr_data->play_stream = substream; - for (bank = 1; bank <= 4; bank++) - acp_set_sram_bank_state(intr_data->acp_mmio, bank, - true); + /* For Stoney, Memory gating is disabled,i.e SRAM Banks +* won't be turned off. The default state for SRAM banks is ON. +* Setting SRAM bank state code skipped for STONEY platform. +*/ + if (intr_data->asic_type != CHIP_STONEY) { + for (bank = 1; bank <= 4; bank++) + acp_set_sram_bank_state(intr_data->acp_mmio, + bank, true); + } } else { intr_data->capture_stream = substream; - for (bank = 5; bank <= 8; bank++) - acp_set_sram_bank_state(intr_data->acp_mmio, bank, - true); + if (intr_data->asic_type != CHIP_STONEY) { + for (bank = 5; bank <= 8; bank++) + acp_set_sram_bank_state(intr_data->acp_mmio, + bank, true); + } } return 0; @@ -869,14 +882,23 @@ static int acp_dma_close(struct snd_pcm_substream *substream) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { adata->play_stream = NULL; - for (bank = 1; bank <= 4; bank++) - acp_set_sram_bank_state(adata->acp_mmio, bank, - false); - } else { + /* For Stoney, Memory gating is disabled,i.e SRAM Banks +* won't be turned off. The default state for SRAM banks is ON. +* Setting SRAM bank state code skipped for STONEY platform. +* added condition checks for Carrizo platform only +*/ + if (adata->asic_type != CHIP_STONEY) { + for (bank = 1; bank <= 4; bank++) + acp_set_sram_bank_state(adata->acp_mmio, bank, + false); + } + } else { adata->capture_stream = NULL; - for (bank = 5; bank <= 8; bank++) - acp_set_sram_bank_state(adata->acp_mmio, bank, - false); + if (adata->asic_type != CHIP_STONEY) { + for (bank = 5; bank <= 8; bank++) + acp_set_sram_bank_state(adata->acp_mmio, bank, +false); + }
[PATCH 5/6 v3] ASoC: AMD: Audio buffer related changes for Stoney
From: Vijendar MukundaStoney uses 16kb SRAM memory for playback and 16Kb for capture.Modified Max buffer size to have the correct mapping between System Memory and SRAM. Added snd_pcm_hardware structures for playback and capture for Stoney. Reviewed-by: Alex Deucher Signed-off-by: Vijendar Mukunda Signed-off-by: Alex Deucher --- v2: Added switch cases for asic type. v3: add R-b, resend sound/soc/amd/acp-pcm-dma.c | 73 + 1 file changed, 68 insertions(+), 5 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index f16e0b8..a6def3b 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -35,6 +35,10 @@ #define MAX_BUFFER (PLAYBACK_MAX_PERIOD_SIZE * PLAYBACK_MAX_NUM_PERIODS) #define MIN_BUFFER MAX_BUFFER +#define ST_PLAYBACK_MAX_PERIOD_SIZE 8192 +#define ST_CAPTURE_MAX_PERIOD_SIZE 8192 +#define ST_MAX_BUFFER (ST_PLAYBACK_MAX_PERIOD_SIZE * PLAYBACK_MAX_NUM_PERIODS) +#define ST_MIN_BUFFER ST_MAX_BUFFER static const struct snd_pcm_hardware acp_pcm_hardware_playback = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | @@ -73,6 +77,44 @@ static const struct snd_pcm_hardware acp_pcm_hardware_capture = { .periods_max = CAPTURE_MAX_NUM_PERIODS, }; +static const struct snd_pcm_hardware acp_st_pcm_hardware_playback = { + .info = SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BATCH | + SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 1, + .channels_max = 8, + .rates = SNDRV_PCM_RATE_8000_96000, + .rate_min = 8000, + .rate_max = 96000, + .buffer_bytes_max = ST_MAX_BUFFER, + .period_bytes_min = PLAYBACK_MIN_PERIOD_SIZE, + .period_bytes_max = ST_PLAYBACK_MAX_PERIOD_SIZE, + .periods_min = PLAYBACK_MIN_NUM_PERIODS, + .periods_max = PLAYBACK_MAX_NUM_PERIODS, +}; + +static const struct snd_pcm_hardware acp_st_pcm_hardware_capture = { + .info = SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BATCH | + SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000_48000, + .rate_min = 8000, + .rate_max = 48000, + .buffer_bytes_max = ST_MAX_BUFFER, + .period_bytes_min = CAPTURE_MIN_PERIOD_SIZE, + .period_bytes_max = ST_CAPTURE_MAX_PERIOD_SIZE, + .periods_min = CAPTURE_MIN_NUM_PERIODS, + .periods_max = CAPTURE_MAX_NUM_PERIODS, +}; + static u32 acp_reg_read(void __iomem *acp_mmio, u32 reg) { return readl(acp_mmio + (reg * 4)); @@ -664,10 +706,23 @@ static int acp_dma_open(struct snd_pcm_substream *substream) if (adata == NULL) return -ENOMEM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - runtime->hw = acp_pcm_hardware_playback; - else - runtime->hw = acp_pcm_hardware_capture; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + switch (intr_data->asic_type) { + case CHIP_STONEY: + runtime->hw = acp_st_pcm_hardware_playback; + break; + default: + runtime->hw = acp_pcm_hardware_playback; + } + } else { + switch (intr_data->asic_type) { + case CHIP_STONEY: + runtime->hw = acp_st_pcm_hardware_capture; + break; + default: + runtime->hw = acp_pcm_hardware_capture; + } + } ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); @@ -905,7 +960,15 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) static int acp_dma_new(struct snd_soc_pcm_runtime *rtd) { - return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, + struct audio_drv_data *adata = dev_get_drvdata(rtd->platform->dev); + + if (adata->asic_type == CHIP_STONEY) + return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, + SNDRV_DMA_TYPE_DEV, + NULL, ST_MIN_BUFFER, + ST_MAX_BUFFER); +
[PATCH 6/6 v3] ASoC: AMD: Add machine driver for cz rt5650
From: Akshu AgrawalThe driver is used for AMD board using rt5650 codec. Reviewed-by: Alex Deucher Signed-off-by: Akshu Agrawal Signed-off-by: Alex Deucher --- v2: Change ACPI ID to AMDI1002 v3: add R-b, resend sound/soc/amd/Kconfig | 7 ++ sound/soc/amd/Makefile | 2 + sound/soc/amd/acp-rt5645.c | 210 + 3 files changed, 219 insertions(+) create mode 100644 sound/soc/amd/acp-rt5645.c diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 78187eb..eb0ae60 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -2,3 +2,10 @@ config SND_SOC_AMD_ACP tristate "AMD Audio Coprocessor support" help This option enables ACP DMA support on AMD platform. +config SND_SOC_AMD_CZ_RT5645_MACH + tristate "AMD CZ support for RT5645" + select SND_SOC_RT5645 + select SND_SOC_AMD_ACP + depends on I2C_DESIGNWARE_PLATFORM + help +This option enables machine driver for rt5645. diff --git a/sound/soc/amd/Makefile b/sound/soc/amd/Makefile index 1a66ec0..eed64ff 100644 --- a/sound/soc/amd/Makefile +++ b/sound/soc/amd/Makefile @@ -1,3 +1,5 @@ snd-soc-acp-pcm-objs := acp-pcm-dma.o +snd-soc-acp-rt5645-mach-objs := acp-rt5645.o obj-$(CONFIG_SND_SOC_AMD_ACP) += snd-soc-acp-pcm.o +obj-$(CONFIG_SND_SOC_AMD_CZ_RT5645_MACH) += snd-soc-acp-rt5645-mach.o diff --git a/sound/soc/amd/acp-rt5645.c b/sound/soc/amd/acp-rt5645.c new file mode 100644 index 000..a17dbea --- /dev/null +++ b/sound/soc/amd/acp-rt5645.c @@ -0,0 +1,210 @@ +/* + * Machine driver for AMD ACP Audio engine using Realtek RT5645 codec + * + * Copyright 2017 Advanced Micro Devices, Inc. + * + * This file is modified from rt288 machine driver + * + * 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../codecs/rt5645.h" + +#define CZ_PLAT_CLK 2400 + +static struct snd_soc_jack cz_jack; + +static int cz_aif1_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + int ret = 0; + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *codec_dai = rtd->codec_dai; + + ret = snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK, + CZ_PLAT_CLK, params_rate(params) * 512); + if (ret < 0) { + dev_err(rtd->dev, "can't set codec pll: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_PLL1, + params_rate(params) * 512, SND_SOC_CLOCK_OUT); + if (ret < 0) { + dev_err(rtd->dev, "can't set codec sysclk: %d\n", ret); + return ret; + } + + return ret; +} + +static int cz_init(struct snd_soc_pcm_runtime *rtd) +{ + int ret; + struct snd_soc_card *card; + struct snd_soc_codec *codec; + + codec = rtd->codec; + card = rtd->card; + + ret = snd_soc_card_jack_new(card, "Headset Jack", + SND_JACK_HEADPHONE | SND_JACK_MICROPHONE | + SND_JACK_BTN_0 | SND_JACK_BTN_1 | + SND_JACK_BTN_2 | SND_JACK_BTN_3, + _jack, NULL, 0); + if (ret) { + dev_err(card->dev, "HP jack creation failed %d\n", ret); + return ret; + } + + rt5645_set_jack_detect(codec, _jack, _jack, _jack); + + return 0; +} + +static struct snd_soc_ops cz_aif1_ops = { + .hw_params = cz_aif1_hw_params, +}; + +static struct snd_soc_dai_link cz_dai_rt5650[] = { + { + .name = "amd-rt5645-play", +
[PATCH 2/6 v2] drm/amdgpu Moving amdgpu asic types to a separate file
From: Akshu AgrawalAmdgpu asic types will be required for other drivers too. Hence, its better to keep it in a separate include file. Reviewed-by: Alex Deucher Signed-off-by: Akshu Agrawal Signed-off-by: Alex Deucher --- v1: New patch to share asic_type definitions between GPU and audio driver. v2: add R-b, resend drivers/gpu/drm/amd/include/amd_shared.h | 29 ++ include/drm/amd_asic_type.h | 52 2 files changed, 54 insertions(+), 27 deletions(-) create mode 100644 include/drm/amd_asic_type.h diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h index 70e8c20..3a49fbd 100644 --- a/drivers/gpu/drm/amd/include/amd_shared.h +++ b/drivers/gpu/drm/amd/include/amd_shared.h @@ -23,34 +23,9 @@ #ifndef __AMD_SHARED_H__ #define __AMD_SHARED_H__ -#define AMD_MAX_USEC_TIMEOUT 20 /* 200 ms */ +#include -/* - * Supported ASIC types - */ -enum amd_asic_type { - CHIP_TAHITI = 0, - CHIP_PITCAIRN, - CHIP_VERDE, - CHIP_OLAND, - CHIP_HAINAN, - CHIP_BONAIRE, - CHIP_KAVERI, - CHIP_KABINI, - CHIP_HAWAII, - CHIP_MULLINS, - CHIP_TOPAZ, - CHIP_TONGA, - CHIP_FIJI, - CHIP_CARRIZO, - CHIP_STONEY, - CHIP_POLARIS10, - CHIP_POLARIS11, - CHIP_POLARIS12, - CHIP_VEGA10, - CHIP_RAVEN, - CHIP_LAST, -}; +#define AMD_MAX_USEC_TIMEOUT 20 /* 200 ms */ /* * Chip flags diff --git a/include/drm/amd_asic_type.h b/include/drm/amd_asic_type.h new file mode 100644 index 000..599028f --- /dev/null +++ b/include/drm/amd_asic_type.h @@ -0,0 +1,52 @@ +/* + * Copyright 2017 Advanced Micro Devices, Inc. + * + * 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 __AMD_ASIC_TYPE_H__ +#define __AMD_ASIC_TYPE_H__ +/* + * Supported ASIC types + */ +enum amd_asic_type { + CHIP_TAHITI = 0, + CHIP_PITCAIRN, + CHIP_VERDE, + CHIP_OLAND, + CHIP_HAINAN, + CHIP_BONAIRE, + CHIP_KAVERI, + CHIP_KABINI, + CHIP_HAWAII, + CHIP_MULLINS, + CHIP_TOPAZ, + CHIP_TONGA, + CHIP_FIJI, + CHIP_CARRIZO, + CHIP_STONEY, + CHIP_POLARIS10, + CHIP_POLARIS11, + CHIP_POLARIS12, + CHIP_VEGA10, + CHIP_RAVEN, + CHIP_LAST, +}; + +#endif /*__AMD_ASIC_TYPE_H__ */ -- 2.5.5 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/6 v3] drm/amd/amdgpu: Added asic_type as ACP DMA driver platform data
From: Vijendar Mukundaasic_type information is passed to ACP DMA Driver as platform data. Reviewed-by: Alex Deucher Signed-off-by: Vijendar Mukunda Signed-off-by: Alex Deucher --- v2: Removed asic_type local variable and directly passing asic_type instance to ACP DMA driver as platform data. v3: Add R-b, resend. drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 ++ sound/soc/amd/acp-pcm-dma.c | 8 ++-- sound/soc/amd/acp.h | 7 +++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index a52795d..ebca223 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -371,6 +371,8 @@ static int acp_hw_init(void *handle) adev->acp.acp_cell[0].name = "acp_audio_dma"; adev->acp.acp_cell[0].num_resources = 4; adev->acp.acp_cell[0].resources = >acp.acp_res[0]; + adev->acp.acp_cell[0].platform_data = >asic_type; + adev->acp.acp_cell[0].pdata_size = sizeof(adev->asic_type); adev->acp.acp_cell[1].name = "designware-i2s"; adev->acp.acp_cell[1].num_resources = 1; diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 08b1399..dcbf997 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -73,12 +73,6 @@ static const struct snd_pcm_hardware acp_pcm_hardware_capture = { .periods_max = CAPTURE_MAX_NUM_PERIODS, }; -struct audio_drv_data { - struct snd_pcm_substream *play_stream; - struct snd_pcm_substream *capture_stream; - void __iomem *acp_mmio; -}; - static u32 acp_reg_read(void __iomem *acp_mmio, u32 reg) { return readl(acp_mmio + (reg * 4)); @@ -916,6 +910,7 @@ static int acp_audio_probe(struct platform_device *pdev) int status; struct audio_drv_data *audio_drv_data; struct resource *res; + const u32 *pdata = pdev->dev.platform_data; audio_drv_data = devm_kzalloc(>dev, sizeof(struct audio_drv_data), GFP_KERNEL); @@ -932,6 +927,7 @@ static int acp_audio_probe(struct platform_device *pdev) audio_drv_data->play_stream = NULL; audio_drv_data->capture_stream = NULL; + audio_drv_data->asic_type = *pdata; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { diff --git a/sound/soc/amd/acp.h b/sound/soc/amd/acp.h index 330832e..28cf914 100644 --- a/sound/soc/amd/acp.h +++ b/sound/soc/amd/acp.h @@ -84,6 +84,13 @@ struct audio_substream_data { void __iomem *acp_mmio; }; +struct audio_drv_data { + struct snd_pcm_substream *play_stream; + struct snd_pcm_substream *capture_stream; + void __iomem *acp_mmio; + u32 asic_type; +}; + enum { ACP_TILE_P1 = 0, ACP_TILE_P2, -- 2.5.5 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/6 v3] Add ASoC support for AMD Stoney APUs
This patch set updates the AMD GPU and Audio CoProcessor (ACP) audio drivers and the designware i2s driver for Stoney (ST). ST is an APU similar to Carrizo (CZ) which already has ACP audio support. The i2s controller and ACP audio DMA engine are part of the GPU and both need updating so I would like to upstream the whole patch set via one tree if possible. The current code is based on drm-next, but I'm happy to rebase on whatever tree this ends up going through if there are any problems applying. These patches touch both audio and drm. The entire patch set can be viewed here: https://cgit.freedesktop.org/~agd5f/linux/log/?h=stoney_acp2 Thanks! Alex v2: - Patch 1 is already applied to the audio tree, just including it for completeness since it's required for this patch set and it's not yet in the drm tree. - New patch to share asic types between gpu and audio drivers - ACPI ID changed for rt5650 machine driver - Integrate feedback on other patches v3: - resend remaining patches that have not been applied yet Akshu Agrawal (2): drm/amdgpu Moving amdgpu asic types to a separate file ASoC: AMD: Add machine driver for cz rt5650 Vijendar Mukunda (4): drm/amd/amdgpu: Added asic_type as ACP DMA driver platform data ASoC: AMD: disabling memory gating in stoney platform ASoC: AMD: DMA driver changes for Stoney Platform ASoC: AMD: Audio buffer related changes for Stoney drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 + drivers/gpu/drm/amd/include/amd_shared.h | 29 +--- include/drm/amd_asic_type.h | 52 +++ sound/soc/amd/Kconfig| 7 + sound/soc/amd/Makefile | 2 + sound/soc/amd/acp-pcm-dma.c | 243 --- sound/soc/amd/acp-rt5645.c | 210 ++ sound/soc/amd/acp.h | 9 ++ 8 files changed, 472 insertions(+), 82 deletions(-) create mode 100644 include/drm/amd_asic_type.h create mode 100644 sound/soc/amd/acp-rt5645.c -- 2.5.5 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[git pull] amdkfd next 4.14
Hi Dave, This is the amdkfd pull request for 4.14 merge window. AMD has started cleaning the pipe and sending patches from their internal development to the upstream community. The plan as I understand it is to first get all the non-dGPU patches to upstream and then move to upstream dGPU support. The patches here are relevant only for Kaveri and Carrizo. The following is a summary of the changes: - Add new IOCTL to set a Scratch memory VA - Update PM4 headers for new firmware that support scratch memory - Support image tiling mode - Remove all uses of BUG_ON - Various Bug fixes and coding style fixes Thanks, Oded The following changes since commit 8824c751eb61ebffb053c291199932845bac88b4: Merge tag 'omapdrm-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next (2017-08-18 05:41:32 +1000) are available in the git repository at: git://people.freedesktop.org/~gabbayo/linux tags/drm-amdkfd-next-2017-08-18 for you to fetch changes up to 5d71dbc3a588690c3d66d76db8cd29973425ce6d: drm/amdkfd: Implement image tiling mode support v2 (2017-08-15 23:00:22 -0400) Felix Kuehling (13): drm/amdkfd: Fix typo in dbgdev_wave_reset_wavefronts drm/radeon: Return dword offsets of address watch registers drm/amdkfd: Remove bogus divide-by-sizeof(uint32_t) drm/amdkfd: Fix allocated_queues bitmap initialization drm/amdgpu: Remove hard-coded assumptions about compute pipes drm/amdkfd: Remove BUG_ONs for NULL pointer arguments drm/amdkfd: Fix doorbell initialization and finalization drm/amdkfd: Allocate gtt_sa_bitmap in long units drm/amdkfd: Handle remaining BUG_ONs more gracefully v2 drm/amdkfd: Update PM4 packet headers drm/amdgpu: Disable GFX PG on CZ drm/amd: Update MEC HQD loading code for KFD drm/amdgpu: Program SH_STATIC_MEM_CONFIG globally, not per-VMID Jay Cornwall (1): drm/amdkfd: Clamp EOP queue size correctly on Gfx8 Kent Russell (5): drm/amdkfd: Clean up KFD style errors and warnings v2 drm/amdkfd: Consolidate and clean up log commands drm/amdkfd: Change x==NULL/false references to !x drm/amdkfd: Fix goto usage v2 drm/amdkfd: Remove usage of alloc(sizeof(struct... Moses Reuben (2): drm/amdgpu: Add kgd/kfd interface to support scratch memory v2 drm/amdkfd: Adding new IOCTL for scratch memory v2 Yong Zhao (3): drm/amdkfd: Add more error printing to help bringup v2 drm/amdgpu: Add kgd kfd interface get_tile_config() v2 drm/amdkfd: Implement image tiling mode support v2 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 16 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 189 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 227 -- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 3 +- drivers/gpu/drm/amd/amdgpu/vi.c| 3 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 183 drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c| 102 +++ drivers/gpu/drm/amd/amdkfd/kfd_dbgmgr.c| 21 +- drivers/gpu/drm/amd/amdkfd/kfd_dbgmgr.h| 27 +- drivers/gpu/drm/amd/amdkfd/kfd_device.c| 123 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 316 .../drm/amd/amdkfd/kfd_device_queue_manager_cik.c | 8 +- .../drm/amd/amdkfd/kfd_device_queue_manager_vi.c | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 40 +-- drivers/gpu/drm/amd/amdkfd/kfd_events.c| 33 +-- drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 63 ++-- drivers/gpu/drm/amd/amdkfd/kfd_module.c| 10 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.h | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 62 ++-- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c| 46 +-- drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c| 294 ++ drivers/gpu/drm/amd/amdkfd/kfd_pasid.c | 7 +- drivers/gpu/drm/amd/amdkfd/kfd_pm4_headers.h | 330 +++-- drivers/gpu/drm/amd/amdkfd/kfd_pm4_headers_vi.h| 140 - drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 32 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 25 +- .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 71 ++--- drivers/gpu/drm/amd/amdkfd/kfd_queue.c | 12 +- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 46 +-- drivers/gpu/drm/amd/include/kgd_kfd_interface.h| 30 +- drivers/gpu/drm/radeon/radeon_kfd.c| 15 +- include/uapi/linux/kfd_ioctl.h | 37 ++- 36 files changed, 1280
[drm-misc] drm-misc-next now targeting 4.15
Hi misc! I've just sent out the last pull request for drm-misc-next, and another feature freeze is upon us. I've fast-forwarded drm-misc-next-fixes for any 4.14 fixes that are required between now and 4.14-rc1. drm-misc-fixes will continue to target 4.13 until it's released, and drm-misc-next is now targeting 4.15. If you are unsure where to apply patches, please consult the flowchart [1] (this is normally inline in the drm-misc docs, but was recently regressed, look for it there in the future) and merge timeline in the drm-misc documentation [2]. If you are still unsure, please ask on IRC. Finally, danvet will be rotating in to handle pulls for the 4.15 release. I'll continue handling 4.13 and 4.14. Ok, that's all. Go forth and apply, Sean [1]- https://people.freedesktop.org/~seanpaul/drm-misc-commit-flow.svg [2]- https://01.org/linuxgraphics/gfx-docs/maintainer-tools/drm-misc.html -- Sean Paul, Software Engineer, Google / Chromium OS ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #9 from Christian König--- Already following this Alex, but not the slightest idea either. Andy could you for a test disable multiple instance support in VCE (I need to dig through the Mesa source as well, but I think Leo asked that multiple times so you might know of hand). Apart from that I would say lets dump all the calculated addresses with good and bad and see what is different. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 1/2] drm/gem: drm_gem_dumb_map_offset(): reject dma-buf
Noralf Trønneswrites: > (cc affected parties) > > > Den 18.08.2017 09.46, skrev Daniel Vetter: >> On Thu, Aug 17, 2017 at 06:21:30PM +0200, Noralf Trønnes wrote: >>> Reject mapping an imported dma-buf since is's an invalid use-case. >>> >>> Cc: Philipp Zabel >>> Cc: Laurent Pinchart >>> Cc: Sean Paul >>> Cc: Daniel Vetter >>> Signed-off-by: Noralf Trønnes >> I think acks from someone using mali would be good too. amdgpu already has >> such checks, so I think on the desktop side we're ok. >> >> Acked-by: Daniel Vetter >> >> But I think this one here definitely needs a few more acks. I could break >> uabi if we're unlucky, so let's not rush it. > > Ok, I've CC'ed the affected parties to increase the odds that they look > at this. These are the drivers using drm_gem_dumb_map_offset() > (hopefully I got the list right): If I understand the affected path right, this would break the PL111+VC4 combination: PL111 makes (dumb) buffers for scanout, and VC4 imports them and uses them for rendering. A vc4 glReadPixels of the window system buffer would map it and fail. signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RESEND][PATCH v4] drm: kirin: Add mode_valid logic to avoid mode clocks we can't generate
On Fri, Aug 18, 2017 at 8:28 AM, Sean Paulwrote: > On Thu, Aug 17, 2017 at 12:00:04PM -0700, John Stultz wrote: >> Currently the hikey dsi logic cannot generate accurate byte >> clocks values for all pixel clock values. Thus if a mode clock >> is selected that cannot match the calculated byte clock, the >> device will boot with a blank screen. >> >> This patch uses the new mode_valid callback (many thanks to >> Jose Abreu for upstreaming it!) to ensure we don't select >> modes we cannot generate. >> >> Also, since the ade crtc code will adjust the mode in mode_set, >> this patch also adds a mode_fixup callback which we use to make >> sure we are validating the mode clock that will eventually be >> used. >> >> Cc: Daniel Vetter >> Cc: Jani Nikula >> Cc: Sean Paul >> Cc: David Airlie >> Cc: Rob Clark >> Cc: Xinliang Liu >> Cc: Xinliang Liu >> Cc: Rongrong Zou >> Cc: Xinwei Kong >> Cc: Chen Feng >> Cc: Jose Abreu >> Cc: Archit Taneja >> Cc: dri-devel@lists.freedesktop.org >> Signed-off-by: John Stultz > > Hi John, > Thanks for continuing to send new versions for this patch. It looks good to me > (there's a small spelling mistake in a comment below that perhaps can be fixed > when applied, no biggy). > > Reviewed-by: Sean Paul Thanks so much for the review! I really appreciate it! -john ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/doc: Document ioctl errno value patterns
We're not super-consistent about these, but I think it's worth to document at least the commmon patterns. v2: - Add a not about ENOTTY (it's just a confusing name, but used exactly what it's meant for in DRM) (Chris). - Unconfuse the text for ENODEV (Daniel) - Move text undert the IOCTL heading (Chris). - typos Cc: Daniel StoneCc: Joonas Lahtinen Cc: Chris Wilson Cc: "Zhang, Tina" Reviewed-by: Chris Wilson Signed-off-by: Daniel Vetter --- Documentation/gpu/drm-uapi.rst | 55 ++ 1 file changed, 55 insertions(+) diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst index 679373b4a03f..a2214cc1f821 100644 --- a/Documentation/gpu/drm-uapi.rst +++ b/Documentation/gpu/drm-uapi.rst @@ -168,6 +168,61 @@ IOCTL Support on Device Nodes .. kernel-doc:: drivers/gpu/drm/drm_ioctl.c :doc: driver specific ioctls +Recommended IOCTL Return Values +--- + +In theory a driver's IOCTL callback is only allowed to return very few error +codes. In practice it's good to abuse a few more. This section documents common +practice within the DRM subsystem: + +ENOENT: +Strictly this should only be used when a file doesn't exist e.g. when +calling the open() syscall. We reuse that to signal any kind of object +lookup failure, e.g. for unknown GEM buffer object handles, unknown KMS +object handles and similar cases. + +ENOSPC: +Some drivers use this to differentiate "out of kernel memory" from "out +of VRAM". Sometimes also applies to other limited gpu resources used for +rendering (e.g. when you have a special limited compression buffer). +Sometimes resource allocation/reservation issues in command submission +IOCTLs are also signalled through EDEADLK. + +Simply running out of kernel/system memory is signalled through ENOMEM. + +EPERM/EACCESS: +Returned for an operation that is valid, but needs more privileges. +E.g. root-only or much more common, DRM master-only operations return +this when when called by unpriviledged clients. There's no clear +difference between EACCESS and EPERM. + +ENODEV: +Feature (like PRIME, modesetting, GEM) is not supported by the driver. + +ENXIO: +Remote failure, either a hardware transaction (like i2c), but also used +when the exporting driver of a shared dma-buf or fence doesn't support a +feature needed. + +EINTR: +DRM drivers assume that userspace restarts all IOCTLs. Any DRM IOCTL can +return EINTR and in such a case should be restarted with the IOCTL +parameters left unchanged. + +EIO: +The GPU died and couldn't be resurrected through a reset. Modesetting +hardware failures are signalled through the "link status" connector +property. + +EINVAL: +Catch-all for anything that is an invalid argument combination which +cannot work. + +IOCTL also use other error codes like ETIME, EFAULT, EBUSY, ENOTTY but their +usage is in line with the common meanings. The above list tries to just document +DRM specific patterns. Note that ENOTTY has the slightly unintuitive meaning of +"this IOCTL does not exist", and is used exactly as such in DRM. + .. kernel-doc:: include/drm/drm_ioctl.h :internal: -- 2.13.3 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 101691] [KBL] gfx corruption on windowed 3d-apps running on dGPU
https://bugs.freedesktop.org/show_bug.cgi?id=101691 --- Comment #27 from Timo Aaltonen--- I don't have the hw to test, but what I know by now is that - the tearing is gone at least with kernel 4.10 - corruption happens still, but _only_ when the charger is attached, meaning that when the system is on battery the corruption is gone, and appears again when charger is plugged in.. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[pull] radeon and amdgpu drm-next-4.14
Hi Dave, More changes for 4.14. Highlights: - command submission overhead improvements - Huge page support for vega10 - physical mode support for mjpeg for asics that don't support UVD vm - improve ttm_mem_type_manager_func debug - misc ttm fixes, cleanups - misc gpuvm cleanups The following changes since commit 8824c751eb61ebffb053c291199932845bac88b4: Merge tag 'omapdrm-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next (2017-08-18 05:41:32 +1000) are available in the git repository at: git://people.freedesktop.org/~agd5f/linux drm-next-4.14 for you to fetch changes up to df9bcb0652bbfde1b37bda98f0ad1fa7fda46d67: drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2 (2017-08-18 12:02:58 -0400) Christian König (18): drm/ttm: remove nonsense wait in ttm_bo_cleanup_refs_and_unlock drm/ttm: individualize BO reservation obj when they are freed drm/amdgpu: only move VM BOs in the LRU during validation v2 drm/amdgpu: only bind VM shadows after validation v2 drm/amdgpu: fix Vega10 HW config for 2MB pages drm/ttm: make ttm_mem_type_manager_func debug more useful drm/radeon: fix incorrect use of the lru_lock drm/amdgpu: fix incorrect use of the lru_lock drm/amdgpu: move debug print into the MM managers drm/amdgpu: move gtt usage tracking into the gtt manager v2 drm/amdgpu: move vram usage tracking into the vram manager v2 drm/amdgpu: SHADOW and VRAM_CONTIGUOUS flags shouldn't be used by userspace drm/amdgpu: cleanup static CSA handling drm/amdgpu: remove superflous amdgpu_bo_kmap in the VM drm/amdgpu: drop the extra VM huge page flag v2 drm/amdgpu: separate bo_va structure drm/amdgpu: rename VM invalidated to moved drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2 Chunming Zhou (1): drm/amdgpu: save list length when fence is signaled Ken Wang (1): drm/amdgpu: fix vega10 graphic hang issue in S3 test Leo Liu (2): drm/amdgpu: add MJPEG check for UVD physical mode msg buffer drm/amdgpu: bump version for support of UVD MJPEG decode Roger He (2): drm/amd/amdgpu: store fragment_size in vm_manager drm/amd/amdgpu: expose fragment size as module parameter (v2) Tom St Denis (1): drm/amd/amdgpu: Add tracepoint for DMA page mapping (v4) Xiangliang.Yu (1): drm/ttm: Fix accounting error when fail to get pages for pool drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 29 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 7 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 48 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 25 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 52 -- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h| 14 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 13 +- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 60 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 76 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 25 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 248 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h| 34 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 77 +++- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 +- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 7 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 9 +- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 10 +- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 10 +- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 11 +- drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 7 +- drivers/gpu/drm/amd/amdgpu/soc15d.h | 1 + drivers/gpu/drm/nouveau/nouveau_ttm.c | 6 +- drivers/gpu/drm/radeon/radeon_ttm.c | 10 +- drivers/gpu/drm/ttm/ttm_bo.c | 64 +-- drivers/gpu/drm/ttm/ttm_bo_manager.c | 5 +- drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +- drivers/gpu/drm/virtio/virtgpu_ttm.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 +- include/drm/ttm/ttm_bo_driver.h | 5 +- 35 files changed, 521 insertions(+), 381 deletions(-) ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #8 from Andy Furniss--- Created attachment 133613 --> https://bugs.freedesktop.org/attachment.cgi?id=133613=edit dmesg with v2 patch No luck with v2. The errors are gone, but the original issue is the same. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PULL] drm-misc-next
Hi Dave, Here's the last of -misc-next for 4.14, we'll switch over to drm-misc-next-fixes now and drm-misc-next will target 4.15. I'll send a PSA to misc committers once the branches are set up. Since we just send a pull a few days ago, there's not much here, and the tl;dr is Noralf. We have the end of one great gem cleanup set, and the start of another. There are also a few trivial patches in there, but nothing worth calling out. drm-misc-next-2017-08-18: Cross-subsystem Changes: - Add tinydrm to MAINTAINERS using -misc tree and Noralf as maintainer (Noralf) Core Changes: - Finish dumb_mmap_offset cleanup by removing gem_cma_dumb_map_offset() (Noralf) - Add gem_framebuffer helper to facilitate removal of fb_cma cargo cult (Noralf) Driver Changes: - Various trivial patches Cc: Noralf TrønnesCheers, Sean The following changes since commit 8824c751eb61ebffb053c291199932845bac88b4: Merge tag 'omapdrm-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next (2017-08-18 05:41:32 +1000) are available in the git repository at: git://anongit.freedesktop.org/git/drm-misc tags/drm-misc-next-2017-08-18 for you to fetch changes up to 0e8841ec7ee5b1ffe416c3be7743985b1896ec00: Merge airlied/drm-next into drm-misc-next (2017-08-18 10:52:44 -0400) Cross-subsystem Changes: - Add tinydrm to MAINTAINERS using -misc tree and Noralf as maintainer (Noralf) Core Changes: - Finish dumb_mmap_offset cleanup by removing gem_cma_dumb_map_offset() (Noralf) - Add gem_framebuffer helper to facilitate removal of fb_cma cargo cult (Noralf) Driver Changes: - Various trivial patches Cc: Noralf Trønnes Arvind Yadav (1): drm: udl: constify usb_device_id Colin Ian King (1): drm/tinydrm: make function st7586_pipe_enable static Gustavo A. R. Silva (1): drm/gma500: fix potential NULL pointer dereference dereference Noralf Trønnes (5): drm: Add GEM backed framebuffer library drm/fb-cma-helper: Use drm_gem_framebuffer_helper drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb() drm/vc4: Use drm_gem_fb_create() MAINTAINERS: Add drm/tinydrm maintainer entry Sean Paul (1): Merge airlied/drm-next into drm-misc-next Documentation/gpu/drm-kms-helpers.rst | 9 + MAINTAINERS | 8 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_fb_cma_helper.c | 180 +++- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 283 ++ drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 4 +- drivers/gpu/drm/pl111/pl111_display.c | 3 +- drivers/gpu/drm/pl111/pl111_drv.c | 3 +- drivers/gpu/drm/tinydrm/st7586.c | 4 +- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_kms.c | 3 +- include/drm/drm_framebuffer.h | 7 + include/drm/drm_gem_framebuffer_helper.h | 37 13 files changed, 386 insertions(+), 159 deletions(-) create mode 100644 drivers/gpu/drm/drm_gem_framebuffer_helper.c create mode 100644 include/drm/drm_gem_framebuffer_helper.h -- Sean Paul, Software Engineer, Google / Chromium OS ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/atomic: Handle -EDEADLK with out-fences correctly
2017-08-14 Maarten Lankhorst: > complete_crtc_signaling is freeing fence_state, but when retrying > num_fences and fence_state are not zero'd. This caused duplicate > fd's in the fence_state array, followed by a BUG_ON in fs/file.c > because we reallocate freed memory, and installing over an existing > fd, or potential other fun. > > Zero fence_state and num_fences correctly in the retry loop, which > allows kms_atomic_transition to pass. > > Fixes: beaf5af48034 ("drm/fence: add out-fences support") > Cc: Gustavo Padovan > Cc: Brian Starkey (v10) > Cc: Sean Paul > Cc: Daniel Vetter > Cc: Jani Nikula > Cc: David Airlie > Signed-off-by: Maarten Lankhorst > Cc: # v4.10+ > Testcase: kms_atomic_transitions.plane-all-modeset-transition-fencing > (with CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y) > --- > drivers/gpu/drm/drm_atomic.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Gustavo Padovan Gustavo ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 Alex Deucherchanged: What|Removed |Added Attachment #133610|0 |1 is obsolete|| --- Comment #7 from Alex Deucher --- Created attachment 133612 --> https://bugs.freedesktop.org/attachment.cgi?id=133612=edit possible fix v2 Whoops, the original patch had a typo in it. Does this simplified version work any better? -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[GIT PULL] etnaviv-next for 4.14
Hi Dave, this cycle has been fairly calm in etnaviv land with most of the action happening on the userspace side. Notable changes: - Improvements to CONFIG option handling to make it harder for users to shoot themselves in the foot due to kernel misconfiguration. - Tweaked GEM object population, so that userspace can take considerate action when memory allocation fails, rather than waking the raging OOM killer beast. Regards, Lucas The following changes since commit 12d016626f99f48edbf5b006625b4e8c0de1eec7: Merge tag 'drm-amdkfd-next-2017-06-25' of git://people.freedesktop.org/~gabbayo/linux into drm-next (2017-06-28 17:09:27 +1000) are available in the git repository at: https://git.pengutronix.de/git/lst/linux etnaviv/next for you to fetch changes up to 65375b873cb553c1e52d6e0d77d954011f44433e: drm/etnaviv: switch GEM allocations to __GFP_RETRY_MAYFAIL (2017-08-15 15:28:22 +0200) Cihangir Akturk (1): drm/etnaviv: switch to drm_*{get,put} helpers Lucas Stach (6): drm/etnaviv: don't trigger OOM killer when page allocation fails drm/etnaviv: reduce allocation failure message severity drm/etnaviv: populate GEM objects on cpu_prep drm/etnaviv: select CMA and DMA_CMA if available drm/etnaviv: don't fail GPU bind when CONFIG_THERMAL isn't enabled drm/etnaviv: switch GEM allocations to __GFP_RETRY_MAYFAIL drivers/gpu/drm/etnaviv/Kconfig | 2 ++ drivers/gpu/drm/etnaviv/etnaviv_drv.c| 8 drivers/gpu/drm/etnaviv/etnaviv_gem.c| 45 +++-- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 4 ++-- drivers/gpu/drm/etnaviv/etnaviv_gpu.c| 8 +--- 6 files changed, 37 insertions(+), 32 deletions(-) ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/imx: parallel-display: use correct connector enum
The imx parrallel display exposes a, well, display parallel interface. Use the correct enum, instead of disguising the thing as a VGA connector. Signed-off-by: Lucas Stach--- drivers/gpu/drm/imx/parallel-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c index 8aca20209cb8..aa79ed936416 100644 --- a/drivers/gpu/drm/imx/parallel-display.c +++ b/drivers/gpu/drm/imx/parallel-display.c @@ -184,7 +184,7 @@ static int imx_pd_register(struct drm_device *drm, _pd_connector_helper_funcs); drm_connector_init(drm, >connector, _pd_connector_funcs, - DRM_MODE_CONNECTOR_VGA); + DRM_MODE_CONNECTOR_DPI); } if (imxpd->panel) -- 2.11.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #6 from Andy Furniss--- Created attachment 133611 --> https://bugs.freedesktop.org/attachment.cgi?id=133611=edit dmesg with patch No, the encode fails differently though, throwing lots of amdgpu: The CS has been cancelled because the context is lost. and in dmesg [ 103.116736] [drm:amdgpu_vce_cs_reloc [amdgpu]] *ERROR* BO to small for addr 0x010cf1e000 156 155 This is actually familiar looking as current mesa + vaapi would do this since a patch from march. I am testing this using OMX and have never see that do it before. The issue I bisected was outputting with no errors from the encoder, a corrupt stream - it was playable and looked good to start with, it just degraded as time went on with the decoder throwing h264 errors. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/4] drm/tegra: Use u64_to_user_ptr helper
Use the u64_to_user_ptr helper macro to cast IOCTL argument u64 values to user pointers instead of writing out the cast manually. Signed-off-by: Mikko Perttunen--- drivers/gpu/drm/tegra/drm.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index e3331a2bc082..78c98736b0a5 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -389,11 +389,10 @@ int tegra_drm_submit(struct tegra_drm_context *context, unsigned int num_relocs = args->num_relocs; unsigned int num_waitchks = args->num_waitchks; struct drm_tegra_cmdbuf __user *cmdbufs = - (void __user *)(uintptr_t)args->cmdbufs; - struct drm_tegra_reloc __user *relocs = - (void __user *)(uintptr_t)args->relocs; + u64_to_user_ptr(args->cmdbufs); + struct drm_tegra_reloc __user *relocs = u64_to_user_ptr(args->relocs); struct drm_tegra_waitchk __user *waitchks = - (void __user *)(uintptr_t)args->waitchks; + u64_to_user_ptr(args->waitchks); struct drm_tegra_syncpt syncpt; struct host1x *host1x = dev_get_drvdata(drm->dev->parent); struct host1x_syncpt *sp; @@ -520,7 +519,7 @@ int tegra_drm_submit(struct tegra_drm_context *context, } } - if (copy_from_user(, (void __user *)(uintptr_t)args->syncpts, + if (copy_from_user(, u64_to_user_ptr(args->syncpts), sizeof(syncpt))) { err = -EFAULT; goto fail; -- 2.14.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/4] gpu: host1x: Enable gather filter
The gather filter is a feature present on Tegra124 and newer where the hardware prevents GATHERed command buffers from executing commands normally reserved for the CDMA pushbuffer which is maintained by the kernel driver. This commit enables the gather filter on all supporting hardware. Signed-off-by: Mikko Perttunen--- drivers/gpu/host1x/hw/channel_hw.c | 22 ++ drivers/gpu/host1x/hw/hw_host1x04_channel.h | 12 drivers/gpu/host1x/hw/hw_host1x05_channel.h | 12 3 files changed, 46 insertions(+) diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c index 0161da331702..5c0dc6bb51d1 100644 --- a/drivers/gpu/host1x/hw/channel_hw.c +++ b/drivers/gpu/host1x/hw/channel_hw.c @@ -181,10 +181,32 @@ static int channel_submit(struct host1x_job *job) return err; } +static void enable_gather_filter(struct host1x *host, +struct host1x_channel *ch) +{ +#if HOST1X_HW >= 6 + u32 val; + + if (!host->hv_regs) + return; + + val = host1x_hypervisor_readl( + host, HOST1X_HV_CH_KERNEL_FILTER_GBUFFER(ch->id / 32)); + val |= BIT(ch->id % 32); + host1x_hypervisor_writel( + host, val, HOST1X_HV_CH_KERNEL_FILTER_GBUFFER(ch->id / 32)); +#elif HOST1X_HW >= 4 + host1x_ch_writel(ch, +HOST1X_CHANNEL_CHANNELCTRL_KERNEL_FILTER_GBUFFER(1), +HOST1X_CHANNEL_CHANNELCTRL); +#endif +} + static int host1x_channel_init(struct host1x_channel *ch, struct host1x *dev, unsigned int index) { ch->regs = dev->regs + index * HOST1X_CHANNEL_SIZE; + enable_gather_filter(dev, ch); return 0; } diff --git a/drivers/gpu/host1x/hw/hw_host1x04_channel.h b/drivers/gpu/host1x/hw/hw_host1x04_channel.h index 95e6f96142b9..2e8b635aa660 100644 --- a/drivers/gpu/host1x/hw/hw_host1x04_channel.h +++ b/drivers/gpu/host1x/hw/hw_host1x04_channel.h @@ -117,5 +117,17 @@ static inline u32 host1x_channel_dmactrl_dmainitget(void) } #define HOST1X_CHANNEL_DMACTRL_DMAINITGET \ host1x_channel_dmactrl_dmainitget() +static inline u32 host1x_channel_channelctrl_r(void) +{ + return 0x98; +} +#define HOST1X_CHANNEL_CHANNELCTRL \ + host1x_channel_channelctrl_r() +static inline u32 host1x_channel_channelctrl_kernel_filter_gbuffer_f(u32 v) +{ + return (v & 0x1) << 2; +} +#define HOST1X_CHANNEL_CHANNELCTRL_KERNEL_FILTER_GBUFFER(v) \ + host1x_channel_channelctrl_kernel_filter_gbuffer_f(v) #endif diff --git a/drivers/gpu/host1x/hw/hw_host1x05_channel.h b/drivers/gpu/host1x/hw/hw_host1x05_channel.h index fce6e2c1ff4c..abbbc2641ce6 100644 --- a/drivers/gpu/host1x/hw/hw_host1x05_channel.h +++ b/drivers/gpu/host1x/hw/hw_host1x05_channel.h @@ -117,5 +117,17 @@ static inline u32 host1x_channel_dmactrl_dmainitget(void) } #define HOST1X_CHANNEL_DMACTRL_DMAINITGET \ host1x_channel_dmactrl_dmainitget() +static inline u32 host1x_channel_channelctrl_r(void) +{ + return 0x98; +} +#define HOST1X_CHANNEL_CHANNELCTRL \ + host1x_channel_channelctrl_r() +static inline u32 host1x_channel_channelctrl_kernel_filter_gbuffer_f(u32 v) +{ + return (v & 0x1) << 2; +} +#define HOST1X_CHANNEL_CHANNELCTRL_KERNEL_FILTER_GBUFFER(v) \ + host1x_channel_channelctrl_kernel_filter_gbuffer_f(v) #endif -- 2.14.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/4] gpu: host1x: Improve debug disassembly formatting
The host1x driver prints out "disassembly" dumps of the command FIFO and gather contents on submission timeouts. However, the output has been quite difficult to read with unnecessary newlines and occasional missing parentheses. Fix these problems by using pr_cont to remove unnecessary newlines and by fixing other small issues. Signed-off-by: Mikko Perttunen--- drivers/gpu/host1x/debug.c| 14 ++- drivers/gpu/host1x/debug.h| 14 --- drivers/gpu/host1x/hw/debug_hw.c | 46 ++- drivers/gpu/host1x/hw/debug_hw_1x01.c | 8 +++--- drivers/gpu/host1x/hw/debug_hw_1x06.c | 9 --- 5 files changed, 61 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/host1x/debug.c b/drivers/gpu/host1x/debug.c index 2aae0e63214c..dc77ec452ffc 100644 --- a/drivers/gpu/host1x/debug.c +++ b/drivers/gpu/host1x/debug.c @@ -40,7 +40,19 @@ void host1x_debug_output(struct output *o, const char *fmt, ...) len = vsnprintf(o->buf, sizeof(o->buf), fmt, args); va_end(args); - o->fn(o->ctx, o->buf, len); + o->fn(o->ctx, o->buf, len, false); +} + +void host1x_debug_cont(struct output *o, const char *fmt, ...) +{ + va_list args; + int len; + + va_start(args, fmt); + len = vsnprintf(o->buf, sizeof(o->buf), fmt, args); + va_end(args); + + o->fn(o->ctx, o->buf, len, true); } static int show_channel(struct host1x_channel *ch, void *data, bool show_fifo) diff --git a/drivers/gpu/host1x/debug.h b/drivers/gpu/host1x/debug.h index 4595b2e0799f..990cce47e737 100644 --- a/drivers/gpu/host1x/debug.h +++ b/drivers/gpu/host1x/debug.h @@ -24,22 +24,28 @@ struct host1x; struct output { - void (*fn)(void *ctx, const char *str, size_t len); + void (*fn)(void *ctx, const char *str, size_t len, bool cont); void *ctx; char buf[256]; }; -static inline void write_to_seqfile(void *ctx, const char *str, size_t len) +static inline void write_to_seqfile(void *ctx, const char *str, size_t len, + bool cont) { seq_write((struct seq_file *)ctx, str, len); } -static inline void write_to_printk(void *ctx, const char *str, size_t len) +static inline void write_to_printk(void *ctx, const char *str, size_t len, + bool cont) { - pr_info("%s", str); + if (cont) + pr_cont("%s", str); + else + pr_info("%s", str); } void __printf(2, 3) host1x_debug_output(struct output *o, const char *fmt, ...); +void __printf(2, 3) host1x_debug_cont(struct output *o, const char *fmt, ...); extern unsigned int host1x_debug_trace_cmdbuf; diff --git a/drivers/gpu/host1x/hw/debug_hw.c b/drivers/gpu/host1x/hw/debug_hw.c index 770d92e62d69..1e67667e308c 100644 --- a/drivers/gpu/host1x/hw/debug_hw.c +++ b/drivers/gpu/host1x/hw/debug_hw.c @@ -40,48 +40,59 @@ enum { static unsigned int show_channel_command(struct output *o, u32 val) { - unsigned int mask, subop; + unsigned int mask, subop, num; switch (val >> 28) { case HOST1X_OPCODE_SETCLASS: mask = val & 0x3f; if (mask) { - host1x_debug_output(o, "SETCL(class=%03x, offset=%03x, mask=%02x, [", + host1x_debug_cont(o, "SETCL(class=%03x, offset=%03x, mask=%02x, [", val >> 6 & 0x3ff, val >> 16 & 0xfff, mask); return hweight8(mask); } - host1x_debug_output(o, "SETCL(class=%03x)\n", val >> 6 & 0x3ff); + host1x_debug_cont(o, "SETCL(class=%03x)\n", val >> 6 & 0x3ff); return 0; case HOST1X_OPCODE_INCR: - host1x_debug_output(o, "INCR(offset=%03x, [", + num = val & 0x; + host1x_debug_cont(o, "INCR(offset=%03x, [", val >> 16 & 0xfff); - return val & 0x; + if (!num) + host1x_debug_cont(o, "])\n"); + + return num; case HOST1X_OPCODE_NONINCR: - host1x_debug_output(o, "NONINCR(offset=%03x, [", + num = val & 0x; + host1x_debug_cont(o, "NONINCR(offset=%03x, [", val >> 16 & 0xfff); - return val & 0x; + if (!num) + host1x_debug_cont(o, "])\n"); + + return num; case HOST1X_OPCODE_MASK: mask = val & 0x; - host1x_debug_output(o, "MASK(offset=%03x, mask=%03x, [", + host1x_debug_cont(o, "MASK(offset=%03x, mask=%03x, [", val >> 16 & 0xfff, mask); + if (!mask) + host1x_debug_cont(o, "])\n"); + return
[PATCH 0/4] Miscellaneous improvements to Host1x and TegraDRM
Hi all, here are some new features and improvements. Patch 1 enables syncpoint protection which prevents channels from touching syncpoints not belonging to them on Tegra186. Patch 2 enables the gather filter which prevents userspace command buffers from using CDMA commands usually reserved for the kernel. A test is available at git://github.com/cyndis/host1x_test, branch gather-filter. Patch 3 greatly improves formatting of debug dumps spewed by host1x in case of job timeouts. They are now actually readable by humans without use of additional scripts. Patch 4 is a simple aesthetical fix to the TegraDRM submit path. Everything was tested on TX1 and TX2 and should be applied on the previously posted Tegra186 support series. Cheers, Mikko *** BLURB HERE *** Mikko Perttunen (4): gpu: host1x: Enable Tegra186 syncpoint protection gpu: host1x: Enable gather filter gpu: host1x: Improve debug disassembly formatting drm/tegra: Use u64_to_user_ptr helper drivers/gpu/drm/tegra/drm.c | 9 +++--- drivers/gpu/host1x/debug.c | 14 - drivers/gpu/host1x/debug.h | 14 ++--- drivers/gpu/host1x/dev.h| 16 ++ drivers/gpu/host1x/hw/channel_hw.c | 25 drivers/gpu/host1x/hw/debug_hw.c| 46 ++--- drivers/gpu/host1x/hw/debug_hw_1x01.c | 8 ++--- drivers/gpu/host1x/hw/debug_hw_1x06.c | 9 +++--- drivers/gpu/host1x/hw/hw_host1x04_channel.h | 12 drivers/gpu/host1x/hw/hw_host1x05_channel.h | 12 drivers/gpu/host1x/hw/syncpt_hw.c | 26 drivers/gpu/host1x/syncpt.c | 3 ++ 12 files changed, 159 insertions(+), 35 deletions(-) -- 2.14.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/4] gpu: host1x: Enable Tegra186 syncpoint protection
Since Tegra186 the Host1x hardware allows syncpoints to be assigned to specific channels, preventing any other channels from incrementing them. Enable this feature where available and assign syncpoints to channels when submitting a job. Syncpoints are currently never unassigned from channels since that would require extra work and is unnecessary with the current channel allocation model. Signed-off-by: Mikko Perttunen--- drivers/gpu/host1x/dev.h | 16 drivers/gpu/host1x/hw/channel_hw.c | 3 +++ drivers/gpu/host1x/hw/syncpt_hw.c | 26 ++ drivers/gpu/host1x/syncpt.c| 3 +++ 4 files changed, 48 insertions(+) diff --git a/drivers/gpu/host1x/dev.h b/drivers/gpu/host1x/dev.h index def802c0a6bf..2432a30ff6e2 100644 --- a/drivers/gpu/host1x/dev.h +++ b/drivers/gpu/host1x/dev.h @@ -79,6 +79,9 @@ struct host1x_syncpt_ops { u32 (*load)(struct host1x_syncpt *syncpt); int (*cpu_incr)(struct host1x_syncpt *syncpt); int (*patch_wait)(struct host1x_syncpt *syncpt, void *patch_addr); + void (*assign_channel)(struct host1x_syncpt *syncpt, + struct host1x_channel *channel); + void (*set_protection)(struct host1x *host, bool enabled); }; struct host1x_intr_ops { @@ -186,6 +189,19 @@ static inline int host1x_hw_syncpt_patch_wait(struct host1x *host, return host->syncpt_op->patch_wait(sp, patch_addr); } +static inline void host1x_hw_syncpt_assign_channel(struct host1x *host, + struct host1x_syncpt *sp, + struct host1x_channel *ch) +{ + return host->syncpt_op->assign_channel(sp, ch); +} + +static inline void host1x_hw_syncpt_set_protection(struct host1x *host, + bool enabled) +{ + return host->syncpt_op->set_protection(host, enabled); +} + static inline int host1x_hw_intr_init_host_sync(struct host1x *host, u32 cpm, void (*syncpt_thresh_work)(struct work_struct *)) { diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c index 8447a56c41ca..0161da331702 100644 --- a/drivers/gpu/host1x/hw/channel_hw.c +++ b/drivers/gpu/host1x/hw/channel_hw.c @@ -147,6 +147,9 @@ static int channel_submit(struct host1x_job *job) syncval = host1x_syncpt_incr_max(sp, user_syncpt_incrs); + /* assign syncpoint to channel */ + host1x_hw_syncpt_assign_channel(host, sp, ch); + job->syncpt_end = syncval; /* add a setclass for modules that require it */ diff --git a/drivers/gpu/host1x/hw/syncpt_hw.c b/drivers/gpu/host1x/hw/syncpt_hw.c index 7b0270d60742..5d117ab1699e 100644 --- a/drivers/gpu/host1x/hw/syncpt_hw.c +++ b/drivers/gpu/host1x/hw/syncpt_hw.c @@ -106,6 +106,30 @@ static int syncpt_patch_wait(struct host1x_syncpt *sp, void *patch_addr) return 0; } +static void syncpt_assign_channel(struct host1x_syncpt *sp, + struct host1x_channel *ch) +{ +#if HOST1X_HW >= 6 + struct host1x *host = sp->host; + + if (!host->hv_regs) + return; + + host1x_sync_writel(host, + HOST1X_SYNC_SYNCPT_CH_APP_CH(ch ? ch->id : 0xff), + HOST1X_SYNC_SYNCPT_CH_APP(sp->id)); +#endif +} + +static void syncpt_set_protection(struct host1x *host, bool enabled) +{ +#if HOST1X_HW >= 6 + host1x_hypervisor_writel(host, +enabled ? HOST1X_HV_SYNCPT_PROT_EN_CH_EN : 0, +HOST1X_HV_SYNCPT_PROT_EN); +#endif +} + static const struct host1x_syncpt_ops host1x_syncpt_ops = { .restore = syncpt_restore, .restore_wait_base = syncpt_restore_wait_base, @@ -113,4 +137,6 @@ static const struct host1x_syncpt_ops host1x_syncpt_ops = { .load = syncpt_load, .cpu_incr = syncpt_cpu_incr, .patch_wait = syncpt_patch_wait, + .assign_channel = syncpt_assign_channel, + .set_protection = syncpt_set_protection, }; diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index 048ac9e344ce..fe4d963b3e2a 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c @@ -398,6 +398,8 @@ int host1x_syncpt_init(struct host1x *host) for (i = 0; i < host->info->nb_pts; i++) { syncpt[i].id = i; syncpt[i].host = host; + + host1x_hw_syncpt_assign_channel(host, [i], NULL); } for (i = 0; i < host->info->nb_bases; i++) @@ -408,6 +410,7 @@ int host1x_syncpt_init(struct host1x *host) host->bases = bases; host1x_syncpt_restore(host); + host1x_hw_syncpt_set_protection(host, true); /* Allocate sync point to use for clearing waits for expired fences */ host->nop_sp = host1x_syncpt_alloc(host, NULL, 0); -- 2.14.1
Re: [PATCH v3 1/2] drm/gem: drm_gem_dumb_map_offset(): reject dma-buf
(cc affected parties) Den 18.08.2017 09.46, skrev Daniel Vetter: On Thu, Aug 17, 2017 at 06:21:30PM +0200, Noralf Trønnes wrote: Reject mapping an imported dma-buf since is's an invalid use-case. Cc: Philipp ZabelCc: Laurent Pinchart Cc: Sean Paul Cc: Daniel Vetter Signed-off-by: Noralf Trønnes I think acks from someone using mali would be good too. amdgpu already has such checks, so I think on the desktop side we're ok. Acked-by: Daniel Vetter But I think this one here definitely needs a few more acks. I could break uabi if we're unlucky, so let's not rush it. Ok, I've CC'ed the affected parties to increase the odds that they look at this. These are the drivers using drm_gem_dumb_map_offset() (hopefully I got the list right): arc atmel-hlcdc cirrus exynos fsl-dcu gma500 hdlcd imx kirin mali-dp mediatek meson mxsfb pl111 rcar-du rockchip shmobile sti stm sun4i tegra tilcd vc4 zte Noralf. -Daniel --- drivers/gpu/drm/drm_gem.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index ad4e9cf..8da5801 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -333,6 +333,12 @@ int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, if (!obj) return -ENOENT; + /* Don't allow imported objects to be mapped */ + if (obj->import_attach) { + ret = -EINVAL; + goto out; + } + ret = drm_gem_create_mmap_offset(obj); if (ret) goto out; -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PULL] drm-misc-fixes
Hi Dave, Here's the latest and greatest from drm-misc-fixes. We have a couple nice cleanups from Maarten centered around properly handling errors (and specifically EDEADLK) in atomic_check. I probably would have liked Mark's DRM_ERROR patch to go through -misc-next, but hopefully it's harmless enough to not lose sleep over. drm-misc-fixes-2017-08-18: Core Changes: - Fix framebuffer leak in setplane error condition (Nikil) - Prevent BUG in atomic_ioctl by properly resetting state on EDEADLK (Maarten) - Add missing return in atomic_check_only if atomic_check fails (Maarten) Driver Changes: - rockchip: Don't try to suspend if device not initialized (Jeffy) Cc: Jeffy ChenCc: Nikhil Mahale Cc: Maarten Lankhorst Cheers, Daniel ;-) The following changes since commit ef954844c7ace62f773f4f23e28d2d915adc419f: Linux 4.13-rc5 (2017-08-13 16:01:32 -0700) are available in the git repository at: git://anongit.freedesktop.org/git/drm-misc tags/drm-misc-fixes-2017-08-18 for you to fetch changes up to a0ffc51e20e90e0c1c2491de2b4b03f48b6caaba: drm/atomic: If the atomic check fails, return its value first (2017-08-15 12:38:05 +0200) Core Changes: - Fix framebuffer leak in setplane error condition (Nikil) - Prevent BUG in atomic_ioctl by properly resetting state on EDEADLK (Maarten) - Add missing return in atomic_check_only if atomic_check fails (Maarten) Driver Changes: - rockchip: Don't try to suspend if device not initialized (Jeffy) Cc: Jeffy Chen Cc: Nikhil Mahale Cc: Maarten Lankhorst Jeffy Chen (1): drm/rockchip: Fix suspend crash when drm is not bound Maarten Lankhorst (2): drm/atomic: Handle -EDEADLK with out-fences correctly drm/atomic: If the atomic check fails, return its value first Nikhil Mahale (1): drm: Fix framebuffer leak Sean Paul (1): Merge origin/master into drm-misc-fixes drivers/gpu/drm/drm_atomic.c| 11 --- drivers/gpu/drm/drm_plane.c | 1 + drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 12 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) -- Sean Paul, Software Engineer, Google / Chromium OS ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 13/14] drm/cirrus: implement atomic hardware cursor support
From: Varad GautamThis enables cursor plane on cirrus. It only supports ARGB 8-bit cursors from userspace, and downconverts them to 1-bit black and white with masking, which is all cirrus hardware can support. Only cursors with size 32x32 or 64x64 will work. initial non-atomic version: Reviewed-at: https://chromium-review.googlesource.com/335579 https://chromium-review.googlesource.com/339091 Signed-off-by: Zach Reizner Signed-off-by: Varad Gautam CC: Haixia Shi CC: Stéphane Marchesin --- drivers/gpu/drm/cirrus/cirrus_drv.h | 13 ++ drivers/gpu/drm/cirrus/cirrus_main.c | 13 ++ drivers/gpu/drm/cirrus/cirrus_mode.c | 281 +-- 3 files changed, 297 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h index d680815f23e6..fbd76c4e6d57 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h @@ -50,6 +50,17 @@ WREG8(SEQ_DATA, v); \ } while (0) \ +#define PAL_ADDR 8 +#define PAL_DATA 9 + +#define WREG_PAL(addr, r, g, b)\ + do {\ + WREG8(PAL_ADDR, addr); \ + WREG8(PAL_DATA, r); \ + WREG8(PAL_DATA, g); \ + WREG8(PAL_DATA, b); \ + } while (0) \ + #define CRT_INDEX 0x14 #define CRT_DATA 0x15 @@ -137,6 +148,8 @@ struct cirrus_device { void __iomem*rmmio; struct cirrus_mcmc; + resource_size_t cursor_ram_size; + void __iomem*cursor_iomem; struct cirrus_mode_info mode_info; int num_crtc; diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c index 7d0431bbc6e3..20229b13d6d2 100644 --- a/drivers/gpu/drm/cirrus/cirrus_main.c +++ b/drivers/gpu/drm/cirrus/cirrus_main.c @@ -94,6 +94,8 @@ static void cirrus_vram_fini(struct cirrus_device *cdev) cdev->rmmio = NULL; if (cdev->mc.vram_base) release_mem_region(cdev->mc.vram_base, cdev->mc.vram_size); + if (cdev->cursor_iomem) + iounmap(cdev->cursor_iomem); } /* Map the framebuffer from the card and configure the core */ @@ -107,12 +109,23 @@ static int cirrus_vram_init(struct cirrus_device *cdev) * find the cursor data at the 4M - 16K point. */ cdev->mc.vram_size = 4 * 1024 * 1024; + /* The last 16K of VRAM is for cursor */ + cdev->cursor_ram_size = 16 * 1024; if (!request_mem_region(cdev->mc.vram_base, cdev->mc.vram_size, "cirrusdrmfb_vram")) { DRM_ERROR("can't reserve VRAM\n"); return -ENXIO; } + cdev->cursor_iomem = ioremap_nocache(cdev->mc.vram_base + +cdev->mc.vram_size - +cdev->cursor_ram_size, +cdev->cursor_ram_size); + if (!cdev->cursor_iomem) { + release_mem_region(cdev->mc.vram_base, cdev->mc.vram_size); + DRM_ERROR("can't ioremap cursor VRAM\n"); + return -ENXIO; + } return 0; } diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 39bea39a565e..915028159975 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -254,6 +254,231 @@ static const struct drm_crtc_helper_funcs cirrus_helper_funcs = { .atomic_flush = cirrus_crtc_atomic_flush, }; +static void cirrus_argb_to_cursor(void *src , void __iomem *dst, + uint32_t cursor_size) +{ + uint8_t *pixel = (uint8_t *)src; + const uint32_t row_size = cursor_size / 8; + const uint32_t plane_size = row_size * cursor_size; + uint32_t row_skip; + void __iomem *plane_0 = dst; + void __iomem *plane_1; + uint32_t x; + uint32_t y; + + switch (cursor_size) { + case 32: + row_skip = 0; + plane_1 = plane_0 + plane_size; + break; + case 64: + row_skip = row_size; + plane_1 = plane_0 + row_size; + break; + default: + DRM_DEBUG("Cursor plane format is undefined for given size"); + return; + } + + for (y = 0; y < cursor_size; y++) { + uint8_t bits_0 = 0; + uint8_t bits_1 = 0; + +
[PATCH 14/14] drm/cirrus: advertise DRIVER_ATOMIC
From: Varad Gautamallow userspace to use atomic ioctls. we now pass the following tests: igt/kms_atomic_transition: plane-all-transition plane-use-after-nonblocking-unbind plane-all-modeset-transition plane-toggle-modeset-transition 1x-modeset-transitions 1x-modeset-transitions-nonblocking igt/kms_atomic: plane_primary_legacy test_only plane_cursor_legacy plane_invalid_params crtc_invalid_params igt/kms_setmode igt/kms_rmfb drm-tests/atomictest: disable_primary fullscreen_video overlay_pageflip primary_pageflip video_overlay Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index dca7a3f4791d..1e9878103a38 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c @@ -130,7 +130,8 @@ static const struct file_operations cirrus_driver_fops = { .compat_ioctl = drm_compat_ioctl, }; static struct drm_driver driver = { - .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME, + .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | + DRIVER_ATOMIC, .load = cirrus_driver_load, .unload = cirrus_driver_unload, .set_busid = drm_pci_set_busid, -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 11/14] drm/cirrus: send vblank on crtc atomic_flush
From: Varad Gautamthe hardware does not provide interrupts on vblank, so we just send a fake vblank event on atomic_flush. Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_mode.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index eda3c4d18b37..e777157fe474 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -226,6 +226,23 @@ static void cirrus_crtc_destroy(struct drm_crtc *crtc) kfree(cirrus_crtc); } +static void cirrus_crtc_atomic_flush(struct drm_crtc *crtc, +struct drm_crtc_state *old_crtc_state) +{ + struct drm_device *dev = crtc->dev; + struct drm_pending_vblank_event *event; + unsigned long flags; + + if (crtc->state && crtc->state->event) { + event = crtc->state->event; + crtc->state->event = NULL; + + spin_lock_irqsave(>event_lock, flags); + drm_crtc_send_vblank_event(crtc, event); + spin_unlock_irqrestore(>event_lock, flags); + } +} + /* These provide the minimum set of functions required to handle a CRTC */ static const struct drm_crtc_funcs cirrus_crtc_funcs = { .gamma_set = cirrus_crtc_gamma_set, @@ -244,6 +261,7 @@ static const struct drm_crtc_helper_funcs cirrus_helper_funcs = { .prepare = cirrus_crtc_prepare, .commit = cirrus_crtc_commit, .load_lut = cirrus_crtc_load_lut, + .atomic_flush = cirrus_crtc_atomic_flush, }; static int cirrus_plane_update(struct drm_plane *plane, -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 12/14] drm/cirrus: use atomic handlers for plane and crtc
From: Varad Gautammove from transition helpers to actual atomic handlers. Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_mode.c | 31 --- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index e777157fe474..39bea39a565e 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -179,15 +179,6 @@ static void cirrus_mode_set_nofb(struct drm_crtc *crtc) } /* - * This is called before a mode is programmed. A typical use might be to - * enable DPMS during the programming to avoid seeing intermediate stages, - * but that's not relevant to us - */ -static void cirrus_crtc_prepare(struct drm_crtc *crtc) -{ -} - -/* * This is called after a mode is programmed. It should reverse anything done * by the prepare function */ @@ -246,8 +237,10 @@ static void cirrus_crtc_atomic_flush(struct drm_crtc *crtc, /* These provide the minimum set of functions required to handle a CRTC */ static const struct drm_crtc_funcs cirrus_crtc_funcs = { .gamma_set = cirrus_crtc_gamma_set, - .set_config = drm_crtc_helper_set_config, + .set_config = drm_atomic_helper_set_config, + .set_property = drm_atomic_helper_crtc_set_property, .destroy = cirrus_crtc_destroy, + .page_flip = drm_atomic_helper_page_flip, .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, @@ -255,28 +248,12 @@ static const struct drm_crtc_funcs cirrus_crtc_funcs = { static const struct drm_crtc_helper_funcs cirrus_helper_funcs = { .dpms = cirrus_crtc_dpms, - .mode_set = drm_helper_crtc_mode_set, - .mode_set_base = drm_helper_crtc_mode_set_base, .mode_set_nofb = cirrus_mode_set_nofb, - .prepare = cirrus_crtc_prepare, .commit = cirrus_crtc_commit, .load_lut = cirrus_crtc_load_lut, .atomic_flush = cirrus_crtc_atomic_flush, }; -static int cirrus_plane_update(struct drm_plane *plane, - struct drm_crtc *crtc, - struct drm_framebuffer *fb, int crtc_x, - int crtc_y, unsigned int crtc_w, - unsigned int crtc_h, uint32_t src_x, - uint32_t src_y, uint32_t src_w, uint32_t src_h, - struct drm_modeset_acquire_ctx *ctx) -{ - return drm_plane_helper_update(plane, crtc, fb, - crtc_x, crtc_y, crtc_w, - crtc_h, src_x, src_y, src_w, src_h); -} - static const uint32_t cirrus_plane_formats[] = { DRM_FORMAT_XRGB, DRM_FORMAT_ARGB, @@ -285,7 +262,7 @@ static const uint32_t cirrus_plane_formats[] = { }; static const struct drm_plane_funcs cirrus_plane_funcs = { - .update_plane = cirrus_plane_update, + .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_primary_helper_disable, .destroy= drm_primary_helper_destroy, .reset = drm_atomic_helper_plane_reset, -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 10/14] drm/cirrus: use atomic transition helpers for plane and crtc
From: Varad Gautamsplit the driver to fit into atomic semantics, and switch to using the atomic transition layer helpers for legacy modesetting. Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_drv.h | 1 + drivers/gpu/drm/cirrus/cirrus_main.c | 3 + drivers/gpu/drm/cirrus/cirrus_mode.c | 350 ++- 3 files changed, 227 insertions(+), 127 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h index 29de4f0dbd01..d680815f23e6 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h @@ -168,6 +168,7 @@ struct cirrus_bo { struct drm_gem_object gem; struct ttm_place placements[3]; int pin_count; + u64 gpu_addr; }; #define gem_to_cirrus_bo(gobj) container_of((gobj), struct cirrus_bo, gem) diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c index c92ccb00db62..7d0431bbc6e3 100644 --- a/drivers/gpu/drm/cirrus/cirrus_main.c +++ b/drivers/gpu/drm/cirrus/cirrus_main.c @@ -9,6 +9,7 @@ * Dave Airlie */ #include +#include #include #include "cirrus_drv.h" @@ -82,6 +83,8 @@ cirrus_user_framebuffer_create(struct drm_device *dev, static const struct drm_mode_config_funcs cirrus_mode_funcs = { .fb_create = cirrus_user_framebuffer_create, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = drm_atomic_helper_commit, }; /* Unmap the framebuffer from the core and release the memory */ diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 2994dd391850..eda3c4d18b37 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -15,6 +15,8 @@ * Copyright 1999-2001 Jeff Garzik */ #include +#include +#include #include #include @@ -91,95 +93,20 @@ static void cirrus_crtc_dpms(struct drm_crtc *crtc, int mode) WREG_GFX(0xe, gr0e); } -static void cirrus_set_start_address(struct drm_crtc *crtc, unsigned offset) -{ - struct cirrus_device *cdev = crtc->dev->dev_private; - u32 addr; - u8 tmp; - - addr = offset >> 2; - WREG_CRT(0x0c, (u8)((addr >> 8) & 0xff)); - WREG_CRT(0x0d, (u8)(addr & 0xff)); - - WREG8(CRT_INDEX, 0x1b); - tmp = RREG8(CRT_DATA); - tmp &= 0xf2; - tmp |= (addr >> 16) & 0x01; - tmp |= (addr >> 15) & 0x0c; - WREG_CRT(0x1b, tmp); - WREG8(CRT_INDEX, 0x1d); - tmp = RREG8(CRT_DATA); - tmp &= 0x7f; - tmp |= (addr >> 12) & 0x80; - WREG_CRT(0x1d, tmp); -} - -/* cirrus is different - we will force move buffers out of VRAM */ -static int cirrus_crtc_do_set_base(struct drm_crtc *crtc, - struct drm_framebuffer *fb, - int x, int y, int atomic) -{ - struct cirrus_device *cdev = crtc->dev->dev_private; - struct drm_gem_object *obj; - struct cirrus_framebuffer *cirrus_fb; - struct cirrus_bo *bo; - int ret; - u64 gpu_addr; - - /* push the previous fb to system ram */ - if (!atomic && fb) { - cirrus_fb = to_cirrus_framebuffer(fb); - obj = cirrus_fb->obj; - bo = gem_to_cirrus_bo(obj); - cirrus_bo_unpin(bo); - cirrus_bo_push_sysram(bo); - } - - cirrus_fb = to_cirrus_framebuffer(crtc->primary->fb); - obj = cirrus_fb->obj; - bo = gem_to_cirrus_bo(obj); - - ret = cirrus_bo_pin(bo, TTM_PL_FLAG_VRAM, _addr); - if (ret) - return ret; - - if (>mode_info.gfbdev->gfb == cirrus_fb) { - /* if pushing console in kmap it */ - ret = ttm_bo_kmap(>bo, 0, bo->bo.num_pages, >kmap); - if (ret) - DRM_ERROR("failed to kmap fbcon\n"); - } - - cirrus_set_start_address(crtc, (u32)gpu_addr); - return 0; -} - -static int cirrus_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, -struct drm_framebuffer *old_fb) -{ - return cirrus_crtc_do_set_base(crtc, old_fb, x, y, 0); -} - /* - * The meat of this driver. The core passes us a mode and we have to program - * it. The modesetting here is the bare minimum required to satisfy the qemu - * emulation of this hardware, and running this against a real device is - * likely to result in an inadequately programmed mode. We've already had - * the opportunity to modify the mode, so whatever we receive here should - * be something that can be correctly programmed and displayed + * The core passes us a mode and we have to program it. The modesetting here + * is the bare minimum required to satisfy the qemu emulation of this + * hardware, and running this against a real device is likely to result in + * an inadequately programmed mode. */ -static int
[PATCH 09/14] drm/cirrus: use universal plane interfaces for primary plane
From: Varad Gautamcirrus exposes one legacy primary plane tied to the crtc. convert this to use the universal planes interface in preparation for atomic. Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_mode.c | 44 ++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 6032978a2797..2994dd391850 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -358,12 +358,29 @@ static const struct drm_crtc_helper_funcs cirrus_helper_funcs = { .load_lut = cirrus_crtc_load_lut, }; +static const uint32_t cirrus_plane_formats[] = { + DRM_FORMAT_XRGB, + DRM_FORMAT_ARGB, + DRM_FORMAT_RGB888, + DRM_FORMAT_RGB565, +}; + +static const struct drm_plane_funcs cirrus_plane_funcs = { + .update_plane = drm_primary_helper_update, + .disable_plane = drm_primary_helper_disable, + .destroy= drm_primary_helper_destroy, +}; + +static const struct drm_plane_helper_funcs cirrus_plane_helper_funcs = { +}; + /* CRTC setup */ static void cirrus_crtc_init(struct drm_device *dev) { struct cirrus_device *cdev = dev->dev_private; struct cirrus_crtc *cirrus_crtc; - int i; + struct drm_plane *primary; + int i, ret; cirrus_crtc = kzalloc(sizeof(struct cirrus_crtc) + (CIRRUSFB_CONN_LIMIT * sizeof(struct drm_connector *)), @@ -372,8 +389,23 @@ static void cirrus_crtc_init(struct drm_device *dev) if (cirrus_crtc == NULL) return; - drm_crtc_init(dev, _crtc->base, _crtc_funcs); + primary = kzalloc(sizeof(*primary), GFP_KERNEL); + if (primary == NULL) + goto cleanup_crtc; + drm_plane_helper_add(primary, _plane_helper_funcs); + ret = drm_universal_plane_init(dev, primary, 1, + _plane_funcs, + cirrus_plane_formats, + ARRAY_SIZE(cirrus_plane_formats), + DRM_PLANE_TYPE_PRIMARY, NULL); + if (ret) + goto cleanup; + + ret = drm_crtc_init_with_planes(dev, _crtc->base, primary, NULL, + _crtc_funcs, NULL); + if (ret) + goto cleanup; drm_mode_crtc_set_gamma_size(_crtc->base, CIRRUS_LUT_SIZE); cdev->mode_info.crtc = cirrus_crtc; @@ -384,6 +416,14 @@ static void cirrus_crtc_init(struct drm_device *dev) } drm_crtc_helper_add(_crtc->base, _helper_funcs); + return; + +cleanup: + drm_plane_cleanup(primary); + kfree(primary); +cleanup_crtc: + kfree(cirrus_crtc); + return; } /** Sets the color ramps on behalf of fbcon */ -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 08/14] drm/cirrus: implement PRIME export for cirrus
From: Zach ReiznerThis patch implements PRIME export, but not import for cirrus. initially reviewed at: https://chromium-review.googlesource.com/229688 https://chromium-review.googlesource.com/339057 Signed-off-by: Zach Reizner Signed-off-by: Stphane Marchesin Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/Makefile | 2 +- drivers/gpu/drm/cirrus/cirrus_drv.c | 11 +- drivers/gpu/drm/cirrus/cirrus_drv.h | 10 ++ drivers/gpu/drm/cirrus/cirrus_prime.c | 63 +++ 4 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/cirrus/cirrus_prime.c diff --git a/drivers/gpu/drm/cirrus/Makefile b/drivers/gpu/drm/cirrus/Makefile index 919c0a336c97..f6bcc21454c6 100644 --- a/drivers/gpu/drm/cirrus/Makefile +++ b/drivers/gpu/drm/cirrus/Makefile @@ -1,4 +1,4 @@ cirrus-y := cirrus_main.o cirrus_mode.o \ - cirrus_drv.o cirrus_fbdev.o cirrus_ttm.o + cirrus_drv.o cirrus_fbdev.o cirrus_ttm.o cirrus_prime.o obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus.o diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index dfaeea92d344..dca7a3f4791d 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c @@ -130,7 +130,7 @@ static const struct file_operations cirrus_driver_fops = { .compat_ioctl = drm_compat_ioctl, }; static struct drm_driver driver = { - .driver_features = DRIVER_MODESET | DRIVER_GEM, + .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME, .load = cirrus_driver_load, .unload = cirrus_driver_unload, .set_busid = drm_pci_set_busid, @@ -145,6 +145,15 @@ static struct drm_driver driver = { .dumb_create = cirrus_dumb_create, .dumb_map_offset = cirrus_dumb_mmap_offset, .dumb_destroy = drm_gem_dumb_destroy, + .prime_handle_to_fd = drm_gem_prime_handle_to_fd, + .prime_fd_to_handle = drm_gem_prime_fd_to_handle, + .gem_prime_export = drm_gem_prime_export, + .gem_prime_import = drm_gem_prime_import, + .gem_prime_pin = cirrus_gem_prime_pin, + .gem_prime_get_sg_table = cirrus_gem_prime_get_sg_table, + .gem_prime_import_sg_table = cirrus_gem_prime_import_sg_table, + .gem_prime_vmap = cirrus_gem_prime_vmap, + .gem_prime_vunmap = cirrus_gem_prime_vunmap, }; static const struct dev_pm_ops cirrus_pm_ops = { diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h index 8cdf6b0db4a7..29de4f0dbd01 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h @@ -164,6 +164,7 @@ struct cirrus_bo { struct ttm_buffer_object bo; struct ttm_placement placement; struct ttm_bo_kmap_obj kmap; + struct ttm_bo_kmap_obj dma_buf_vmap; struct drm_gem_object gem; struct ttm_place placements[3]; int pin_count; @@ -264,6 +265,15 @@ int cirrus_bo_push_sysram(struct cirrus_bo *bo); int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr); int cirrus_bo_unpin(struct cirrus_bo *bo); +struct sg_table *cirrus_gem_prime_get_sg_table(struct drm_gem_object *obj); +void *cirrus_gem_prime_vmap(struct drm_gem_object *obj); +void cirrus_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr); +struct drm_gem_object *cirrus_gem_prime_import_sg_table( + struct drm_device *dev, + struct dma_buf_attachment *attach, + struct sg_table *sgt); +int cirrus_gem_prime_pin(struct drm_gem_object *obj); + extern int cirrus_bpp; #endif /* __CIRRUS_DRV_H__ */ diff --git a/drivers/gpu/drm/cirrus/cirrus_prime.c b/drivers/gpu/drm/cirrus/cirrus_prime.c new file mode 100644 index ..a7fe6c73bfb6 --- /dev/null +++ b/drivers/gpu/drm/cirrus/cirrus_prime.c @@ -0,0 +1,63 @@ +/* + * Copyright © 2014 The Chromium OS Authors + * + * This file is subject to the terms and conditions of the GNU General + * Public License version 2. See the file COPYING in the main + * directory of this archive for more details. + * + */ + +#include +#include +#include "cirrus_drv.h" + +struct sg_table *cirrus_gem_prime_get_sg_table(struct drm_gem_object *obj) +{ + struct cirrus_bo *cirrusbo = gem_to_cirrus_bo(obj); + unsigned long npages = cirrusbo->bo.num_pages; + + return drm_prime_pages_to_sg(cirrusbo->bo.ttm->pages, npages); +} + +void *cirrus_gem_prime_vmap(struct drm_gem_object *obj) +{ + struct cirrus_bo *cirrusbo = gem_to_cirrus_bo(obj); + int ret; + + ret = ttm_bo_kmap(>bo, 0, cirrusbo->bo.num_pages, + >dma_buf_vmap); + if (ret) + return ERR_PTR(ret); + + return cirrusbo->dma_buf_vmap.virtual; +} + +void cirrus_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
[PATCH 06/14] drm/cirrus: Use 32bpp by default
From: Stéphane Marchesininitially reviewed for ChromiumOS at: https://chromium-review.googlesource.com/339093 Signed-off-by: Stéphane Marchesin --- drivers/gpu/drm/cirrus/cirrus_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index bae34f5c2c02..dfaeea92d344 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c @@ -16,11 +16,11 @@ #include "cirrus_drv.h" int cirrus_modeset = -1; -int cirrus_bpp = 24; +int cirrus_bpp = 32; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, cirrus_modeset, int, 0400); -MODULE_PARM_DESC(bpp, "Max bits-per-pixel (default:24)"); +MODULE_PARM_DESC(bpp, "Max bits-per-pixel (default:32)"); module_param_named(bpp, cirrus_bpp, int, 0400); /* -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 07/14] drm/cirrus: hardcode vram size
From: Zach ReiznerThere is no reliable way of detecting actual VRAM size, which is important in the case of cirrus because cursor data is always stored in the last 16K of VRAM. Because qemu effectivaly hardcodes 4MB but reports 32MB, we hardcode 4MB in the cirrus driver to ensure the cursor works properly. initially reviewed at: https://chromium-review.googlesource.com/411344 Signed-off-by: Zach Reizner CC: Stéphane Marchesin --- drivers/gpu/drm/cirrus/cirrus_main.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c index e7fc95f63dca..c92ccb00db62 100644 --- a/drivers/gpu/drm/cirrus/cirrus_main.c +++ b/drivers/gpu/drm/cirrus/cirrus_main.c @@ -98,7 +98,12 @@ static int cirrus_vram_init(struct cirrus_device *cdev) { /* BAR 0 is VRAM */ cdev->mc.vram_base = pci_resource_start(cdev->dev->pdev, 0); - cdev->mc.vram_size = pci_resource_len(cdev->dev->pdev, 0); + + /* +* While we can use the entire PCI bar for VRAM, qemu always expects to +* find the cursor data at the 4M - 16K point. +*/ + cdev->mc.vram_size = 4 * 1024 * 1024; if (!request_mem_region(cdev->mc.vram_base, cdev->mc.vram_size, "cirrusdrmfb_vram")) { -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 05/14] drm/cirrus: initialize start and size fields
From: Dominik Behrinitialize start and size fields in fb info so user space drivers like fbdev can map the memory cherry-pick from 3.14 to 3.18 kernel to let VMtest pass dmesg now shows proper size and fb start initially reviewed for chromiumos at: https://chromium-review.googlesource.com/167396 https://chromium-review.googlesource.com/282933 https://chromium-review.googlesource.com/339092 Signed-off-by: Dominik Behr Signed-off-by: Zhuo-hao Lee Signed-off-by: Stéphane Marchesin --- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c index ed96dae1c205..4bc7d8f60e97 100644 --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c @@ -232,6 +232,9 @@ static int cirrusfb_create(struct drm_fb_helper *helper, info->screen_base = sysram; info->screen_size = size; + info->fix.smem_start = cdev->dev->mode_config.fb_base; + info->fix.smem_len = size; + info->fix.mmio_start = 0; info->fix.mmio_len = 0; -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 03/14] drm/cirrus: add drm_read to cirrus_driver_fops
From: Varad Gautamallow reading the drm file from userspace. Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index d893ea21a359..bae34f5c2c02 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c @@ -122,6 +122,7 @@ static int cirrus_pm_resume(struct device *dev) static const struct file_operations cirrus_driver_fops = { .owner = THIS_MODULE, .open = drm_open, + .read = drm_read, .release = drm_release, .unlocked_ioctl = drm_ioctl, .mmap = cirrus_mmap, -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 04/14] drm/cirrus: do not disable outputs on fbdev init for atomic.
From: Varad Gautamdrm_helper_disable_unused_functions should not be called by atomic drivers, so disable it for later patches. Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c index 7fa58eeadc9d..ed96dae1c205 100644 --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c @@ -296,9 +296,6 @@ int cirrus_fbdev_init(struct cirrus_device *cdev) if (ret) return ret; - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(cdev->dev); - return drm_fb_helper_initial_config(>helper, bpp_sel); } -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 02/14] drm/cirrus: unregister connector on destroy
From: Varad Gautamadd missing unregister call on connector destroy. Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_mode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 21d75e7e4abc..6032978a2797 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -492,6 +492,7 @@ static struct drm_encoder *cirrus_connector_best_encoder(struct drm_connector static void cirrus_connector_destroy(struct drm_connector *connector) { + drm_connector_unregister(connector); drm_connector_cleanup(connector); kfree(connector); } -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 00/14] atomic modesetting for cirrus
Hello, This series converts drm/cirrus to support atomic modesetting for the emulated CL GD-54xx hw in qemu. Patches 1-7 are general fixes and improvements, in preparation for atomic. Patch 8 provides dmabuf export for cirrus. Patch 9-11 add universal primary plane support and rework the driver to use atomic transition helpers for legacy modesetting. Patch 12 moves away from legacy modesetting entirely to use atomic handlers. Patch 13 adds atomic cursor plane. Patch 14 flips on DRIVER_ATOMIC. I have tested this with igt and chromeos/drm-tests (details in patch 14). Fun trivia from the GD-54xx TRM, 1996! It boasts 'optimized PCI burst write, which supports PCI writes to the frame buffer at greater than 55 Mbytes per second.' Dominik Behr (1): drm/cirrus: initialize start and size fields Stéphane Marchesin (1): drm/cirrus: Use 32bpp by default Varad Gautam (10): drm/cirrus: split out bo unpinning from cirrus_bo_push_sysram drm/cirrus: unregister connector on destroy drm/cirrus: add drm_read to cirrus_driver_fops drm/cirrus: do not disable outputs on fbdev init for atomic. drm/cirrus: use universal plane interfaces for primary plane drm/cirrus: use atomic transition helpers for plane and crtc drm/cirrus: send vblank on crtc atomic_flush drm/cirrus: use atomic handlers for plane and crtc drm/cirrus: implement atomic hardware cursor support drm/cirrus: advertise DRIVER_ATOMIC Zach Reizner (2): drm/cirrus: hardcode vram size drm/cirrus: implement PRIME export for cirrus drivers/gpu/drm/cirrus/Makefile | 2 +- drivers/gpu/drm/cirrus/cirrus_drv.c | 17 +- drivers/gpu/drm/cirrus/cirrus_drv.h | 25 ++ drivers/gpu/drm/cirrus/cirrus_fbdev.c | 6 +- drivers/gpu/drm/cirrus/cirrus_main.c | 23 +- drivers/gpu/drm/cirrus/cirrus_mode.c | 681 ++ drivers/gpu/drm/cirrus/cirrus_prime.c | 63 drivers/gpu/drm/cirrus/cirrus_ttm.c | 55 ++- 8 files changed, 705 insertions(+), 167 deletions(-) create mode 100644 drivers/gpu/drm/cirrus/cirrus_prime.c Thanks, Varad -- 2.13.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 01/14] drm/cirrus: split out bo unpinning from cirrus_bo_push_sysram
From: Varad Gautamadd a cirrus_bo_unpin call, and move bo_{reserve,unreserve} operations to bo_{pin,unpin} to ensure correct pinning/unpinning and simplify the call sequence. Signed-off-by: Varad Gautam --- drivers/gpu/drm/cirrus/cirrus_drv.h | 1 + drivers/gpu/drm/cirrus/cirrus_mode.c | 14 ++--- drivers/gpu/drm/cirrus/cirrus_ttm.c | 55 +--- 3 files changed, 48 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h index 8690352d96f7..8cdf6b0db4a7 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h @@ -262,6 +262,7 @@ static inline void cirrus_bo_unreserve(struct cirrus_bo *bo) int cirrus_bo_push_sysram(struct cirrus_bo *bo); int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr); +int cirrus_bo_unpin(struct cirrus_bo *bo); extern int cirrus_bpp; diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 53f6f0f84206..21d75e7e4abc 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -131,26 +131,17 @@ static int cirrus_crtc_do_set_base(struct drm_crtc *crtc, cirrus_fb = to_cirrus_framebuffer(fb); obj = cirrus_fb->obj; bo = gem_to_cirrus_bo(obj); - ret = cirrus_bo_reserve(bo, false); - if (ret) - return ret; + cirrus_bo_unpin(bo); cirrus_bo_push_sysram(bo); - cirrus_bo_unreserve(bo); } cirrus_fb = to_cirrus_framebuffer(crtc->primary->fb); obj = cirrus_fb->obj; bo = gem_to_cirrus_bo(obj); - ret = cirrus_bo_reserve(bo, false); - if (ret) - return ret; - ret = cirrus_bo_pin(bo, TTM_PL_FLAG_VRAM, _addr); - if (ret) { - cirrus_bo_unreserve(bo); + if (ret) return ret; - } if (>mode_info.gfbdev->gfb == cirrus_fb) { /* if pushing console in kmap it */ @@ -158,7 +149,6 @@ static int cirrus_crtc_do_set_base(struct drm_crtc *crtc, if (ret) DRM_ERROR("failed to kmap fbcon\n"); } - cirrus_bo_unreserve(bo); cirrus_set_start_address(crtc, (u32)gpu_addr); return 0; diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c index 1ff1838c0d44..a91d31da90ba 100644 --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c @@ -358,12 +358,17 @@ static inline u64 cirrus_bo_gpu_offset(struct cirrus_bo *bo) int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr) { - int i, ret; + int i, ret = 0; + + ret = cirrus_bo_reserve(bo, false); + if (ret) + return ret; if (bo->pin_count) { bo->pin_count++; if (gpu_addr) *gpu_addr = cirrus_bo_gpu_offset(bo); + goto out; } cirrus_ttm_placement(bo, pl_flag); @@ -371,24 +376,51 @@ int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr) bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; ret = ttm_bo_validate(>bo, >placement, false, false); if (ret) - return ret; + goto out; bo->pin_count = 1; if (gpu_addr) *gpu_addr = cirrus_bo_gpu_offset(bo); - return 0; + +out: + cirrus_bo_unreserve(bo); + return ret; +} + +int cirrus_bo_unpin(struct cirrus_bo *bo) +{ + int i, ret = 0; + + ret = cirrus_bo_reserve(bo, false); + if (ret) + return ret; + + if (!bo->pin_count || --bo->pin_count) + goto out; + + for (i = 0; i < bo->placement.num_placement; i++) + bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; + ret = ttm_bo_validate(>bo, >placement, false, false); + if (ret) + goto out; + +out: + cirrus_bo_unreserve(bo); + return ret; } int cirrus_bo_push_sysram(struct cirrus_bo *bo) { int i, ret; - if (!bo->pin_count) { + + ret = cirrus_bo_reserve(bo, false); + if (ret) + return ret; + + if (bo->pin_count) { DRM_ERROR("unpin bad %p\n", bo); - return 0; + goto out; } - bo->pin_count--; - if (bo->pin_count) - return 0; if (bo->kmap.virtual) ttm_bo_kunmap(>kmap); @@ -400,9 +432,12 @@ int cirrus_bo_push_sysram(struct cirrus_bo *bo) ret = ttm_bo_validate(>bo, >placement, false, false); if (ret) { DRM_ERROR("pushing to VRAM failed\n"); - return ret; + goto out; } - return 0; + +out: +
[Bug 101691] [KBL] gfx corruption on windowed 3d-apps running on dGPU
https://bugs.freedesktop.org/show_bug.cgi?id=101691 --- Comment #26 from Marek Olšák--- So can anybody still reproduce the corruption as shown in Timo's video or not? I'm NOT asking about the tearing in Ethan's video. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #5 from Alex Deucher--- Created attachment 133610 --> https://bugs.freedesktop.org/attachment.cgi?id=133610=edit possible fix Does this patch help? -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/2] drm/amd/amdgpu: Remove AMDGPU tracepoint and use new TTM tracepoint (v2)
Switches the AMDGPU driver over to the TTM tracepoint and removes our old one. Now you can enable traces before loading the module and trace all mappings. Signed-off-by: Tom St DenisReviewed-by: Christian König (v2): Use struct device instead of pci in trace. --- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 56 --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 21 ++-- 2 files changed, 3 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h index 1c88bd5e29ad..b1f97417241d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h @@ -14,62 +14,6 @@ #define AMDGPU_JOB_GET_TIMELINE_NAME(job) \ job->base.s_fence->finished.ops->get_timeline_name(>base.s_fence->finished) -TRACE_EVENT(amdgpu_ttm_tt_populate, - TP_PROTO(struct amdgpu_device *adev, uint64_t dma_address, uint64_t phys_address), - TP_ARGS(adev, dma_address, phys_address), - TP_STRUCT__entry( - __field(uint16_t, domain) - __field(uint8_t, bus) - __field(uint8_t, slot) - __field(uint8_t, func) - __field(uint64_t, dma) - __field(uint64_t, phys) - ), - TP_fast_assign( - __entry->domain = pci_domain_nr(adev->pdev->bus); - __entry->bus = adev->pdev->bus->number; - __entry->slot = PCI_SLOT(adev->pdev->devfn); - __entry->func = PCI_FUNC(adev->pdev->devfn); - __entry->dma = dma_address; - __entry->phys = phys_address; - ), - TP_printk("%04x:%02x:%02x.%x: 0x%llx => 0x%llx", - (unsigned)__entry->domain, - (unsigned)__entry->bus, - (unsigned)__entry->slot, - (unsigned)__entry->func, - (unsigned long long)__entry->dma, - (unsigned long long)__entry->phys) -); - -TRACE_EVENT(amdgpu_ttm_tt_unpopulate, - TP_PROTO(struct amdgpu_device *adev, uint64_t dma_address, uint64_t phys_address), - TP_ARGS(adev, dma_address, phys_address), - TP_STRUCT__entry( - __field(uint16_t, domain) - __field(uint8_t, bus) - __field(uint8_t, slot) - __field(uint8_t, func) - __field(uint64_t, dma) - __field(uint64_t, phys) - ), - TP_fast_assign( - __entry->domain = pci_domain_nr(adev->pdev->bus); - __entry->bus = adev->pdev->bus->number; - __entry->slot = PCI_SLOT(adev->pdev->devfn); - __entry->func = PCI_FUNC(adev->pdev->devfn); - __entry->dma = dma_address; - __entry->phys = phys_address; - ), - TP_printk("%04x:%02x:%02x.%x: 0x%llx => 0x%llx", - (unsigned)__entry->domain, - (unsigned)__entry->bus, - (unsigned)__entry->slot, - (unsigned)__entry->func, - (unsigned long long)__entry->dma, - (unsigned long long)__entry->phys) -); - TRACE_EVENT(amdgpu_mm_rreg, TP_PROTO(unsigned did, uint32_t reg, uint32_t value), TP_ARGS(did, reg, value), diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 26665b4baf36..38d26a7d5d0d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -667,32 +668,16 @@ static void amdgpu_trace_dma_map(struct ttm_tt *ttm) { struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); struct amdgpu_ttm_tt *gtt = (void *)ttm; - unsigned i; - if (unlikely(trace_amdgpu_ttm_tt_populate_enabled())) { - for (i = 0; i < ttm->num_pages; i++) { - trace_amdgpu_ttm_tt_populate( - adev, - gtt->ttm.dma_address[i], - page_to_phys(ttm->pages[i])); - } - } + ttm_trace_dma_map(adev->dev, >ttm); } static void amdgpu_trace_dma_unmap(struct ttm_tt *ttm) { struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); struct amdgpu_ttm_tt *gtt = (void *)ttm; - unsigned i; - if
[PATCH 1/2] drm/ttm: Add DMA map/unmap tracepoint (v3)
Also exports two functions that vendor drivers can call to trace DMA mappings. This is meant to help translate IOMMU mappings of bus addresses back to physical pages. Used by the umr amdgpu debugger for instance. Signed-off-by: Tom St DenisReviewed-by: Christian König (v2): Use dev_name() to get PCI path instead. (v3): Use correct types for dma/phys addresses --- drivers/gpu/drm/ttm/Makefile | 4 +- drivers/gpu/drm/ttm/ttm_debug.c | 75 ++ drivers/gpu/drm/ttm/ttm_trace.h | 87 +++ drivers/gpu/drm/ttm/ttm_tracepoints.c | 46 ++ include/drm/ttm/ttm_debug.h | 31 + 5 files changed, 241 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/ttm/ttm_debug.c create mode 100644 drivers/gpu/drm/ttm/ttm_trace.h create mode 100644 drivers/gpu/drm/ttm/ttm_tracepoints.c create mode 100644 include/drm/ttm/ttm_debug.h diff --git a/drivers/gpu/drm/ttm/Makefile b/drivers/gpu/drm/ttm/Makefile index f92325800f8a..fd3da00c0bf2 100644 --- a/drivers/gpu/drm/ttm/Makefile +++ b/drivers/gpu/drm/ttm/Makefile @@ -1,11 +1,11 @@ # # Makefile for the drm device driver. This driver provides support for the -ccflags-y := -Iinclude/drm +ccflags-y := -Iinclude/drm -I$(src)/. ttm-y := ttm_memory.o ttm_tt.o ttm_bo.o \ ttm_bo_util.o ttm_bo_vm.o ttm_module.o \ ttm_object.o ttm_lock.o ttm_execbuf_util.o ttm_page_alloc.o \ - ttm_bo_manager.o ttm_page_alloc_dma.o + ttm_bo_manager.o ttm_page_alloc_dma.o ttm_debug.o ttm_tracepoints.o ttm-$(CONFIG_AGP) += ttm_agp_backend.o obj-$(CONFIG_DRM_TTM) += ttm.o diff --git a/drivers/gpu/drm/ttm/ttm_debug.c b/drivers/gpu/drm/ttm/ttm_debug.c new file mode 100644 index ..dd158c6ef90d --- /dev/null +++ b/drivers/gpu/drm/ttm/ttm_debug.c @@ -0,0 +1,75 @@ +/** + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. + * + **/ +/* + * Authors: Tom St Denis + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ttm_trace.h" + +void ttm_trace_dma_map(struct device *dev, struct ttm_dma_tt *tt) +{ + unsigned i; + + if (unlikely(trace_ttm_dma_map_enabled())) { + for (i = 0; i < tt->ttm.num_pages; i++) { + trace_ttm_dma_map( + dev, + tt->ttm.pages[i], + tt->dma_address[i]); + } + } +} +EXPORT_SYMBOL(ttm_trace_dma_map); + +void ttm_trace_dma_unmap(struct device *dev, struct ttm_dma_tt *tt) +{ + unsigned i; + + if (unlikely(trace_ttm_dma_unmap_enabled())) { + for (i = 0; i < tt->ttm.num_pages; i++) { + trace_ttm_dma_unmap( + dev, + tt->ttm.pages[i], + tt->dma_address[i]); + } + } +} +EXPORT_SYMBOL(ttm_trace_dma_unmap); + diff --git a/drivers/gpu/drm/ttm/ttm_trace.h b/drivers/gpu/drm/ttm/ttm_trace.h new file mode 100644 index ..23279b9b8e64 --- /dev/null +++ b/drivers/gpu/drm/ttm/ttm_trace.h @@ -0,0 +1,87 @@ +/** + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #4 from Andy Furniss--- Created attachment 133609 --> https://bugs.freedesktop.org/attachment.cgi?id=133609=edit dmesg on good (commit before bad dmesg) -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #3 from Andy Furniss--- Created attachment 133608 --> https://bugs.freedesktop.org/attachment.cgi?id=133608=edit dmesg on bad -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #2 from Andy Furniss--- diff of (cut) dmesg-good dmesg-bad shows amongst other things < amdgpu :01:00.0: VRAM: 2048M 0x - 0x7FFF (2048M used) < amdgpu :01:00.0: GTT: 3072M 0x8000 - 0x00013FFF --- > amdgpu :01:00.0: VRAM: 2048M 0x00F4 - 0x00F47FFF > (2048M used) > amdgpu :01:00.0: GTT: 3072M 0x - 0xBFFF 826c826 < [drm] PCIE GART of 3072M enabled (table at 0x0004). --- > [drm] PCIE GART of 3072M enabled (table at 0x00F40004). -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RESEND][PATCH v4] drm: kirin: Add mode_valid logic to avoid mode clocks we can't generate
On Thu, Aug 17, 2017 at 12:00:04PM -0700, John Stultz wrote: > Currently the hikey dsi logic cannot generate accurate byte > clocks values for all pixel clock values. Thus if a mode clock > is selected that cannot match the calculated byte clock, the > device will boot with a blank screen. > > This patch uses the new mode_valid callback (many thanks to > Jose Abreu for upstreaming it!) to ensure we don't select > modes we cannot generate. > > Also, since the ade crtc code will adjust the mode in mode_set, > this patch also adds a mode_fixup callback which we use to make > sure we are validating the mode clock that will eventually be > used. > > Cc: Daniel Vetter> Cc: Jani Nikula > Cc: Sean Paul > Cc: David Airlie > Cc: Rob Clark > Cc: Xinliang Liu > Cc: Xinliang Liu > Cc: Rongrong Zou > Cc: Xinwei Kong > Cc: Chen Feng > Cc: Jose Abreu > Cc: Archit Taneja > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: John Stultz Hi John, Thanks for continuing to send new versions for this patch. It looks good to me (there's a small spelling mistake in a comment below that perhaps can be fixed when applied, no biggy). Reviewed-by: Sean Paul > --- > v2: Reworked to calculate if modeclock matches the phy's > byteclock, rather then using a whitelist of known modes. > > v3: Reworked to check across all possible crtcs (even though for > us there is only one), and use mode_fixup instead of a custom > function, as suggested by Jose and Daniel. > > v4: Fixes and improved error handling as suggested by Jose. > --- > drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c| 67 > + > drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 14 ++ > 2 files changed, 81 insertions(+) > > diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c > b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c > index f77dcfa..043a50d 100644 > --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c > +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c > @@ -603,6 +603,72 @@ static void dsi_encoder_enable(struct drm_encoder > *encoder) > dsi->enable = true; > } > > +static enum drm_mode_status dsi_encoder_phy_mode_valid( > + struct drm_encoder *encoder, > + const struct drm_display_mode *mode) > +{ > + struct dw_dsi *dsi = encoder_to_dsi(encoder); > + struct mipi_phy_params phy; > + u32 bpp = mipi_dsi_pixel_format_to_bpp(dsi->format); > + u32 req_kHz, act_kHz, lane_byte_clk_kHz; > + > + /* Calculate the lane byte clk using the adjusted mode clk */ > + memset(, 0, sizeof(phy)); > + req_kHz = mode->clock * bpp / dsi->lanes; > + act_kHz = dsi_calc_phy_rate(req_kHz, ); > + lane_byte_clk_kHz = act_kHz / 8; > + > + DRM_DEBUG_DRIVER("Checking mode %ix%i-%i@%i clock: %i...", > + mode->hdisplay, mode->vdisplay, bpp, > + drm_mode_vrefresh(mode), mode->clock); > + > + /* > + * Make sure the adjused mode clock and the lane byte clk s/adjused/adjusted/ > + * have a common denominator base frequency > + */ > + if (mode->clock/dsi->lanes == lane_byte_clk_kHz/3) { > + DRM_DEBUG_DRIVER("OK!\n"); > + return MODE_OK; > + } > + > + DRM_DEBUG_DRIVER("BAD!\n"); > + return MODE_BAD; > +} > + > +static enum drm_mode_status dsi_encoder_mode_valid(struct drm_encoder > *encoder, > + const struct drm_display_mode *mode) > + > +{ > + const struct drm_crtc_helper_funcs *crtc_funcs = NULL; > + struct drm_crtc *crtc = NULL; > + struct drm_display_mode adj_mode; > + enum drm_mode_status ret; > + > + /* > + * The crtc might adjust the mode, so go through the > + * possible crtcs (technically just one) and call > + * mode_fixup to figure out the adjusted mode before we > + * validate it. > + */ > + drm_for_each_crtc(crtc, encoder->dev) { > + /* > + * reset adj_mode to the mode value each time, > + * so we don't adjust the mode twice > + */ > + drm_mode_copy(_mode, mode); > + > + crtc_funcs = crtc->helper_private; > + if (crtc_funcs && crtc_funcs->mode_fixup) > + if (!crtc_funcs->mode_fixup(crtc, mode, _mode)) > + return MODE_BAD; > + > + ret = dsi_encoder_phy_mode_valid(encoder, _mode); > + if (ret != MODE_OK) > + return ret; > + } > + return MODE_OK; > +} > + > static void dsi_encoder_mode_set(struct
[GIT PULL] drm/tegra: Changes for v4.14-rc1
Hi Dave, The following changes since commit 5771a8c08880cdca3bfb4a3fc6d309d6bba20877: Linux v4.13-rc1 (2017-07-15 15:22:10 -0700) are available in the git repository at: git://anongit.freedesktop.org/tegra/linux tags/drm/tegra/for-4.14-rc1 for you to fetch changes up to ec73c4cfe7de6229e49989f7d7754a7039cd5c28: drm/tegra: Prevent BOs from being freed during job submission (2017-08-17 17:57:18 +0200) Thanks, Thierry drm/tegra: Changes for v4.14-rc1 This contains a couple of fixes and improvements for host1x, with some preparatory work for Tegra186 support. The remainder is cleanup and minor bugfixes for Tegra DRM along with enhancements to debuggability. There have also been some enhancements to the kernel interfaces for host1x job submissions and support for mmap'ing PRIME buffers directly, all of which get the interfaces very close to ready for serious work. Arnd Bergmann (1): drm/tegra: Add CONFIG_OF dependency Cihangir Akturk (1): drm/tegra: switch to drm_*_get(), drm_*_put() helpers Dmitry Osipenko (1): drm/tegra: Prevent BOs from being freed during job submission Gustavo A. R. Silva (1): gpu: host1x: fix error return code in host1x_probe() Michał Mirosław (1): drm/tegra: Fix NULL deref in debugfs/iova Mikko Perttunen (2): gpu: host1x: Don't fail on NULL bo physical address gpu: host1x: Fix bitshift/mask multipliers Nicolas Chauvet (1): drm/tegra: Set MODULE_FIRMWARE for the VIC Thierry Reding (13): gpu: host1x: Support sub-devices recursively drm/tegra: dc: Use unsigned int for register offsets drm/tegra: dpaux: Use unsigned int for register offsets drm/tegra: dsi: Use unsigned int for register offsets drm/tegra: hdmi: Use unsigned int for register offsets drm/tegra: sor: Use unsigned int for register offsets drm/tegra: dc: Trace register accesses drm/tegra: hdmi: Trace register accesses drm/tegra: dsi: Trace register accesses drm/tegra: dpaux: Trace register accesses drm/tegra: sor: Trace register accesses drm/tegra: Support render node drm/tegra: gem: Implement mmap() for PRIME buffers drivers/gpu/drm/tegra/Kconfig | 1 + drivers/gpu/drm/tegra/Makefile| 2 + drivers/gpu/drm/tegra/dpaux.c | 12 +++-- drivers/gpu/drm/tegra/drm.c | 102 ++ drivers/gpu/drm/tegra/drm.h | 12 +++-- drivers/gpu/drm/tegra/dsi.c | 14 -- drivers/gpu/drm/tegra/fb.c| 8 +-- drivers/gpu/drm/tegra/gem.c | 59 ++ drivers/gpu/drm/tegra/hdmi.c | 12 +++-- drivers/gpu/drm/tegra/sor.c | 12 +++-- drivers/gpu/drm/tegra/trace.c | 2 + drivers/gpu/drm/tegra/trace.h | 68 + drivers/gpu/drm/tegra/vic.c | 15 +- drivers/gpu/host1x/bus.c | 18 ++- drivers/gpu/host1x/dev.c | 4 +- drivers/gpu/host1x/hw/intr_hw.c | 24 - drivers/gpu/host1x/hw/syncpt_hw.c | 2 +- drivers/gpu/host1x/job.c | 8 --- 18 files changed, 277 insertions(+), 98 deletions(-) create mode 100644 drivers/gpu/drm/tegra/trace.c create mode 100644 drivers/gpu/drm/tegra/trace.h ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 14/14] drm/sti: sti_vdo: clean up drm_bridge_add call
On Mon, Jul 3, 2017 at 4:42 AM, Inki Daewrote: > This patch removes unnecessary checking of return value. > > Signed-off-by: Inki Dae Reviewed-by: Sean Paul > --- > drivers/gpu/drm/sti/sti_dvo.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c > index 24ebc6b..dcc2c22 100644 > --- a/drivers/gpu/drm/sti/sti_dvo.c > +++ b/drivers/gpu/drm/sti/sti_dvo.c > @@ -464,11 +464,7 @@ static int sti_dvo_bind(struct device *dev, struct > device *master, void *data) > bridge->driver_private = dvo; > bridge->funcs = _dvo_bridge_funcs; > bridge->of_node = dvo->dev.of_node; > - err = drm_bridge_add(bridge); > - if (err) { > - DRM_ERROR("Failed to add bridge\n"); > - return err; > - } > + drm_bridge_add(bridge); > > err = drm_bridge_attach(encoder, bridge, NULL); > if (err) { > -- > 1.9.1 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 resend] drm/panel: Add driver for Seiko 43WVF1G panel
On Thu, Jul 20, 2017 at 01:12:59PM -0300, Marco Franchi wrote: > Add driver for Seiko Instruments Inc. 4.3" WVGA (800 x RGB x 480) > TFT with Touch-Panel. > > Datasheet available at: > http://www.glyn.de/data/glyn/media/doc/43wvf1g-0.pdf > > Seiko 43WVF1G panel has two power supplies: avdd and dvdd and they > require a specific power on/down sequence. > For this reason the simple panel driver cannot be used to drive this > panel, so create a new one heavily based on simple panel. > > Based on initial patch submission from Breno Lima. > > Signed-off-by: Marco Franchi> --- > Changes since v1: > -Change supply names to dvdd-supply and avdd-supply > .../bindings/display/panel/seiko,43wvf1g.txt | 23 ++ > drivers/gpu/drm/panel/Kconfig | 9 + > drivers/gpu/drm/panel/Makefile | 1 + > drivers/gpu/drm/panel/panel-seiko-43wvf1g.c| 372 > + > 4 files changed, 405 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/display/panel/seiko,43wvf1g.txt > create mode 100644 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c I've applied, though somewhat reluctantly, this to drm-misc-next without Rob's Acked-by, but the device tree bindings look trivial enough. Thanks, Thierry signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 --- Comment #1 from Alex Deucher--- Please attach your dmesg output. Are there any error messages in the output? -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH] drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Christian König > Sent: Friday, August 18, 2017 9:32 AM > To: dri-devel@lists.freedesktop.org; amd-...@lists.freedesktop.org > Subject: [PATCH] drm/ttm: use reservation_object_trylock in > ttm_bo_individualize_resv v2 > > From: Christian König> > Fixes a false positive from might_sleep(). The reservation object is freshly > initialized, so nobody else can hold the mutex but the function is > called from atomic context. > > v2: Correctly invert the check as well. > > Signed-off-by: Christian König Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/ttm/ttm_bo.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index 58e7fce..cba11f1 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -403,7 +403,7 @@ static int ttm_bo_individualize_resv(struct > ttm_buffer_object *bo) > return 0; > > reservation_object_init(>ttm_resv); > - BUG_ON(reservation_object_lock(>ttm_resv, NULL)); > + BUG_ON(!reservation_object_trylock(>ttm_resv)); > > r = reservation_object_copy_fences(>ttm_resv, bo->resv); > if (r) { > -- > 2.7.4 > > ___ > amd-gfx mailing list > amd-...@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102296] R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios
https://bugs.freedesktop.org/show_bug.cgi?id=102296 Bug ID: 102296 Summary: R9 285 VCE corruption since drm/amdgpu/gmc8: use the vram location programmed by the vbios Product: DRI Version: DRI git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: DRM/AMDgpu Assignee: dri-devel@lists.freedesktop.org Reporter: adf.li...@gmail.com Bit late with this, bisected on drm-next-4.13-wip R9 285 Tonga I am getting corrupted output from VCE encode, omx or vaapi since below commit. To re-produce this you need to use gstreamer and encode "fast and large" eg. 2160p from raw nv12. Slow things like ffmpeg or gst-vaapi without ! queue ! seem to hide the issue somewhat. 26d4ac55d2260f8685475b3f6e76e276a238cca7 is the first bad commit commit 26d4ac55d2260f8685475b3f6e76e276a238cca7 Author: Alex DeucherDate: Tue Nov 1 13:08:33 2016 -0400 drm/amdgpu/gmc8: use the vram location programmed by the vbios This makes mc programming much simpler in future patches. Since evergreen, the vbios has been programming the fb location to the proper vram size. The only reason to reprogram it would be to change the location. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/ttm: Add helper functions to populate/map in one call
These functions replace a section of common code found in radeon/amdgpu drivers (and possibly others) as part of the ttm_tt_*populate() callbacks. Signed-off-by: Tom St Denis--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 41 include/drm/ttm/ttm_page_alloc.h | 11 ++ 2 files changed, 52 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 871599826773..6a660d196d87 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -920,6 +920,47 @@ void ttm_pool_unpopulate(struct ttm_tt *ttm) } EXPORT_SYMBOL(ttm_pool_unpopulate); +int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt) +{ + unsigned i; + int r; + + r = ttm_pool_populate(>ttm); + if (r) + return r; + + for (i = 0; i < tt->ttm.num_pages; i++) { + tt->dma_address[i] = dma_map_page(dev, tt->ttm.pages[i], + 0, PAGE_SIZE, + DMA_BIDIRECTIONAL); + if (dma_mapping_error(dev, tt->dma_address[i])) { + while (i--) { + dma_unmap_page(dev, tt->dma_address[i], + PAGE_SIZE, DMA_BIDIRECTIONAL); + tt->dma_address[i] = 0; + } + ttm_pool_unpopulate(>ttm); + return -EFAULT; + } + } + return 0; +} +EXPORT_SYMBOL(ttm_populate_and_map_pages); + +void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt) +{ + unsigned i; + + for (i = 0; i < tt->ttm.num_pages; i++) { + if (tt->dma_address[i]) { + dma_unmap_page(dev, tt->dma_address[i], + PAGE_SIZE, DMA_BIDIRECTIONAL); + } + } + ttm_pool_unpopulate(>ttm); +} +EXPORT_SYMBOL(ttm_unmap_and_unpopulate_pages); + int ttm_page_alloc_debugfs(struct seq_file *m, void *data) { struct ttm_page_pool *p; diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h index 49a828425fa2..8695918ea629 100644 --- a/include/drm/ttm/ttm_page_alloc.h +++ b/include/drm/ttm/ttm_page_alloc.h @@ -83,6 +83,17 @@ extern int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data); extern int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev); extern void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev); + +/** + * Populates and DMA maps pages to fullfil a ttm_dma_populate() request + */ +int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt); + +/** + * Unpopulates and DMA unmaps pages as part of a + * ttm_dma_unpopulate() request */ +void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt); + #else static inline int ttm_dma_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) -- 2.12.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/nouveau: use new TTM populate/DMA map function
Removes common code found in numerous vendor drivers and places it higher up in the TTM tree. Signed-off-by: Tom St Denis--- drivers/gpu/drm/nouveau/nouveau_bo.c | 37 ++-- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index e427f80344c4..6ad0ad53047a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1448,8 +1448,6 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm) struct nvkm_device *device; struct drm_device *dev; struct device *pdev; - unsigned i; - int r; bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); if (ttm->state != tt_unpopulated) @@ -1480,30 +1478,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm) } #endif - r = ttm_pool_populate(ttm); - if (r) { - return r; - } - - for (i = 0; i < ttm->num_pages; i++) { - dma_addr_t addr; - - addr = dma_map_page(pdev, ttm->pages[i], 0, PAGE_SIZE, - DMA_BIDIRECTIONAL); - - if (dma_mapping_error(pdev, addr)) { - while (i--) { - dma_unmap_page(pdev, ttm_dma->dma_address[i], - PAGE_SIZE, DMA_BIDIRECTIONAL); - ttm_dma->dma_address[i] = 0; - } - ttm_pool_unpopulate(ttm); - return -EFAULT; - } - - ttm_dma->dma_address[i] = addr; - } - return 0; + return ttm_populate_and_map_pages(pdev, ttm_dma); } static void @@ -1514,7 +1489,6 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm) struct nvkm_device *device; struct drm_device *dev; struct device *pdev; - unsigned i; bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); if (slave) @@ -1539,14 +1513,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm) } #endif - for (i = 0; i < ttm->num_pages; i++) { - if (ttm_dma->dma_address[i]) { - dma_unmap_page(pdev, ttm_dma->dma_address[i], PAGE_SIZE, - DMA_BIDIRECTIONAL); - } - } - - ttm_pool_unpopulate(ttm); + ttm_unmap_and_unpopulate_pages(pdev, ttm_dma); } void -- 2.12.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH] drm/doc: Document ioctl errno value patterns
Hi, On 18 August 2017 at 10:21, Daniel Vetterwrote: > +Recommended IOCTL Return Values > +=== > + > +In theory a driver's IOCTL callback is only allowed to return very few error > +codes. In practice it's good to abuse a few more. This section documents > common > +practice within the DRM subsystem: > + > +ENOENT: > +Strictly speaking only when you try to open isn't there. There's a word from this sentence. > +We reuse that > +to signal any kind of object lookup failure, e.g. for unknown GEM > buffer > +object handles, unknown KMS object handles and similar cases. > + > +ENOSPC: > +Some drivers use this to differiante 'differentiate' Cheers, Daniel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] MAINTAINERS: drm/panel is now maintained in drm-misc
On Mon, Aug 14, 2017 at 04:45:31PM +0200, Daniel Vetter wrote: > On Mon, Aug 14, 2017 at 04:00:11PM +0200, Thierry Reding wrote: > > From: Thierry Reding> > > > drm/panel is a good candidate for the drm-misc group maintainership and > > it's been maintained in the common drm-misc tree for a release, so make > > it official. > > > > Signed-off-by: Thierry Reding > > Acked-by: Daniel Vetter > > I think long-term it might be good to have a 2nd maintainer for panels for > vacations or when you're drowning in a product launch. But that can wait. Yes, absolutely. Thierry signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/panel: simple: Remove unneeded gpiod NULL check
On Sun, Jul 16, 2017 at 09:05:39PM -0300, Fabio Estevam wrote: > From: Fabio Estevam> > The gpiod API checks for NULL descriptors, so there is no need to > duplicate the check in the driver. > > Signed-off-by: Fabio Estevam > --- > drivers/gpu/drm/panel/panel-simple.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) Applied to drm-misc-next, thanks. Thierry signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 101442] Piglit shaders@ssa@fs-if-def-else-break fails with sb but passes with R600_DEBUG=nosb
https://bugs.freedesktop.org/show_bug.cgi?id=101442 --- Comment #2 from Gert Wollny--- spec@glsl-1.10@execution@variable-indexing@ vs-output-array-float-index-wr vs-output-array-vec3-index-wr vs-output-array-vec4-index-wr also fail with sb enabled but pass without it. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/panel: simple: Add missing panel_simple_unprepare calls
On Mon, Aug 07, 2017 at 09:55:45PM +1000, Jonathan Liu wrote: > During panel removal or system shutdown panel_simple_disable is called > which disables the panel backlight but the panel is still powered due to > missing calls to panel_simple_unprepare. > > Fixes: d02fd93e2cd8 ("drm/panel: simple - Disable panel on shutdown") > Cc: sta...@vger.kernel.org # v3.16+ > Signed-off-by: Jonathan Liu> --- > drivers/gpu/drm/panel/panel-simple.c | 2 ++ > 1 file changed, 2 insertions(+) Applied to drm-misc-next, thanks. Thierry signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/panel: simple: Fix width and height for Olimex LCD-OLinuXino-4.3TS
On Thu, Jul 20, 2017 at 08:29:43PM +1000, Jonathan Liu wrote: > The physical size of the panel is 105.5 (W) x 67.2 (H) x 4.05 (D) mm > but the active display area is 95.04 (W) x 53.856 (H) mm. > > The width and height should be set to the active display area. > > Signed-off-by: Jonathan Liu> --- > drivers/gpu/drm/panel/panel-simple.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Applied to drm-misc-next, thanks. Thierry signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102201] [regression, SI] GPU crash in Unigine Valley
https://bugs.freedesktop.org/show_bug.cgi?id=102201 Marek Olšákchanged: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Marek Olšák --- Fixed by 13aa8d3da92bd83abc8d5212764a15. Closing. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 0/3] Add support for the otm8009a dsi panel
On Mon, Jul 17, 2017 at 03:19:50PM +0200, Philippe CORNU wrote: > Version 3: > - panel-orisetech-otm8009a.c: Remove a FIXME (Andrzej Hajda) > - panel/Makefile & Kconfig: Alphabetical order (Andrzej Hajda) > > Version 2: > - panel-orisetech-otm8009a.c: Add Manufacturer Command Set defines, > add new macro for handling address shifting, improve reset > sequence, use more mipi dcs helpers (Andrzej Hajda) > - dt-bindings/display/panel/orisetech,otm8009a.txt: Fix reset gpio > active level in the example (Andrzej Hajda), Add an "Optional > Properties" section (Rob Herring). > > Version 1: > - Initial commit > > The purpose of this patch is to add support for the Orise Tech > otm8009a 3.97" 480x800 TFT LCD panel (MIPI-DSI video mode). > This LCD panel is used in several STM32 boards. > > Philippe CORNU (3): > dt-bindings: Add vendor prefix for Orise Technology > dt-bindings: display: panel: Add support for Orise Tech otm8009a dsi > panel > drm/panel: Add support for otm8009a panel driver > > .../bindings/display/panel/orisetech,otm8009a.txt | 21 + > .../devicetree/bindings/vendor-prefixes.txt| 1 + > drivers/gpu/drm/panel/Kconfig | 9 + > drivers/gpu/drm/panel/Makefile | 1 + > drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 491 > + > 5 files changed, 523 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt > create mode 100755 drivers/gpu/drm/panel/panel-orisetech-otm8009a.c Series applied to drm-misc-next, thanks. Thierry signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/msm/: make clk_init_data const
Make these const as they are only stored in the init field of a clk_hw structure, which is const. Done using Coccinelle. Signed-off-by: Bhumika Goyal--- drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c | 2 +- drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c index 1fb7645..dea4697 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c @@ -702,7 +702,7 @@ static int hdmi_8996_pll_is_enabled(struct clk_hw *hw) "xo", }; -static struct clk_init_data pll_init = { +static const struct clk_init_data pll_init = { .name = "hdmipll", .ops = _8996_pll_ops, .parent_names = hdmi_pll_parents, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c b/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c index 9959075..2e3c147 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c @@ -419,7 +419,7 @@ static int hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate, "pxo", }; -static struct clk_init_data pll_init = { +static const struct clk_init_data pll_init = { .name = "hdmi_pll", .ops = _pll_ops, .parent_names = hdmi_pll_parents, diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c index ce42459..b9a7104 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c @@ -137,7 +137,7 @@ static int mpd4_lvds_pll_set_rate(struct clk_hw *hw, unsigned long rate, "pxo", }; -static struct clk_init_data pll_init = { +static const struct clk_init_data pll_init = { .name = "mpd4_lvds_pll", .ops = _lvds_pll_ops, .parent_names = mpd4_lvds_pll_parents, -- 1.9.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 1/8] drm/dp: Add defines for DP SDP types
From: Ville SyrjäläAdd defines for the secondary data packet (SDP) types from the spec. These are the DP specific ones, and in addition HDMI infoframe types (see enum hdmi_infoframe_type) are also valid SDP types. v2: Add more SDP types v3: Note the DP version that added each SDP type (Rodrigo) Cc: dri-devel@lists.freedesktop.org Reviewed-by: Rodrigo Vivi Signed-off-by: Ville Syrjälä --- include/drm/drm_dp_helper.h | 12 1 file changed, 12 insertions(+) diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index b17476a6909c..2c412a15cfa1 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -871,6 +871,18 @@ void drm_dp_link_train_channel_eq_delay(const u8 dpcd[DP_RECEIVER_CAP_SIZE]); u8 drm_dp_link_rate_to_bw_code(int link_rate); int drm_dp_bw_code_to_link_rate(u8 link_bw); +#define DP_SDP_AUDIO_TIMESTAMP 0x01 +#define DP_SDP_AUDIO_STREAM0x02 +#define DP_SDP_EXTENSION 0x04 /* DP 1.1 */ +#define DP_SDP_AUDIO_COPYMANAGEMENT0x05 /* DP 1.2 */ +#define DP_SDP_ISRC0x06 /* DP 1.2 */ +#define DP_SDP_VSC 0x07 /* DP 1.2 */ +#define DP_SDP_CAMERA_GENERIC(i) (0x08 + (i)) /* 0-7, DP 1.3 */ +#define DP_SDP_PPS 0x10 /* DP 1.4 */ +#define DP_SDP_VSC_EXT_VESA0x20 /* DP 1.4 */ +#define DP_SDP_VSC_EXT_CEA 0x21 /* DP 1.4 */ +/* 0x80+ CEA-861 infoframe types */ + struct edp_sdp_header { u8 HB0; /* Secondary Data Packet ID */ u8 HB1; /* Secondary Data Packet Type */ -- 2.13.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/panel: simple: Skip error message on deferred probe
On Fri, Jun 30, 2017 at 06:14:46PM -0300, Fabio Estevam wrote: > From: Fabio Estevam> > When enable_gpio is provided via an I2C or SPI expander, it may not be > available when panel-simple probes leading to the following error: > > panel-simple panel: failed to request GPIO: -517 > > As this error message is not very useful to the end user, skip printing > it in the case of deferred probe. > > Signed-off-by: Fabio Estevam > --- > drivers/gpu/drm/panel/panel-simple.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied to drm-misc-next, thanks. Thierry signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2
From: Christian KönigFixes a false positive from might_sleep(). The reservation object is freshly initialized, so nobody else can hold the mutex but the function is called from atomic context. v2: Correctly invert the check as well. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 58e7fce..cba11f1 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -403,7 +403,7 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo) return 0; reservation_object_init(>ttm_resv); - BUG_ON(reservation_object_lock(>ttm_resv, NULL)); + BUG_ON(!reservation_object_trylock(>ttm_resv)); r = reservation_object_copy_fences(>ttm_resv, bo->resv); if (r) { -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2] drm/i915/bxt: use NULL for GPIO connection ID
On Fri, 18 Aug 2017, Mika Kaholawrote: > On Thu, 2017-08-17 at 14:06 +0300, Mika Kahola wrote: >> Tested with GLK + MIPI/DSI panel (AU Optronics B101UAN01) > Tested also with APL + MIPI/DSI setup. Pushed to drm-intel-next-queued, thanks for the patch and testing. BR, Jani. > >> >> Tested-by: Mika Kahola >> >> On Thu, 2017-08-17 at 13:55 +0300, Andy Shevchenko wrote: >> > >> > The commit 213e08ad60ba >> >("drm/i915/bxt: add bxt dsi gpio element support") >> > enables GPIO support for Broxton based platforms. >> > >> > While using that API we might get into troubles in the future, >> > because >> > we can't rely on label name in the driver since vendor firmware >> > might >> > provide any GPIO pin there, e.g. "reset", and even mark it in _DSD >> > (in >> > which case the request will fail). >> > >> > To avoid inconsistency and potential issues we have two options: >> > a) generate GPIO ACPI mapping table and supply it via >> > acpi_dev_add_driver_gpios(), or >> > b) just pass NULL as connection ID. >> > >> > The b) approach is much simpler and would work since the driver >> > relies >> > on GPIO indices only. Moreover, the _CRS fallback mechanism, when >> > requesting GPIO, has been made stricter, and supplying non-NULL >> > connection ID when neither _DSD, nor GPIO ACPI mapping is present, >> > is >> > making request fail. >> > >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101921 >> > Fixes: f10e4bf6632b ("gpio: acpi: Even more tighten up ACPI GPIO >> > lookups") >> > Cc: Mika Kahola >> > Cc: Jani Nikula >> > Signed-off-by: Andy Shevchenko >> > --- >> > v2: >> > - adjust commit message for proper time tenses >> > - add Fixes: and Bugzilla: tags >> > drivers/gpu/drm/i915/intel_dsi_vbt.c | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> > diff --git a/drivers/gpu/drm/i915/intel_dsi_vbt.c >> > b/drivers/gpu/drm/i915/intel_dsi_vbt.c >> > index 7158c7ce9c09..91c07b0c8db9 100644 >> > --- a/drivers/gpu/drm/i915/intel_dsi_vbt.c >> > +++ b/drivers/gpu/drm/i915/intel_dsi_vbt.c >> > @@ -306,7 +306,7 @@ static void bxt_exec_gpio(struct >> > drm_i915_private >> > *dev_priv, >> > >> > if (!gpio_desc) { >> > gpio_desc = devm_gpiod_get_index(dev_priv- >> > >drm.dev, >> > - "panel", >> > gpio_index, >> > + NULL, gpio_index, >> > value ? >> > GPIOD_OUT_LOW : >> > GPIOD_OUT_HIGH); >> > >> ___ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Jani Nikula, Intel Open Source Technology Center ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCHv6 1/3] ARM:dt-bindings Intel FPGA Video and Image Processing Suite
Hi Hean Loong, (CC'ing dri-devel again as I noticed it wasn't CC'ed anymore) On Friday 18 Aug 2017 08:34:44 Ong, Hean Loong wrote: > Hi Laurent, > Thanks for the comments, I drafted a copy of the DT bindings based on > your recommendations and inputs. I inserted the changes below the > previous comments. [snip] > Intel Video and Image Processing(VIP) Frame Buffer II bindings > > Supported hardware: Intel FPGA SoC Arria10 and above with display port > IP > > The Video Frame Buffer II in Video Image Processing (VIP) suite is an IP > core that interfaces between system memory and Avalon-ST video ports. The IP > core can be configured to support the memory reader (from memory to Avalon- > ST) and/or memory writer (from Avalon-ST to memory) interfaces. > > Connections between the Frame Buffer II and other video IP cores in the > system are modelled using the OF graph DT bindings. The Frame Buffer II node > has up to two OF graph ports. When the memory writer interface is enabled, > port 0 maps to the Avalon-ST Input (din) port. When the memory reader > interface is enabled, port 1 maps to the Avalon-ST Output (dout) port. > > More information the FPGA video IP component can be acquired from > https://www.altera.com/content/dam/altera-www/global/en_US/pdfs\ > /literature/ug/ug_vip.pdf > > New bindings: > = How are the bindings "new" ? You can omit that title. > Required properties: > > - compatible: "altr,vip-frame-buffer-2.0" > - reg: Physical base address and length of the framebuffer controller's > registers. > - altr,max-width: The maximum width of the framebuffer in pixels. > - altr,max-height: The maximum height of the framebuffer in pixels. > - altr,mem-port-width = the bus width of the avalon master port > on the frame reader You need to mention the ports here as they are mandatory. I would move the second paragraph from the introduction to here. You should also refer to the file defining the OF graph DT bindings. You can find examples in other DT bindings. > Example: > > +-+ +---+ ++ +---+ > | D | | Frame | | DP/HDMI TX | | DP/HDMI | > | D |->| Buffer II |->| Controller |->| Connector | > | R | | | || | | > +-+ +---+ ++ +---+ > > framebuffer@10280 { > compatible = "altr,vip-frame-buffer-2.0"; > reg = <0x0001 0x0280 0x0040>; > altr,max-width = <1280>; > altr,max-height = <720>; > altr,mem-port-width = <128>; > > ports { > #address-cells = <1>; > #size-cells = <0>; > > port@1 { > reg = <1>; > fb_output: endpoint { > remote-endpoint = <_encoder_input>; > }; > }; > }; > }; > > If there is a need to scale the Frame Buffer II IP cores in > the pipeline, each node would have its own node, connected > through ports and endpoints. > > hdmi-encoder@. { > compatible = "altr,hdmi-tx-16.0"; This was just an example, please use the real compatible string of the HDMI controller (and please submit DT bindings for the HDMI controller :-)). Please also fill the reg property with values from a real example. > reg = <.>; > /* Other IP-specific properties here */ > > ports { > #address-cells = <1>; > #size-cells = <0>; > > port@0 { > reg = <0>; > hdmi_tx_input: endpoint { > remote-endpoint = <_output>; > }; > }; > > port@1 { > reg = <1>; > hdmi_tx_output: endpoint { > remote-endpoint = <_conn_input>; > }; > }; > }; > }; > > hdmi-connector@0 { > compatible = "hdmi-connector"; > type = "a"; > > port { > hdmi_conn_input: endpoint { > remote-endpoint = <_tx_output>; > }; > }; > }; -- Regards, Laurent Pinchart ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/14] drm/mediatek: hdmi: clean up drm_bridge_add call
On Fri, 2017-08-18 at 10:54 +0200, Daniel Vetter wrote: > On Wed, Jul 05, 2017 at 02:31:57PM +0530, Archit Taneja wrote: > > > > > > On 07/03/2017 02:12 PM, Inki Dae wrote: > > > This patch removes unnecessary checking of return value. > > > > Can I get an ack from the maintainers to get this pulled in > > via drm-misc? > > Almost two weeks of no replies, I'd say go ahead and assume the > maintainers are absent. That's what I generally do, otherwise it's pretty > much impossible to land such cleanups. > -Daniel Yes, I'm absent, so go ahead. Acked-by: CK Hu> > > > > Thanks, > > Archit > > > > > > > > Signed-off-by: Inki Dae > > > --- > > > drivers/gpu/drm/mediatek/mtk_hdmi.c | 6 +- > > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c > > > b/drivers/gpu/drm/mediatek/mtk_hdmi.c > > > index 0a4ffd7..62652ee 100644 > > > --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c > > > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c > > > @@ -1697,11 +1697,7 @@ static int mtk_drm_hdmi_probe(struct > > > platform_device *pdev) > > > hdmi->bridge.funcs = _hdmi_bridge_funcs; > > > hdmi->bridge.of_node = pdev->dev.of_node; > > > - ret = drm_bridge_add(>bridge); > > > - if (ret) { > > > - dev_err(dev, "failed to add bridge, ret = %d\n", ret); > > > - return ret; > > > - } > > > + drm_bridge_add(>bridge); > > > ret = mtk_hdmi_clk_enable_audio(hdmi); > > > if (ret) { > > > > > > > -- > > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > > a Linux Foundation Collaborative Project > > ___ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/doc: Document ioctl errno value patterns
Quoting Daniel Vetter (2017-08-18 10:21:24) > We're not super-consistent about these, but I think it's worth to > document at least the commmon patterns. > > Cc: Joonas Lahtinen> Cc: Chris Wilson > Cc: "Zhang, Tina" > Signed-off-by: Daniel Vetter One extra used outside of i915 is ENOSYS. Perhaps nouveau/vmgfx might like to chime in if that's exposed to userspace and is a good pattern you'ld like DRM as a whole to pick up. As far as i915, these do capture our uses very well. Reviewed-by: Chris Wilson > --- > Documentation/gpu/drm-uapi.rst | 53 > ++ > 1 file changed, 53 insertions(+) > > diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst > index 679373b4a03f..f3cc829467b4 100644 > --- a/Documentation/gpu/drm-uapi.rst > +++ b/Documentation/gpu/drm-uapi.rst > @@ -177,6 +177,59 @@ IOCTL Support on Device Nodes > .. kernel-doc:: drivers/gpu/drm/drm_ioc32.c > :export: > > +Recommended IOCTL Return Values > +=== Would this not be a preface to @drm_driver.ioctl() ? -Chris ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2] drm/i915/bxt: use NULL for GPIO connection ID
On Thu, 2017-08-17 at 14:06 +0300, Mika Kahola wrote: > Tested with GLK + MIPI/DSI panel (AU Optronics B101UAN01) Tested also with APL + MIPI/DSI setup. > > Tested-by: Mika Kahola> > On Thu, 2017-08-17 at 13:55 +0300, Andy Shevchenko wrote: > > > > The commit 213e08ad60ba > > ("drm/i915/bxt: add bxt dsi gpio element support") > > enables GPIO support for Broxton based platforms. > > > > While using that API we might get into troubles in the future, > > because > > we can't rely on label name in the driver since vendor firmware > > might > > provide any GPIO pin there, e.g. "reset", and even mark it in _DSD > > (in > > which case the request will fail). > > > > To avoid inconsistency and potential issues we have two options: > > a) generate GPIO ACPI mapping table and supply it via > > acpi_dev_add_driver_gpios(), or > > b) just pass NULL as connection ID. > > > > The b) approach is much simpler and would work since the driver > > relies > > on GPIO indices only. Moreover, the _CRS fallback mechanism, when > > requesting GPIO, has been made stricter, and supplying non-NULL > > connection ID when neither _DSD, nor GPIO ACPI mapping is present, > > is > > making request fail. > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101921 > > Fixes: f10e4bf6632b ("gpio: acpi: Even more tighten up ACPI GPIO > > lookups") > > Cc: Mika Kahola > > Cc: Jani Nikula > > Signed-off-by: Andy Shevchenko > > --- > > v2: > > - adjust commit message for proper time tenses > > - add Fixes: and Bugzilla: tags > > drivers/gpu/drm/i915/intel_dsi_vbt.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_dsi_vbt.c > > b/drivers/gpu/drm/i915/intel_dsi_vbt.c > > index 7158c7ce9c09..91c07b0c8db9 100644 > > --- a/drivers/gpu/drm/i915/intel_dsi_vbt.c > > +++ b/drivers/gpu/drm/i915/intel_dsi_vbt.c > > @@ -306,7 +306,7 @@ static void bxt_exec_gpio(struct > > drm_i915_private > > *dev_priv, > > > > if (!gpio_desc) { > > gpio_desc = devm_gpiod_get_index(dev_priv- > > >drm.dev, > > - "panel", > > gpio_index, > > + NULL, gpio_index, > > value ? > > GPIOD_OUT_LOW : > > GPIOD_OUT_HIGH); > > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Mika Kahola - Intel OTC ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [GIT PULL] imx-drm: scanout burst lock support
Hi Dave, On Wed, 2017-07-19 at 17:23 +0200, Philipp Zabel wrote: > Hi Dave, > > please consider merging this tag which improvemes for scanout memory > access patterns on i.MX and contains a small cleanup for > ipu_plane_atomic_update. did this get lost? If it is not too late, I'd still like this to make it into v4.14. regards Philipp > regards > Philipp > > The following changes since commit 5771a8c08880cdca3bfb4a3fc6d309d6bba20877: > > Linux v4.13-rc1 (2017-07-15 15:22:10 -0700) > > are available in the git repository at: > > git://git.pengutronix.de/git/pza/linux.git tags/imx-drm-next-2017-07-18 > > for you to fetch changes up to 790cb4c7c9545953d22d3d425e49b36a711bae5b: > > drm/imx: lock scanout transfers for consecutive bursts (2017-07-17 12:58:11 > +0200) > > > imx-drm: lock scanout transfers for consecutive bursts > > - Lock the IDMAC scanout channel for multiple back-to-back bursts if possible, > to improve memory bandwidth utilisation. > - Replace a few occurences of state->fb with the already existing local fb > variable in ipu_plane_atomic_update > > > Philipp Zabel (2): > drm/imx: ipuv3-plane: use fb local variable instead of state->fb > drm/imx: lock scanout transfers for consecutive bursts > > drivers/gpu/drm/imx/ipuv3-plane.c | 53 > +++ > 1 file changed, 42 insertions(+), 11 deletions(-) ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[GIT PULL] imx-drm fixes for YUV primary plane and partially modular build
Hi Dave, This tag contains a fix to enable color space conversion for for YUV format framebuffers on the primary plane and a Kconfig fix to avoid a build failure. The build failure happened when DRM was built as a module, but IMX_IPUV3_CORE was built-in. With the fix, if DRM is built as a module, IMX_IPUV3_CORE is not allowed to be built-in anymore. regards Philipp The following changes since commit 46828dc77961d9286e55671c4dd3b6c9effadf1a: Merge branch 'linux-4.13' of git://github.com/skeggsb/linux into drm-fixes (2017-08-10 11:45:04 +1000) are available in the git repository at: git://git.pengutronix.de/git/pza/linux tags/imx-drm-fixes-2017-08-18 for you to fetch changes up to 5be5dd38d4628fdbff7359f235f7cdf0cf9655f1: drm/imx: ipuv3-plane: fix YUV framebuffer scanout on the base plane (2017-08-11 10:31:13 +0200) drm/imx: fix YUV primary plane and IPUv3 build corner case - Enable color space conversion on the primary plane when the framebuffer format is a YUV format. - The IPUv3 base driver now uses drm_format_info in the PRE/PRG code. The PRE/PRG parts are already disabled if DRM is not available. Enforce that if DRM is built as a module, IPUv3 must be built as a module, too. Arnd Bergmann (1): gpu: ipu-v3: add DRM dependency Philipp Zabel (1): drm/imx: ipuv3-plane: fix YUV framebuffer scanout on the base plane drivers/gpu/drm/imx/ipuv3-plane.c | 6 ++ drivers/gpu/ipu-v3/Kconfig| 1 + 2 files changed, 3 insertions(+), 4 deletions(-) ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v14 2/7] drm: Introduce RGB 64-bit 16:16:16:16 float format
The RGB 64-bit 16:16:16:16 float pixel format is needed by some Apps in windows. The float format in each component is 1:5:10 MSb-sign:exponent: fraction. This patch is to introduce the format to drm, so that the windows guest's framebuffer in this kind of format can be recognized and used by linux host. v14: - add some details about the float pixel format. (Daniel) - add F suffix to the defined name. (Daniel) v12: - send to dri-devel at lists.freedesktop.org. (Ville) v9: - separated from framebuffer decoder patch. (Zhenyu) (Xiaoguang) Signed-off-by: Tina ZhangCc: Ville Syrjälä Cc: Dave Airlie Cc: Daniel Vetter Cc: Joonas Lahtinen diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 76c9101..575014f 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -113,6 +113,10 @@ extern "C" { #define DRM_FORMAT_AYUVfourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ +/* 64 bpp RGB 16:16:16:16 Floating Point */ +#define DRM_FORMAT_XRGB161616F fourcc_code('X', 'R', '3', 'F') /* [63:0] x:R:G:B 16:16:16:16 little endian */ +#define DRM_FORMAT_XBGR161616F fourcc_code('X', 'B', '3', 'F') /* [63:0] x:B:G:R 16:16:16:16 little endian */ + /* * 2 plane RGB + A * index 0 = RGB plane, same format as the corresponding non _A8 format has -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel