[PATCH libdrm 07/24] radeon: annotate the private symbols
On 2 April 2015 at 04:57, Jerome Glisse wrote: > On Thu, Apr 02, 2015 at 11:48:25AM +0900, Michel Dänzer wrote: >> On 02.04.2015 01:15, Emil Velikov wrote: >> > They are less and easier to track than the public ones. >> >> Grammar: s/less/fewer/ >> >> >> Other than that, this patch and patch 8 are >> >> Acked-by: Michel Dänzer >> >> though I'm not sure about the impact of Jerome's objection to previous >> patches on this one. > > Yes same apply, adding drm specific define would break my cping of those > file to my tools. But if Emil feels like adding bofreplay to libdrm i do > not have any objection. > > Thought using some macro trickery inside bof.h this can be work around. > Actually the cleanest/quickest solution would be to move bof.[ch] from libdrm_radeon_la_SOURCES to EXTRA_DIST. This way we won't need any of these patches,. Plus if one wants to use bof via radeon_cs_gem, they will have to change one more line (apart from the current CS_BOF_DUMP) - add the sources into libdrm_radeon_la_SOURCES. I'll add a note about it next to the define. As we import bofreplay we can rework things to be more elegant. How does that sound ? -Emil
[git pull] drm fixes
Hi Linus, one drm core fix, one exynos regression fix, two sets of radeon fixes (Alex was a bit behind last week), and two i915 fixes. Nothing too serious we seem to have calmed down i915 since last week. Dave. The following changes since commit e42391cd048809d903291d07f86ed3934ce138e9: Linux 4.0-rc6 (2015-03-29 15:26:31 -0700) are available in the git repository at: git://people.freedesktop.org/~airlied/linux drm-fixes for you to fetch changes up to 51b52fac9b4ece9ec0c27a39b0ae1b3b4a829df9: Merge branch 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes (2015-04-03 09:28:55 +1000) Alex Deucher (1): drm/radeon/dpm: fix 120hz handling harder Chris Wilson (1): drm/i915: Skip allocating shadow batch for 0-length batches Christian König (4): drm/radeon: always dump the ring content if it's available drm/radeon: programm the VCE fw BAR as well drm/radeon: add extra check in radeon_ttm_tt_unpin_userptr drm/radeon: fix wait in radeon_mn_invalidate_range_start Daniel Stone (1): drm: Exynos: Respect framebuffer pitch for FIMD/Mixer Dave Airlie (5): Merge branch 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes Merge tag 'topic/drm-fixes-2015-04-02' of git://anongit.freedesktop.org/drm-intel into drm-fixes Merge tag 'drm-intel-fixes-2015-04-02' of git://anongit.freedesktop.org/drm-intel into drm-fixes Merge branch 'exynos-drm-fixes' of git://git.kernel.org/.../daeinki/drm-exynos into drm-fixes Merge branch 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes David Miller (1): radeon: Do not directly dereference pointers to BIOS area. Jani Nikula (1): drm/edid: set ELD for firmware and debugfs override EDIDs Ville Syrjälä (1): drm/i915: Reject the colorkey ioctls for primary and cursor planes drivers/gpu/drm/drm_edid_load.c| 1 + drivers/gpu/drm/drm_probe_helper.c | 1 + drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 +--- drivers/gpu/drm/exynos/exynos_mixer.c | 17 ++--- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +- drivers/gpu/drm/i915/intel_sprite.c| 4 ++-- drivers/gpu/drm/radeon/cikd.h | 1 + drivers/gpu/drm/radeon/radeon.h| 1 + drivers/gpu/drm/radeon/radeon_bios.c | 10 +++--- drivers/gpu/drm/radeon/radeon_mn.c | 11 --- drivers/gpu/drm/radeon/radeon_pm.c | 22 +- drivers/gpu/drm/radeon/radeon_ring.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c| 4 drivers/gpu/drm/radeon/vce_v2_0.c | 3 +++ 14 files changed, 58 insertions(+), 29 deletions(-)
[Bug 89619] Chrome crashes in 64 bit r600 driver while running google maps
https://bugs.freedesktop.org/show_bug.cgi?id=89619 --- Comment #7 from Jeff Powell --- Thank you for that last reply, Roland. I had no idea that update path was available in Ubuntu. I've applied it and things seem to be improved. I'll keep an eye out for additional updates of that type in the future as well. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/02b128ca/attachment.html>
[Bug 89876] radeon: mmap failed, errno: 12
https://bugs.freedesktop.org/show_bug.cgi?id=89876 --- Comment #1 from Michel Dänzer --- (In reply to The Blue Troll from comment #0) > radeon: mmap failed, errno: 12 [...] > personal note: it might be possible it was a simple out of memory issue, as > i did notice that ram useage was creeping up, but not sure. Indeed, errno 12 is ENOMEM, so that was probably it. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/7d2f9280/attachment.html>
[PATCH] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off)
On 02.04.2015 20:34, Chris Wilson wrote: > On vblank instant-off systems, we can get into a situation where the cost > of enabling and disabling the vblank IRQ around a drmWaitVblank query > dominates. However, we know that if the user wants the current vblank > counter, they are also very likely to immediately queue a vblank wait > and so we can keep the interrupt around and only turn it off if we have > no further vblank requests in the interrupt interval. > > After vblank event delivery there is a shadow of one vblank where the > interrupt is kept alive for the user to query and queue another vblank > event. Similarly, if the user is using blocking drmWaitVblanks, the > interrupt will be disabled on the IRQ following the wait completion. > However, if the user is simply querying the current vblank counter and > timestamp, the interrupt will be disabled after every IRQ and the user > will enabled it again on the first query following the IRQ. As I mentioned before, it might not be too hard to make querying the current counter work without enabling the interrupt. But this looks like a step in the right direction. Acked-by: Michel Dänzer -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer
[PATCH RFC v9 09/20] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format
Hi Thierry, 2015-03-03 19:07 GMT+08:00 Philipp Zabel : > Hi, > > Am Donnerstag, den 12.02.2015, 14:01 +0800 schrieb Liu Ying: >> Signed-off-by: Liu Ying >> --- >> v8->v9: >> * Rebase onto the imx-drm/next branch of Philipp Zabel's open git >> repository. > > I can't test this myself for lack of hardware, but I see no further > issues with patches 09 - 13 except for the use of > imx_drm_encoder_get_mux_id. I'll either rebase my patches that remove it > or fix it up when applying. > > Thierry, may I take these patches through imx-drm, or would you rather I > waited for you to pick up the drm/dsi and drm/bridge patches? Gentle ping. What's your opinion on the patches Philipp mentioned? Regards, Liu Ying > > regards > Philipp > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- Best Regards, Liu Ying
[Bug 89734] GL_AMD_pinned_memory extension causing a kernel hardlock
https://bugs.freedesktop.org/show_bug.cgi?id=89734 --- Comment #14 from poub365-bugzilla at yahoo.com --- Created attachment 114841 --> https://bugs.freedesktop.org/attachment.cgi?id=114841&action=edit xorg with patch -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/9e352d11/attachment-0001.html>
[Bug 89734] GL_AMD_pinned_memory extension causing a kernel hardlock
https://bugs.freedesktop.org/show_bug.cgi?id=89734 --- Comment #15 from poub365-bugzilla at yahoo.com --- Created attachment 114842 --> https://bugs.freedesktop.org/attachment.cgi?id=114842&action=edit dmesg with patch Very strange: I booted on the patch kernel today to get a Xlog. No flickering on desktop neither on fullscreen game. I didn't upgrade any component since last time. Dolphin is working fine from my quick test. So, I can now exit dolphin without freezing. I get this message on the console: The program 'dolphin-emu' received an X Window System error. This probably reflects a bug in the program. The error was 'BadWindow (invalid Window parameter)'. (Details: serial 8835 error_code 3 request_code 38 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) terminate called without an active exception Abandon (core dumped) I attach my dmesg and xorg.log just in case. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/071bee55/attachment.html>
[Bug 89876] radeon: mmap failed, errno: 12
https://bugs.freedesktop.org/show_bug.cgi?id=89876 The Blue Troll changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |NOTABUG --- Comment #2 from The Blue Troll --- in that case, it probability was a memory leak from the hundred something mods in mine craft, and frankly, i'm not too interested in finding it, so just go ahead and close this bug report. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/f3022c9f/attachment.html>
[Bug 89829] [bisected] radeonsi, commit 2cf48c creates artefacts in some applications (worst being Flash animations that are garbage)
https://bugs.freedesktop.org/show_bug.cgi?id=89829 --- Comment #10 from Apostolos B. --- I have a similar problem with mesa 10.5. My whole screen looks like the flash animation image when using the opengl compositor on Enlightenment E19. Renders the machine unusable. If i revert back to 10.4.6 it works fine. Barts 6850 radeon r600g driver. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/5f682576/attachment.html>
[PATCH 10/10] drm/exynos: atomic dpms support
Hi, >>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c >>> b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c >>> index e71e331..e0b085b 100644 >>> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c >>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c >>> @@ -275,9 +275,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev) >>> >>> } >>> >>> - /* disable all the possible outputs/crtcs before entering KMS mode */ >>> - drm_helper_disable_unused_functions(dev); >>> - >> >> I think this is not related with atomic dpms support, if this needs, >> could you make another patch? > > Yes, it is, once you port exynos to use atomic dpms we start getting warning > from this functions, the correct solution is to remove it. Other subsystems > followed the same approach. As i said, the warning comes from changes of this patch. >From rcar-du driver, it was handled to a separate patch. http://www.spinics.net/lists/linux-sh/msg40384.html > > I'm sending an updated patch set in a bit. OK, but i didn't get your updated patch 10/10 yet. Could you resend it? Thanks.
[GIT PULL] drm/rockchip: fixes
Hi Dave These are based on drm-next branch, fix some drm/rockchip problem. Please pull them. Mark The following changes since commit 502e95c6678505474f1056480310cd9382bacbac: drm/vgem: implement virtual GEM (2015-04-02 09:21:48 +1000) are available in the git repository at: https://github.com/markyzq/kernel-drm-rockchip.git drm-next0401 for you to fetch changes up to 5d82d1a785155fe4ff65628a88b677cfacea863b: drm/rockchip: vop: add vop power domain support (2015-04-03 14:23:36 +0800) Caesar Wang (1): drm: rockchip: Turn off VT switching on suspend Daniel Kurtz (1): drm/rockchip: register all connectors after bind Heiko Stuebner (1): drm/rockchip: fix clk enable disable mismatch in vop_crtc_mode_set Mark Yao (1): drm/rockchip: vop: add vop power domain support drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 19 +++ drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c |3 +++ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 25 + 3 files changed, 39 insertions(+), 8 deletions(-)-- ï¼ark
[PATCH] drm: fix drm_mode_getconnector() locking imbalance regression
Regression in commit 2caa80e72b57c6216aec6f6a11fcfb4fec46daa0 Author: Daniel Vetter Date: Sun Feb 22 11:38:36 2015 +0100 drm: Fix deadlock due to getconnector locking changes If the drm_connector_find() call returns NULL, we should no longer call drm_modeset_unlock() to avoid locking imbalance. Signed-off-by: Tommi Rantala Cc: Daniel Vetter --- drivers/gpu/drm/drm_crtc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 679b10e..b6f076b 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2121,7 +2121,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, connector = drm_connector_find(dev, out_resp->connector_id); if (!connector) { ret = -ENOENT; - goto out; + goto out_unlock; } for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) @@ -2201,6 +2201,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, out: drm_modeset_unlock(&dev->mode_config.connection_mutex); + +out_unlock: mutex_unlock(&dev->mode_config.mutex); return ret; -- 2.1.0
[Bug 89829] [bisected] radeonsi, commit 2cf48c creates artefacts in some applications (worst being Flash animations that are garbage)
https://bugs.freedesktop.org/show_bug.cgi?id=89829 --- Comment #11 from Michel Dänzer --- (In reply to Apostolos B. from comment #10) > I have a similar problem with mesa 10.5. My whole screen looks like the > flash animation image when using the opengl compositor on Enlightenment E19. > Renders the machine unusable. If i revert back to 10.4.6 it works fine. > > Barts 6850 radeon r600g driver. It may look similar, but it's unlikely to be the same problem. Please file your own report, and it would be very useful if you can bisect between 10.4.6 and 10.5. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/c8a5cb26/attachment-0001.html>
[PATCH] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off)
On Fri, Apr 03, 2015 at 11:20:20AM +0900, Michel Dänzer wrote: > On 02.04.2015 20:34, Chris Wilson wrote: > > On vblank instant-off systems, we can get into a situation where the cost > > of enabling and disabling the vblank IRQ around a drmWaitVblank query > > dominates. However, we know that if the user wants the current vblank > > counter, they are also very likely to immediately queue a vblank wait > > and so we can keep the interrupt around and only turn it off if we have > > no further vblank requests in the interrupt interval. > > > > After vblank event delivery there is a shadow of one vblank where the > > interrupt is kept alive for the user to query and queue another vblank > > event. Similarly, if the user is using blocking drmWaitVblanks, the > > interrupt will be disabled on the IRQ following the wait completion. > > However, if the user is simply querying the current vblank counter and > > timestamp, the interrupt will be disabled after every IRQ and the user > > will enabled it again on the first query following the IRQ. > > As I mentioned before, it might not be too hard to make querying the > current counter work without enabling the interrupt. But this looks like > a step in the right direction. I honestly chickened out in case I broke something! Hindsight says both are useful as currently with instant-off we will disable the vblank interrupt inside the IRQ handler delivering the event, whereas we can save quite a bit of pain by waiting for the next IRQ before doing the disable (culmulatively saving a lot more CPU cycles over the course of swap chain than the extra IRQ will cost). -Chris -- Chris Wilson, Intel Open Source Technology Centre
[Bug 89887] AMD 3650 Mobility locks up on overdraw
https://bugs.freedesktop.org/show_bug.cgi?id=89887 Bug ID: 89887 Summary: AMD 3650 Mobility locks up on overdraw Product: Mesa Version: git Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 Assignee: dri-devel at lists.freedesktop.org Reporter: pavol at klacansky.com QA Contact: dri-devel at lists.freedesktop.org Created attachment 114845 --> https://bugs.freedesktop.org/attachment.cgi?id=114845&action=edit Demo Hi, by accident I found out that after some threshold on overdraw the GPU hangs. I have attached a simple program that demonstrates the problem. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/853d3c69/attachment.html>
[PATCH -v4 5/8] drm/exynos: make zpos property immutable
On 2015ë 04ì 02ì¼ 01:02, Gustavo Padovan wrote: > From: Gustavo Padovan > > We already set each plane zpos at init, after that changes to zpos are > not expected. This patch turns zpos into a read-only property so now it is > impossible to set zpos. > > Signed-off-by: Gustavo Padovan > --- > drivers/gpu/drm/exynos/exynos_drm_plane.c | 21 ++--- > 1 file changed, 2 insertions(+), 19 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c > b/drivers/gpu/drm/exynos/exynos_drm_plane.c > index 504bd6e..2fbac9b 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c > @@ -184,27 +184,10 @@ static void exynos_plane_destroy(struct drm_plane > *plane) > drm_plane_cleanup(plane); > } > > -static int exynos_plane_set_property(struct drm_plane *plane, > - struct drm_property *property, > - uint64_t val) > -{ > - struct drm_device *dev = plane->dev; > - struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); > - struct exynos_drm_private *dev_priv = dev->dev_private; > - > - if (property == dev_priv->plane_zpos_property) { > - exynos_plane->zpos = val; > - return 0; > - } > - > - return -EINVAL; > -} > - > static struct drm_plane_funcs exynos_plane_funcs = { > .update_plane = exynos_update_plane, > .disable_plane = exynos_disable_plane, > .destroy= exynos_plane_destroy, > - .set_property = exynos_plane_set_property, As I commented like below before, This patch would make the compatibility of the existing application which uses set_property ioctl to be broken. Didn't you check my comment? http://www.spinics.net/lists/dri-devel/msg78852.html To other Exynos guys, Is there no any case that the hardware overlay should be configurable? If no case, I will merge this cleanup. After that, application can never change hardware overlay to each plane. Thanks, Inki Dae > }; > > static void exynos_plane_attach_zpos_property(struct drm_plane *plane, > @@ -216,8 +199,8 @@ static void exynos_plane_attach_zpos_property(struct > drm_plane *plane, > > prop = dev_priv->plane_zpos_property; > if (!prop) { > - prop = drm_property_create_range(dev, 0, "zpos", 0, > - MAX_PLANE - 1); > + prop = drm_property_create_range(dev, DRM_MODE_PROP_IMMUTABLE, > + "zpos", 0, MAX_PLANE - 1); > if (!prop) > return; > >
[Bug 89785] GPU Fault 147 and Ring Stalls and Tests Fail in Pillars of Eternity
https://bugs.freedesktop.org/show_bug.cgi?id=89785 --- Comment #13 from Andreas Grois --- (In reply to Alex B from comment #11) > I can confirm, patch from the last comment fixes this issue on my Radeon HD > 7750. Same here. Pillars of Eternity seems to work now on my system (llvm-3.6.0 with the patch and mesa-10-5.2, Radeon R9 270X). -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/1d46b1c7/attachment.html>
[PATCH v3 1/8] drm/exynos: add Exynos5433 decon driver
Hyungwon, Can you re-base your patch set on top of exynos-drm-next-todo? I merged cleanup series[1] and atomic feature support[2] to exynos-drm-next-todo for the test so you can re-base your patch set on top of exynos-drm-next-todo. You would need to modify exynos5433_drm_decon.c module. Please do it ASAP. Thanks, Inki Dae [1] [PATCH -v4 0/8] drm/exynos: clean up patches (preparing for atomic) [2] [PATCH -v2 00/10] drm/exynos: Add atomic modesetting support On 2015ë 03ì 26ì¼ 20:15, Hyungwon Hwang wrote: > From: Joonyoung Shim > > DECON(Display and Enhancement Controller) is new IP replacing FIMD in > Exynos5433. This patch adds Exynos5433 decon driver. > > Signed-off-by: Joonyoung Shim > Signed-off-by: Hyungwon Hwang > --- > Changes for v2: > - change file names and variable names of decon to represnt exynos5433 > instead > of exynos to distinguish them from exynos7 decon > > Changes for v3: > - fail fast when the proper image format is not set > - remove unnecessary checking code > - add and modify the function to make DPMS work well > .../devicetree/bindings/video/exynos5433-decon.txt | 65 ++ > drivers/gpu/drm/exynos/Kconfig | 6 + > drivers/gpu/drm/exynos/Makefile| 1 + > drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 665 > + > drivers/gpu/drm/exynos/exynos_drm_drv.c| 3 + > drivers/gpu/drm/exynos/exynos_drm_drv.h| 1 + > include/video/exynos5433_decon.h | 163 + > 7 files changed, 904 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/video/exynos5433-decon.txt > create mode 100644 drivers/gpu/drm/exynos/exynos5433_drm_decon.c > create mode 100644 include/video/exynos5433_decon.h >
[PATCH] drm/tegra: Remove unused .mode_set and .mode_set_base CRTC helpers
Hi Thierry, Ping ? On Friday 20 February 2015 13:43:56 Laurent Pinchart wrote: > The two CRTC helper operations are called only for non-atomic mode > setting, by either the drm_crtc_helper_set_config() helper or the > drm_helper_resume_force_mode() helper. As the driver has switched to > atomic mode setting and neither of those helpers is used, the operations > are not used anymore. Remove them. > > Signed-off-by: Laurent Pinchart > --- > drivers/gpu/drm/tegra/dc.c | 2 -- > 1 file changed, 2 deletions(-) > > Hi Thierry, > > I stumbled on this while trying to understand the atomic mode setting code > paths. Could you please test the patch ? > > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c > index 3aaa84ae2681..4476d6a35a0f 100644 > --- a/drivers/gpu/drm/tegra/dc.c > +++ b/drivers/gpu/drm/tegra/dc.c > @@ -1327,9 +1327,7 @@ static void tegra_crtc_atomic_flush(struct drm_crtc > *crtc) static const struct drm_crtc_helper_funcs tegra_crtc_helper_funcs = > { .disable = tegra_crtc_disable, > .mode_fixup = tegra_crtc_mode_fixup, > - .mode_set = drm_helper_crtc_mode_set, > .mode_set_nofb = tegra_crtc_mode_set_nofb, > - .mode_set_base = drm_helper_crtc_mode_set_base, > .prepare = tegra_crtc_prepare, > .commit = tegra_crtc_commit, > .atomic_check = tegra_crtc_atomic_check, -- Regards, Laurent Pinchart
[Bug 89891] Outlast segfault on new game
https://bugs.freedesktop.org/show_bug.cgi?id=89891 Bug ID: 89891 Summary: Outlast segfault on new game Product: Mesa Version: git Hardware: x86 (IA32) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 Assignee: dri-devel at lists.freedesktop.org Reporter: sa at whiz.se QA Contact: dri-devel at lists.freedesktop.org Created attachment 114851 --> https://bugs.freedesktop.org/attachment.cgi?id=114851&action=edit backtrace with git version lsThe game Outlast (from the latest Humble Indie Bundle) segfaults when a new game is launched. With Mesa 10.4.2 I get a segfault in ir_assignment::ir_assignment. With current git I get a "radeon: mmap failed, errno: 12" and a segfault in __memcpy_ssse3. Another problem is that the game takes ages to start, about 90 seconds from start to menu. Most of this time is spent compiling more than 18000 shaders, so maybe that's just a problem with the game. System environment: -- system architecture: 32-bit -- Linux distribution: Debian unstable -- GPU: REDWOOD -- Model: XFX Radeon HD 5670 1GB -- Display connector: DVI -- xf86-video-ati: 7.5.0 -- xserver: 1.16.4 -- mesa: 10.4.2 -- drm: 2.4.58 -- kernel: 3.19 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/372e50e9/attachment.html>
[Bug 89891] Outlast segfault on new game
https://bugs.freedesktop.org/show_bug.cgi?id=89891 --- Comment #1 from Sven Arvidsson --- Created attachment 114852 --> https://bugs.freedesktop.org/attachment.cgi?id=114852&action=edit backtrace with 10.4.2 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/661080f8/attachment.html>
[PATCH -v4 5/8] drm/exynos: make zpos property immutable
Hi Inki, 2015-04-03 Inki Dae : > On 2015ë 04ì 02ì¼ 01:02, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > We already set each plane zpos at init, after that changes to zpos are > > not expected. This patch turns zpos into a read-only property so now it is > > impossible to set zpos. > > > > Signed-off-by: Gustavo Padovan > > --- > > drivers/gpu/drm/exynos/exynos_drm_plane.c | 21 ++--- > > 1 file changed, 2 insertions(+), 19 deletions(-) > > > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c > > b/drivers/gpu/drm/exynos/exynos_drm_plane.c > > index 504bd6e..2fbac9b 100644 > > --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c > > +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c > > @@ -184,27 +184,10 @@ static void exynos_plane_destroy(struct drm_plane > > *plane) > > drm_plane_cleanup(plane); > > } > > > > -static int exynos_plane_set_property(struct drm_plane *plane, > > -struct drm_property *property, > > -uint64_t val) > > -{ > > - struct drm_device *dev = plane->dev; > > - struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); > > - struct exynos_drm_private *dev_priv = dev->dev_private; > > - > > - if (property == dev_priv->plane_zpos_property) { > > - exynos_plane->zpos = val; > > - return 0; > > - } > > - > > - return -EINVAL; > > -} > > - > > static struct drm_plane_funcs exynos_plane_funcs = { > > .update_plane = exynos_update_plane, > > .disable_plane = exynos_disable_plane, > > .destroy= exynos_plane_destroy, > > - .set_property = exynos_plane_set_property, > > As I commented like below before, This patch would make the > compatibility of the existing application which uses set_property ioctl > to be broken. Didn't you check my comment? > http://www.spinics.net/lists/dri-devel/msg78852.html I checked that and it is currently not possible to output a error message when an property is set to immutable. The drm core will return earlier and never call the driver's set_property callback. We won't be able to add the error message but I think we need this patch. Gustavo
[PATCH 10/10] drm/exynos: atomic dpms support
Hi Joonyoung, 2015-04-03 Joonyoung Shim : > Hi, > > >>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c > >>> b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c > >>> index e71e331..e0b085b 100644 > >>> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c > >>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c > >>> @@ -275,9 +275,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev) > >>> > >>> } > >>> > >>> - /* disable all the possible outputs/crtcs before entering KMS mode */ > >>> - drm_helper_disable_unused_functions(dev); > >>> - > >> > >> I think this is not related with atomic dpms support, if this needs, > >> could you make another patch? > > > > Yes, it is, once you port exynos to use atomic dpms we start getting warning > > from this functions, the correct solution is to remove it. Other subsystems > > followed the same approach. > > As i said, the warning comes from changes of this patch. > > From rcar-du driver, it was handled to a separate patch. > > http://www.spinics.net/lists/linux-sh/msg40384.html Right, I think make this a new patch is no harm and will make things more clear. > > > > I'm sending an updated patch set in a bit. > > OK, but i didn't get your updated patch 10/10 yet. Could you resend it? No, I did a mistake with git send-email. Used 000*.patch to send the patches. That excluded the 0010 one. So I resend a new patchset with the change above and make sure I don't make the same mistake again. Gustavo
[PATCH v4 0/4] drm/layerscape: Add Freescale DCU DRM driver
@Daniel, Do you have any other comments for this driver? @Stefan, Please help test this driver on vybrid if possible, I have test it on vybrid twr board. If anyone has any objections, please let me know. Changed in V4: -This version doesn't have functionality changed. Just a minor adjustment. Changed in V3: - Test driver on Vybrid board and add compatible string - Remove unused functions - set default crtc for encoder - replace legacy functions with atomic help functions - Set the unique name of the DRM device - Implement irq handle function for vblank interrupt Changed in v2: - Add atomic support - Modify bindings file - Rename node for compatibility - Move platform related code out for compatibility Added in v1: - Add support for DCU display controller on the Freescale LS102x SoCs. - Create a primary plane, a fb created for fbdev, a crtc, a connector for TFT LCD panel, an encoder. .../devicetree/bindings/drm/fsl/fsl,dcu.txt| 50 drivers/gpu/drm/Kconfig| 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/fsl/Kconfig| 17 ++ drivers/gpu/drm/fsl/Makefile | 7 + drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c| 194 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h| 30 ++ drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c | 165 +++ drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h | 26 ++ drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c | 329 + drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h | 210 + drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c| 26 ++ drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c | 42 +++ drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h | 17 ++ drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c| 192 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h| 23 ++ 16 files changed, 1331 insertions(+) create mode 100644 Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt create mode 100644 drivers/gpu/drm/fsl/Kconfig create mode 100644 drivers/gpu/drm/fsl/Makefile create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h
[PATCH v4 1/4] drm/layerscape: Add Freescale DCU DRM driver
This patch add support for Two Dimensional Animation and Compositing Engine (2D-ACE) on the Freescale SoCs. 2D-ACE is a Freescale display controller. 2D-ACE describes the functionality of the module extremely well its name is a value that cannot be used as a token in programming languages. Instead the valid token "DCU" is used to tag the register names and function names. The Display Controller Unit (DCU) module is a system master that fetches graphics stored in internal or external memory and displays them on a TFT LCD panel. A wide range of panel sizes is supported and the timing of the interface signals is highly configurable. Graphics are read directly from memory and then blended in real-time, which allows for dynamic content creation with minimal CPU intervention. The features: (1) Full RGB888 output to TFT LCD panel. (2) For the current LCD panel, WQVGA "480x272" is supported. (3) Blending of each pixel using up to 4 source layers dependent on size of panel. (4) Each graphic layer can be placed with one pixel resolution in either axis. (5) Each graphic layer support RGB565 and RGB888 direct colors without alpha channel and BGRA direct colors with an alpha channel. (6) Each graphic layer support alpha blending with 8-bit resolution. This is a simplified version, only one primary plane, one framebuffer created for fbdev, one crtc, one connector for TFT LCD panel, an encoder. Signed-off-by: Alison Wang Signed-off-by: Xiubo Li Signed-off-by: Jianwei Wang --- .../devicetree/bindings/drm/fsl/fsl,dcu.txt| 50 drivers/gpu/drm/Kconfig| 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/fsl/Kconfig| 17 ++ drivers/gpu/drm/fsl/Makefile | 7 + drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c| 194 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h| 30 ++ drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c | 165 +++ drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h | 26 ++ drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c | 329 + drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h | 210 + drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c| 26 ++ drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c | 42 +++ drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h | 17 ++ drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c| 192 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h| 23 ++ 16 files changed, 1331 insertions(+) create mode 100644 Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt create mode 100644 drivers/gpu/drm/fsl/Kconfig create mode 100644 drivers/gpu/drm/fsl/Makefile create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h diff --git a/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt b/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt new file mode 100644 index 000..bdc7d5b --- /dev/null +++ b/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt @@ -0,0 +1,49 @@ +Device Tree bindings for Freescale DCU DRM Driver + +Required properties: +- compatible: Should be one of + * "fsl,ls1021a-dcu". + * "fsl,vf610-dcu". +- reg: Address and length of the register set for dcu. +- clocks: From common clock binding: handle to dcu clock. +- clock-names: From common clock binding: Shall be "dcu". +- display: The phandle to display node. + +Required properties: +- bits-per-pixel: <16> for RGB565, + <24> for RGB888, + <32> for RGB. + +Required timing node for dispplay sub-node: +- display-timings: Refer to binding doc display-timing.txt for details. + +Examples: +dcu: dcu at 2ce { + compatible = "fsl,ls1021a-dcu"; + reg = <0x0 0x2ce 0x0 0x1>; + clocks = <&platform_clk 0>; + clock-names = "dcu"; + big-endian; + display = <&display>; + + display: display at 0 { + bits-per-pixel = <24>; + + display-timings { + native-mode = <&timing0>; + timing0: nl4827hc19 { + clock-frequency = <1087>; + hactive = <480>; + vactive = <272>; +
[PATCH v4 4/4] arm/dts/ls1021a: Add a TFT LCD panel dts node for DCU
Add a required display-timings node for the TFT LCD panel the TFT LCD panel is WQVGA "480x272", and the bpp is 24. Signed-off-by: Alison Wang Signed-off-by: Xiubo Li Signed-off-by: Jianwei Wang --- arch/arm/boot/dts/ls1021a-twr.dts | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/boot/dts/ls1021a-twr.dts b/arch/arm/boot/dts/ls1021a-twr.dts index a2c591e..4780b11 100644 --- a/arch/arm/boot/dts/ls1021a-twr.dts +++ b/arch/arm/boot/dts/ls1021a-twr.dts @@ -58,6 +58,32 @@ }; }; +&dcu { + display = <&display>; + status = "okay"; + + display: display at 0 { + bits-per-pixel = <24>; + + display-timings { + native-mode = <&timing0>; + timing0: nl4827hc19 { + clock-frequency = <1087>; + hactive = <480>; + vactive = <272>; + hback-porch = <2>; + hfront-porch = <2>; + vback-porch = <2>; + vfront-porch = <2>; + hsync-len = <41>; + vsync-len = <4>; + hsync-active = <1>; + vsync-active = <1>; + }; + }; + }; +}; + &dspi1 { bus-num = <0>; status = "okay"; -- 2.1.0.27.g96db324
[PATCH v4 2/4] arm/layerscape/ls1021a: DCU pixel clock control
Enable DCU pixel clock when platform devices initinalizing and provide enable and disable pixel clock functions for drm driver Signed-off-by: Alison Wang Signed-off-by: Xiubo Li Signed-off-by: Jianwei Wang --- arch/arm/mach-imx/mach-ls1021a.c | 36 include/linux/fsl/dcu.h | 22 ++ 2 files changed, 58 insertions(+) create mode 100644 include/linux/fsl/dcu.h diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c index b89c858..4fb346d 100644 --- a/arch/arm/mach-imx/mach-ls1021a.c +++ b/arch/arm/mach-imx/mach-ls1021a.c @@ -8,9 +8,44 @@ */ #include +#include +#include +#include +#include #include "common.h" +void dcu_pixclk_disable(void) +{ + struct regmap *scfg_regmap; + + scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg"); + if (IS_ERR(scfg_regmap)) { + pr_err("No syscfg phandle specified\n"); + return; + } + + regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_DISABLE); +} + +void dcu_pixclk_enable(void) +{ + struct regmap *scfg_regmap; + + scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg"); + if (IS_ERR(scfg_regmap)) { + pr_err("No syscfg phandle specified\n"); + return; + } + + regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_ENABLE); +} + +static void __init ls1021a_init_machine(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + dcu_pixclk_enable(); +} static const char * const ls1021a_dt_compat[] __initconst = { "fsl,ls1021a", NULL, @@ -18,5 +53,6 @@ static const char * const ls1021a_dt_compat[] __initconst = { DT_MACHINE_START(LS1021A, "Freescale LS1021A") .smp= smp_ops(ls1021a_smp_ops), + .init_machine = ls1021a_init_machine, .dt_compat = ls1021a_dt_compat, MACHINE_END diff --git a/include/linux/fsl/dcu.h b/include/linux/fsl/dcu.h new file mode 100644 index 000..1873057 --- /dev/null +++ b/include/linux/fsl/dcu.h @@ -0,0 +1,22 @@ +/* + * Copyright 2015 Freescale Semiconductor, Inc. + * + * Freescale DCU drm device driver + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef __FSL_DCU_H__ +#define __FSL_DCU_H__ + +#define SCFG_PIXCLKCR 0x28 +#define PXCK_ENABLEBIT(31) +#define PXCK_DISABLE 0 + +void dcu_pixclk_enable(void); +void dcu_pixclk_disable(void); + +#endif /* __FSL_DCU_H__ */ -- 2.1.0.27.g96db324
[PATCH v4 3/4] arm/dts/ls1021a: Add DCU dts node
Add DCU node, DCU is a display controller of Freescale named 2D-ACE. Signed-off-by: Alison Wang Signed-off-by: Xiubo Li Signed-off-by: Jianwei Wang --- arch/arm/boot/dts/ls1021a.dtsi | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi index c70bb27..6d6e3e2 100644 --- a/arch/arm/boot/dts/ls1021a.dtsi +++ b/arch/arm/boot/dts/ls1021a.dtsi @@ -383,6 +383,16 @@ <&platform_clk 1>; }; + dcu: dcu at 2ce { + compatible = "fsl,ls1021a-dcu"; + reg = <0x0 0x2ce 0x0 0x1>; + interrupts = ; + clocks = <&platform_clk 0>; + clock-names = "dcu"; + big-endian; + status = "disabled"; + }; + mdio0: mdio at 2d24000 { compatible = "gianfar"; device_type = "mdio"; -- 2.1.0.27.g96db324
[PATCH -v3 00/11] drm/exynos: Add atomic modesetting support
From: Gustavo Padovan Hi, Here goes the full support for atomic modesetting on exynos. I've split the patches in the various phases of atomic support. These patches sits on top of the clean up patches I've sent yesterday to this mailing list[1]. v2: fixes comments by Joonyoung - remove unused var in patch 09 - use ->disable instead of outdated ->dpms in hdmi code - remove WARN_ON from crtc enable/disable v3: fixes comment by Joonyoung - move the removal of drm_helper_disable_unused_functions() to separated patch Gustavo --- Gustavo Padovan (11): drm/exynos: atomic phase 1: use drm_plane_helper_update() drm/exynos: atomic phase 1: use drm_plane_helper_disable() drm/exynos: atomic phase 1: add .mode_set_nofb() callback drm/exynos: atomic phase 2: wire up state reset(), duplicate() and destroy() drm/exynos: atomic phase 2: keep track of framebuffer pointer drm/exynos: atomic phase 3: atomic updates of planes drm/exynos: atomic phase 3: use atomic .set_config helper drm/exynos: atomic phase 3: convert page flips drm/exynos: remove exported functions from exynos_drm_plane drm/exynos: don't disable unused functions at init drm/exynos: atomic dpms support drivers/gpu/drm/bridge/ptn3460.c | 4 + drivers/gpu/drm/exynos/exynos_dp_core.c | 6 +- drivers/gpu/drm/exynos/exynos_drm_connector.c | 6 +- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 226 -- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 6 +- drivers/gpu/drm/exynos/exynos_drm_drv.c | 2 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 6 +- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 27 +-- drivers/gpu/drm/exynos/exynos_drm_fb.c| 12 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 - drivers/gpu/drm/exynos/exynos_drm_plane.c | 113 +++-- drivers/gpu/drm/exynos/exynos_drm_plane.h | 11 -- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 6 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 10 +- 15 files changed, 187 insertions(+), 255 deletions(-) -- 2.1.0
[PATCH -v3 01/11] drm/exynos: atomic phase 1: use drm_plane_helper_update()
From: Gustavo Padovan Rip out the check from exynos_update_plane() and create exynos_check_plane() for the check phase enabling use to use the atomic helpers to call our check and update phases when updating planes. Update all users of exynos_update_plane() accordingly to call exynos_check_plane() before. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 29 drivers/gpu/drm/exynos/exynos_drm_plane.c | 37 ++- drivers/gpu/drm/exynos/exynos_drm_plane.h | 2 +- 3 files changed, 43 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index eb49195..1c0d936 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -116,6 +116,7 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *fb = crtc->primary->fb; unsigned int crtc_w; unsigned int crtc_h; + int ret; /* when framebuffer changing is requested, crtc's dpms should be on */ if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) { @@ -123,11 +124,16 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, return -EPERM; } + ret = exynos_check_plane(crtc->primary, fb); + if (ret) + return ret; + crtc_w = fb->width - x; crtc_h = fb->height - y; + exynos_update_plane(crtc->primary, crtc, fb, 0, 0, + crtc_w, crtc_h, x, y, crtc_w, crtc_h); - return exynos_update_plane(crtc->primary, crtc, fb, 0, 0, - crtc_w, crtc_h, x, y, crtc_w, crtc_h); + return 0; } static void exynos_drm_crtc_disable(struct drm_crtc *crtc) @@ -164,7 +170,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, { struct drm_device *dev = crtc->dev; struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - struct drm_framebuffer *old_fb = crtc->primary->fb; unsigned int crtc_w, crtc_h; int ret; @@ -183,6 +188,10 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, goto out; } + ret = exynos_check_plane(crtc->primary, fb); + if (ret) + goto out; + ret = drm_vblank_get(dev, exynos_crtc->pipe); if (ret) { DRM_DEBUG("failed to acquire vblank counter\n"); @@ -201,17 +210,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, crtc->primary->fb = fb; crtc_w = fb->width - crtc->x; crtc_h = fb->height - crtc->y; - ret = exynos_update_plane(crtc->primary, crtc, fb, 0, 0, - crtc_w, crtc_h, crtc->x, crtc->y, - crtc_w, crtc_h); - if (ret) { - crtc->primary->fb = old_fb; - spin_lock_irq(&dev->event_lock); - exynos_crtc->event = NULL; - drm_vblank_put(dev, exynos_crtc->pipe); - spin_unlock_irq(&dev->event_lock); - return ret; - } + exynos_update_plane(crtc->primary, crtc, fb, 0, 0, + crtc_w, crtc_h, crtc->x, crtc->y, + crtc_w, crtc_h); return 0; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 2b0479e..5a37816 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -140,21 +140,15 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, plane->crtc = crtc; } -int +void exynos_update_plane(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 exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); - int ret; - - ret = exynos_check_plane(plane, fb); - if (ret < 0) - return ret; exynos_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x >> 16, src_y >> 16, @@ -162,8 +156,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, if (exynos_crtc->ops->win_commit) exynos_crtc->ops->win_commit(exynos_crtc, exynos_plane->zpos); - - return 0; } static int exynos_disable_plane(struct drm_plane *plane) @@ -179,11 +171,34 @@ static int exynos_disable_plane(struct drm_plane *plane) } static struct drm_plane_funcs exynos_plane_funcs = { - .update_plane = exynos_update_plane, + .update_plane = drm_plane_helper_update, .disable_plane = exyn
[PATCH -v3 02/11] drm/exynos: atomic phase 1: use drm_plane_helper_disable()
From: Gustavo Padovan The atomic helper to disable planes also uses the optional .atomic_disable() helper. The unique operation it does is calling .win_disable() exynos_drm_fb_get_buf_cnt() needs a fb check too to avoid a null pointer. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_fb.c| 2 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 26 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index d346d1e..470456d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -136,7 +136,7 @@ unsigned int exynos_drm_fb_get_buf_cnt(struct drm_framebuffer *fb) exynos_fb = to_exynos_fb(fb); - return exynos_fb->buf_cnt; + return exynos_fb ? exynos_fb->buf_cnt : 0; } struct drm_framebuffer * diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 5a37816..2152a24 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -158,21 +158,9 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, exynos_crtc->ops->win_commit(exynos_crtc, exynos_plane->zpos); } -static int exynos_disable_plane(struct drm_plane *plane) -{ - struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(plane->crtc); - - if (exynos_crtc->ops->win_disable) - exynos_crtc->ops->win_disable(exynos_crtc, - exynos_plane->zpos); - - return 0; -} - static struct drm_plane_funcs exynos_plane_funcs = { .update_plane = drm_plane_helper_update, - .disable_plane = exynos_disable_plane, + .disable_plane = drm_plane_helper_disable, .destroy= drm_plane_cleanup, }; @@ -194,9 +182,21 @@ static void exynos_plane_atomic_update(struct drm_plane *plane, state->src_w >> 16, state->src_h >> 16); } +static void exynos_plane_atomic_disable(struct drm_plane *plane, + struct drm_plane_state *old_state) +{ + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(old_state->crtc); + + if (exynos_crtc->ops->win_disable) + exynos_crtc->ops->win_disable(exynos_crtc, + exynos_plane->zpos); +} + static const struct drm_plane_helper_funcs plane_helper_funcs = { .atomic_check = exynos_plane_atomic_check, .atomic_update = exynos_plane_atomic_update, + .atomic_disable = exynos_plane_atomic_disable, }; static void exynos_plane_attach_zpos_property(struct drm_plane *plane, -- 2.1.0
[PATCH -v3 03/11] drm/exynos: atomic phase 1: add .mode_set_nofb() callback
From: Gustavo Padovan The new atomic infrastructure needs the .mode_set_nofb() callback to update CRTC timings before setting any plane. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 60 +--- 1 file changed, 9 insertions(+), 51 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 1c0d936..35f101f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -81,59 +81,16 @@ exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc, return true; } -static int -exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode, int x, int y, - struct drm_framebuffer *old_fb) -{ - struct drm_framebuffer *fb = crtc->primary->fb; - unsigned int crtc_w; - unsigned int crtc_h; - int ret; - - /* -* copy the mode data adjusted by mode_fixup() into crtc->mode -* so that hardware can be seet to proper mode. -*/ - memcpy(&crtc->mode, adjusted_mode, sizeof(*adjusted_mode)); - - ret = exynos_check_plane(crtc->primary, fb); - if (ret < 0) - return ret; - - crtc_w = fb->width - x; - crtc_h = fb->height - y; - exynos_plane_mode_set(crtc->primary, crtc, fb, 0, 0, - crtc_w, crtc_h, x, y, crtc_w, crtc_h); - - return 0; -} - -static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, - struct drm_framebuffer *old_fb) +static void +exynos_drm_crtc_mode_set_nofb(struct drm_crtc *crtc) { struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - struct drm_framebuffer *fb = crtc->primary->fb; - unsigned int crtc_w; - unsigned int crtc_h; - int ret; - /* when framebuffer changing is requested, crtc's dpms should be on */ - if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) { - DRM_ERROR("failed framebuffer changing request.\n"); - return -EPERM; - } - - ret = exynos_check_plane(crtc->primary, fb); - if (ret) - return ret; - - crtc_w = fb->width - x; - crtc_h = fb->height - y; - exynos_update_plane(crtc->primary, crtc, fb, 0, 0, - crtc_w, crtc_h, x, y, crtc_w, crtc_h); + if (WARN_ON(!crtc->state)) + return; - return 0; + if (exynos_crtc->ops->commit) + exynos_crtc->ops->commit(exynos_crtc); } static void exynos_drm_crtc_disable(struct drm_crtc *crtc) @@ -158,8 +115,9 @@ static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { .prepare= exynos_drm_crtc_prepare, .commit = exynos_drm_crtc_commit, .mode_fixup = exynos_drm_crtc_mode_fixup, - .mode_set = exynos_drm_crtc_mode_set, - .mode_set_base = exynos_drm_crtc_mode_set_base, + .mode_set = drm_helper_crtc_mode_set, + .mode_set_nofb = exynos_drm_crtc_mode_set_nofb, + .mode_set_base = drm_helper_crtc_mode_set_base, .disable= exynos_drm_crtc_disable, }; -- 2.1.0
[PATCH -v3 04/11] drm/exynos: atomic phase 2: wire up state reset(), duplicate() and destroy()
From: Gustavo Padovan Set CRTC, planes and connectors to use the default implementations from the atomic helper library. The helpers will work to keep track of state for each DRM object. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/bridge/ptn3460.c | 4 drivers/gpu/drm/exynos/exynos_dp_core.c | 4 drivers/gpu/drm/exynos/exynos_drm_connector.c | 4 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 ++ drivers/gpu/drm/exynos/exynos_drm_dpi.c | 4 drivers/gpu/drm/exynos/exynos_drm_drv.c | 2 ++ drivers/gpu/drm/exynos/exynos_drm_dsi.c | 4 drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 drivers/gpu/drm/exynos/exynos_hdmi.c | 4 10 files changed, 40 insertions(+) diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c index 826833e..30da10c 100644 --- a/drivers/gpu/drm/bridge/ptn3460.c +++ b/drivers/gpu/drm/bridge/ptn3460.c @@ -27,6 +27,7 @@ #include "drm_crtc.h" #include "drm_crtc_helper.h" +#include "drm_atomic_helper.h" #include "drm_edid.h" #include "drmP.h" @@ -263,6 +264,9 @@ static struct drm_connector_funcs ptn3460_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .detect = ptn3460_detect, .destroy = ptn3460_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; int ptn3460_bridge_attach(struct drm_bridge *bridge) diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index bf17a60..6704d5c 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.c +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -952,6 +953,9 @@ static struct drm_connector_funcs exynos_dp_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .detect = exynos_dp_detect, .destroy = exynos_dp_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; static int exynos_dp_get_modes(struct drm_connector *connector) diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c index ba9b3d5..980b085 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c @@ -13,6 +13,7 @@ #include #include +#include #include #include "exynos_drm_drv.h" @@ -182,6 +183,9 @@ static struct drm_connector_funcs exynos_connector_funcs = { .fill_modes = exynos_drm_connector_fill_modes, .detect = exynos_drm_connector_detect, .destroy= exynos_drm_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; struct drm_connector *exynos_drm_connector_create(struct drm_device *dev, diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 35f101f..44e73d0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -14,6 +14,8 @@ #include #include +#include +#include #include "exynos_drm_crtc.h" #include "exynos_drm_drv.h" @@ -194,8 +196,12 @@ static struct drm_crtc_funcs exynos_crtc_funcs = { .set_config = drm_crtc_helper_set_config, .page_flip = exynos_drm_crtc_page_flip, .destroy= exynos_drm_crtc_destroy, + .reset = drm_atomic_helper_crtc_reset, + .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, }; + struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, struct drm_plane *plane, int pipe, diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index 37678cf..ced5c23 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -63,6 +64,9 @@ static struct drm_connector_funcs exynos_dpi_connector_funcs = { .detect = exynos_dpi_detect, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = exynos_dpi_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state =
[PATCH -v3 05/11] drm/exynos: atomic phase 2: keep track of framebuffer pointer
From: Gustavo Padovan Use drm_atomic_set_fb_for_plane() in the legacy page_flip path to keep track of the framebuffer pointer and reference. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 44e73d0..b080e83 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -174,6 +174,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, crtc_w, crtc_h, crtc->x, crtc->y, crtc_w, crtc_h); + if (crtc->primary->state) + drm_atomic_set_fb_for_plane(crtc->primary->state, fb); + return 0; out: -- 2.1.0
[PATCH -v3 06/11] drm/exynos: atomic phase 3: atomic updates of planes
From: Gustavo Padovan Now that phase 1 and 2 are complete we can switch the update/disable_plane callbacks to their atomic version. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_fb.c| 3 +++ drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 470456d..b83ceea 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "exynos_drm_drv.h" @@ -309,6 +310,8 @@ static void exynos_drm_output_poll_changed(struct drm_device *dev) static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = { .fb_create = exynos_user_fb_create, .output_poll_changed = exynos_drm_output_poll_changed, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = drm_atomic_helper_commit, }; void exynos_drm_mode_config_init(struct drm_device *dev) diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 3cd628e..e83908a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -160,8 +160,8 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, } static struct drm_plane_funcs exynos_plane_funcs = { - .update_plane = drm_plane_helper_update, - .disable_plane = drm_plane_helper_disable, + .update_plane = drm_atomic_helper_update_plane, + .disable_plane = drm_atomic_helper_disable_plane, .destroy= drm_plane_cleanup, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, -- 2.1.0
[PATCH -v3 07/11] drm/exynos: atomic phase 3: use atomic .set_config helper
From: Gustavo Padovan Now that phase 1 and 2 are complete switch .set_config helper to use the atomic one. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index b080e83..b0888d4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -196,7 +196,7 @@ static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) } static struct drm_crtc_funcs exynos_crtc_funcs = { - .set_config = drm_crtc_helper_set_config, + .set_config = drm_atomic_helper_set_config, .page_flip = exynos_drm_crtc_page_flip, .destroy= exynos_drm_crtc_destroy, .reset = drm_atomic_helper_crtc_reset, -- 2.1.0
[PATCH -v3 08/11] drm/exynos: atomic phase 3: convert page flips
From: Gustavo Padovan PageFlips now use the atomic helper to work through the atomic modesetting API. Async page flips are not supported yet. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 63 +--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 9 - 2 files changed, 9 insertions(+), 63 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index b0888d4..0db7b91 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -123,67 +123,6 @@ static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { .disable= exynos_drm_crtc_disable, }; -static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, -struct drm_framebuffer *fb, -struct drm_pending_vblank_event *event, -uint32_t page_flip_flags) -{ - struct drm_device *dev = crtc->dev; - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - unsigned int crtc_w, crtc_h; - int ret; - - /* when the page flip is requested, crtc's dpms should be on */ - if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) { - DRM_ERROR("failed page flip request.\n"); - return -EINVAL; - } - - if (!event) - return -EINVAL; - - spin_lock_irq(&dev->event_lock); - if (exynos_crtc->event) { - ret = -EBUSY; - goto out; - } - - ret = exynos_check_plane(crtc->primary, fb); - if (ret) - goto out; - - ret = drm_vblank_get(dev, exynos_crtc->pipe); - if (ret) { - DRM_DEBUG("failed to acquire vblank counter\n"); - goto out; - } - - exynos_crtc->event = event; - spin_unlock_irq(&dev->event_lock); - - /* -* the pipe from user always is 0 so we can set pipe number -* of current owner to event. -*/ - event->pipe = exynos_crtc->pipe; - - crtc->primary->fb = fb; - crtc_w = fb->width - crtc->x; - crtc_h = fb->height - crtc->y; - exynos_update_plane(crtc->primary, crtc, fb, 0, 0, - crtc_w, crtc_h, crtc->x, crtc->y, - crtc_w, crtc_h); - - if (crtc->primary->state) - drm_atomic_set_fb_for_plane(crtc->primary->state, fb); - - return 0; - -out: - spin_unlock_irq(&dev->event_lock); - return ret; -} - static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) { struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); @@ -197,7 +136,7 @@ static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) static struct drm_crtc_funcs exynos_crtc_funcs = { .set_config = drm_atomic_helper_set_config, - .page_flip = exynos_drm_crtc_page_flip, + .page_flip = drm_atomic_helper_page_flip, .destroy= exynos_drm_crtc_destroy, .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index b83ceea..b4bc3ef 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -307,11 +307,18 @@ static void exynos_drm_output_poll_changed(struct drm_device *dev) exynos_drm_fbdev_init(dev); } +static int exynos_atomic_commit(struct drm_device *dev, + struct drm_atomic_state *state, + bool async) +{ + return drm_atomic_helper_commit(dev, state, false); +} + static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = { .fb_create = exynos_user_fb_create, .output_poll_changed = exynos_drm_output_poll_changed, .atomic_check = drm_atomic_helper_check, - .atomic_commit = drm_atomic_helper_commit, + .atomic_commit = exynos_atomic_commit, }; void exynos_drm_mode_config_init(struct drm_device *dev) -- 2.1.0
[PATCH -v3 09/11] drm/exynos: remove exported functions from exynos_drm_plane
From: Gustavo Padovan Now that no one is using the functions exported by exynos_drm_plane due to the atomic conversion we can make remove some of the them or make them static. v2: remove unused exynos_drm_crtc Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_plane.c | 90 +-- drivers/gpu/drm/exynos/exynos_drm_plane.h | 11 2 files changed, 37 insertions(+), 64 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index e83908a..5d3066d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -62,35 +62,12 @@ static int exynos_plane_get_size(int start, unsigned length, unsigned last) return size; } -int exynos_check_plane(struct drm_plane *plane, struct drm_framebuffer *fb) -{ - struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); - int nr; - int i; - - nr = exynos_drm_fb_get_buf_cnt(fb); - for (i = 0; i < nr; i++) { - struct exynos_drm_gem_buf *buffer = exynos_drm_fb_buffer(fb, i); - - if (!buffer) { - DRM_DEBUG_KMS("buffer is null\n"); - return -EFAULT; - } - - exynos_plane->dma_addr[i] = buffer->dma_addr; - - DRM_DEBUG_KMS("buffer: %d, dma_addr = 0x%lx\n", - i, (unsigned long)exynos_plane->dma_addr[i]); - } - - return 0; -} - -void exynos_plane_mode_set(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) +static void exynos_plane_mode_set(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 exynos_drm_plane *exynos_plane = to_exynos_plane(plane); unsigned int actual_w; @@ -141,24 +118,6 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, plane->crtc = crtc; } -void -exynos_update_plane(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 exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); - - exynos_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, - crtc_w, crtc_h, src_x >> 16, src_y >> 16, - src_w >> 16, src_h >> 16); - - if (exynos_crtc->ops->win_commit) - exynos_crtc->ops->win_commit(exynos_crtc, exynos_plane->zpos); -} - static struct drm_plane_funcs exynos_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, @@ -171,19 +130,44 @@ static struct drm_plane_funcs exynos_plane_funcs = { static int exynos_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) { - return exynos_check_plane(plane, state->fb); + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); + int nr; + int i; + + nr = exynos_drm_fb_get_buf_cnt(state->fb); + for (i = 0; i < nr; i++) { + struct exynos_drm_gem_buf *buffer = + exynos_drm_fb_buffer(state->fb, i); + + if (!buffer) { + DRM_DEBUG_KMS("buffer is null\n"); + return -EFAULT; + } + + exynos_plane->dma_addr[i] = buffer->dma_addr; + + DRM_DEBUG_KMS("buffer: %d, dma_addr = 0x%lx\n", + i, (unsigned long)exynos_plane->dma_addr[i]); + } + + return 0; } static void exynos_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { struct drm_plane_state *state = plane->state; + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(state->crtc); + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); - exynos_update_plane(plane, state->crtc, state->fb, - state->crtc_x, state->crtc_y, - state->crtc_w, state->crtc_h, - state->src_x >> 16,
[PATCH -v3 10/11] drm/exynos: don't disable unused functions at init
From: Gustavo Padovan Everything starts disabled so we don't really need to disable anything. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index e71e331..e0b085b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -275,9 +275,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev) } - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(dev); - ret = drm_fb_helper_initial_config(helper, PREFERRED_BPP); if (ret < 0) { DRM_ERROR("failed to set up hw configuration.\n"); -- 2.1.0
[PATCH -v3 11/11] drm/exynos: atomic dpms support
From: Gustavo Padovan Run dpms operations through the atomic intefaces. This basically removes the .dpms() callback from econders and crtcs and use .disable() and .enable() to turn the crtc on and off. v2: Address comments by Joonyoung: - make hdmi code call ->disable() instead of ->dpms() - do not use WARN_ON on crtc enable/disable Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_dp_core.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_connector.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 99 +++ drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 27 ++-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 6 +- 9 files changed, 70 insertions(+), 76 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index 6704d5c..e030d16 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.c +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c @@ -949,7 +949,7 @@ static void exynos_dp_connector_destroy(struct drm_connector *connector) } static struct drm_connector_funcs exynos_dp_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = drm_atomic_helper_connector_dpms, .fill_modes = drm_helper_probe_single_connector_modes, .detect = exynos_dp_detect, .destroy = exynos_dp_connector_destroy, diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c index 980b085..e459e64 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c @@ -179,7 +179,7 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector) } static struct drm_connector_funcs exynos_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = drm_atomic_helper_connector_dpms, .fill_modes = exynos_drm_connector_fill_modes, .detect = exynos_drm_connector_detect, .destroy= exynos_drm_connector_destroy, diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 0db7b91..519c569 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -22,51 +22,57 @@ #include "exynos_drm_encoder.h" #include "exynos_drm_plane.h" -static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) +static void exynos_drm_crtc_enable(struct drm_crtc *crtc) { struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); + struct exynos_drm_plane *exynos_plane = to_exynos_plane(crtc->primary); - DRM_DEBUG_KMS("crtc[%d] mode[%d]\n", crtc->base.id, mode); - - if (exynos_crtc->dpms == mode) { - DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n"); + if (exynos_crtc->enabled) return; - } - - if (mode > DRM_MODE_DPMS_ON) { - /* wait for the completion of page flip. */ - if (!wait_event_timeout(exynos_crtc->pending_flip_queue, - (exynos_crtc->event == NULL), HZ/20)) - exynos_crtc->event = NULL; - drm_crtc_vblank_off(crtc); - } if (exynos_crtc->ops->dpms) - exynos_crtc->ops->dpms(exynos_crtc, mode); + exynos_crtc->ops->dpms(exynos_crtc, DRM_MODE_DPMS_ON); - exynos_crtc->dpms = mode; + exynos_crtc->enabled = true; - if (mode == DRM_MODE_DPMS_ON) - drm_crtc_vblank_on(crtc); -} + drm_crtc_vblank_on(crtc); -static void exynos_drm_crtc_prepare(struct drm_crtc *crtc) -{ - /* drm framework doesn't check NULL. */ + if (exynos_crtc->ops->win_commit) + exynos_crtc->ops->win_commit(exynos_crtc, exynos_plane->zpos); + + if (exynos_crtc->ops->commit) + exynos_crtc->ops->commit(exynos_crtc); } -static void exynos_drm_crtc_commit(struct drm_crtc *crtc) +static void exynos_drm_crtc_disable(struct drm_crtc *crtc) { struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - struct exynos_drm_plane *exynos_plane = to_exynos_plane(crtc->primary); + struct drm_plane *plane; + int ret; + + if (!exynos_crtc->enabled) + return; - exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_ON); + /* wait for the completion of page flip. */ + if (!wait_event_timeout(exynos_crtc->pending_flip_queue, + (exynos_crtc->event == NULL), HZ/20)) + exynos_crtc->event = NULL; - if (exynos_crtc->ops->win_commit) - exynos_crtc->ops->win_commit(exynos_crtc, exynos_plane->zpos); + drm_crtc_vblank_off(crtc); - if (exynos_
[PATCH] drm: Add integer overflow checking to transitional plane helpers
Add tests for destination rectangle integer overflow before calling the driver's check function. This will ensure that the transitional plane helpers match the behavior of the full atomic helpers by always returning -ERANGE for planes positioned beyond INT_MAX. Note that the legacy SetPlane ioctl itself also includes similar tests for integer overflow, so the only case where this check really matters is when legacy cursor operations get routed through the universal plane interface internally. This issue was first noticed with i915 commit: commit ff42e093e9c9c17a6e1d6aab24875a36795f926e Author: Daniel Vetter Date: Mon Mar 2 16:35:20 2015 +0100 Revert "drm/i915: Switch planes from transitional helpers to full atomic helpers" The above revert switched us from full atomic helpers back to the transitional helpers, and in doing so we lost the overflow checking here for universal cursor updates. Even though such extreme cursor positions are unlikely to actually happen in the wild, we still don't want there to be a change of behavior when drivers switch from transitional helpers to full helpers. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84269 Signed-off-by: Matt Roper --- drivers/gpu/drm/drm_plane_helper.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index 33807e0..1e9e105 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -417,6 +417,20 @@ int drm_plane_helper_commit(struct drm_plane *plane, for (i = 0; i < 2; i++) crtc_funcs[i] = crtc[i] ? crtc[i]->helper_private : NULL; + /* +* Give drivers some help against integer overflows (and match the +* behavior of the full atomic helpers). +*/ + if (plane_state->crtc_w > INT_MAX || + plane_state->crtc_x > INT_MAX - (int32_t) plane_state->crtc_w || + plane_state->crtc_h > INT_MAX || + plane_state->crtc_y > INT_MAX - (int32_t) plane_state->crtc_h) { + DRM_DEBUG_ATOMIC("Invalid CRTC coordinates %ux%u+%d+%d\n", +plane_state->crtc_w, plane_state->crtc_h, +plane_state->crtc_x, plane_state->crtc_y); + return -ERANGE; + } + if (plane_funcs->atomic_check) { ret = plane_funcs->atomic_check(plane, plane_state); if (ret) -- 1.8.5.1
[Bug 89887] AMD 3650 Mobility locks up on overdraw
https://bugs.freedesktop.org/show_bug.cgi?id=89887 --- Comment #1 from Dave Airlie --- can you attach the source code and how to build it? -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/b83fe21c/attachment.html>
[Bug 89887] AMD 3650 Mobility locks up on overdraw
https://bugs.freedesktop.org/show_bug.cgi?id=89887 pavol at klacansky.com changed: What|Removed |Added Attachment #114845|0 |1 is obsolete|| --- Comment #2 from pavol at klacansky.com --- Created attachment 114856 --> https://bugs.freedesktop.org/attachment.cgi?id=114856&action=edit Overdraw application -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/1210ecdf/attachment.html>
[Bug 89887] AMD 3650 Mobility locks up on overdraw
https://bugs.freedesktop.org/show_bug.cgi?id=89887 --- Comment #3 from pavol at klacansky.com --- I have fixed MIME for the overdraw demo. It requires Gtk+ 3.16 and it can be compiled by "clang main.c common/io.c `pkg-config --cflags --libs gtk+-3.0 epoxy`". -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150403/a80b7670/attachment.html>