[Bug 96271] TF2: GPU lockup on HD 7950
https://bugs.freedesktop.org/show_bug.cgi?id=96271 --- Comment #7 from Marek Olšák --- Does the issue go away if you set any of these options? R600_DEBUG=noce,nohyperz -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/5d3fbd39/attachment-0001.html>
[PATCH v2 09/10] drm/imx: atomic phase 3 step 4: Use generic atomic page flip
On Tue, May 31, 2016 at 05:24:30PM +0800, Liu Ying wrote: > To support generic atomic page flip, this patch customizes ->atomic_commit > for nonblock commits. > > Signed-off-by: Liu Ying > --- > v1->v2: > * s/async/nonblock/ on this patch to address Daniel Vetter's comment. > * Wait for pending commit on each CRTC for both block and nonblock > atomic mode settings. This way, a block commit will not overwrite > the hardware setting when a nonblock page flip is about to finish, > so that the page flip may wait for vblank successfully. Ok, my generic nonblocking code seems pretty stable nowadays, please rebase on top of that. Mostly you just have to replace your commit_complete with an atomic_commit_tail that you plug into dev->mode_config.helper_private->atomic_commit_tail. Note that the nonblocking helpers are _very_ picky about your handling of crtc_state->event. If anything times out it's probably because your driver didn't send out that event correctly. But that's just atomic event handling, so really just a driver bug if you hit it. For an example that closely resembles your driver look at rockchip. We're still hunting down some of the event handling issues. -Daniel > > drivers/gpu/drm/imx/imx-drm-core.c | 135 +++- > drivers/gpu/drm/imx/ipuv3-crtc.c | 156 > ++--- > 2 files changed, 142 insertions(+), 149 deletions(-) > > diff --git a/drivers/gpu/drm/imx/imx-drm-core.c > b/drivers/gpu/drm/imx/imx-drm-core.c > index 2a2ab8c..d2bb743 100644 > --- a/drivers/gpu/drm/imx/imx-drm-core.c > +++ b/drivers/gpu/drm/imx/imx-drm-core.c > @@ -15,10 +15,14 @@ > */ > #include > #include > +#include > #include > #include > #include > +#include > +#include > #include > +#include > #include > #include > #include > @@ -48,6 +52,14 @@ struct imx_drm_device { > struct imx_drm_crtc { > struct drm_crtc *crtc; > struct imx_drm_crtc_helper_funcsimx_drm_helper_funcs; > + wait_queue_head_t commit_wait; > + boolcommit_pending; > +}; > + > +struct imx_drm_commit { > + struct work_struct work; > + struct drm_device *dev; > + struct drm_atomic_state *state; > }; > > #if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) > @@ -168,11 +180,130 @@ static void imx_drm_output_poll_changed(struct > drm_device *drm) > drm_fbdev_cma_hotplug_event(imxdrm->fbhelper); > } > > +static void imx_drm_atomic_complete(struct imx_drm_commit *commit) > +{ > + struct drm_device *dev = commit->dev; > + struct imx_drm_device *imxdrm = dev->dev_private; > + struct imx_drm_crtc *imx_crtc; > + struct drm_atomic_state *old_state = commit->state; > + struct drm_crtc *crtc; > + struct drm_crtc_state *old_crtc_state; > + struct drm_plane_state *plane_state; > + struct drm_gem_cma_object *cma_obj; > + struct fence *excl; > + unsigned shared_count; > + struct fence **shared; > + unsigned int i, j; > + int ret; > + > + /* Wait for fences. */ > + for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { > + if (crtc->state->event) { > + plane_state = crtc->primary->state; > + cma_obj = drm_fb_cma_get_gem_obj(plane_state->fb, 0); > + if (cma_obj->base.dma_buf) { > + ret = reservation_object_get_fences_rcu( > + cma_obj->base.dma_buf->resv, &excl, > + &shared_count, &shared); > + if (unlikely(ret)) > + DRM_ERROR("failed to get fences " > + "for buffer\n"); > + > + if (excl) { > + fence_wait(excl, false); > + fence_put(excl); > + } > + for (j = 0; j < shared_count; i++) { > + fence_wait(shared[j], false); > + fence_put(shared[j]); > + } > + } > + } > + } > + > + /* Apply the atomic update. */ > + drm_atomic_helper_commit_modeset_disables(dev, old_state); > + drm_atomic_helper_commit_modeset_enables(dev, old_state); > + drm_atomic_helper_commit_planes(dev, old_state, false); > + drm_atomic_helper_wait_for_vblanks(dev, old_state); > + drm_atomic_helper_cleanup_planes(dev, old_state); > + > + for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { > + imx_crtc = imxdrm->crtc[i]; > + > + /* Complete the commit, wake up any waiter. */ > + spin_lock(&imx_crtc->commit_wait.lock); > + imx_crtc->commit_pending = false; > + wake_up_all_loc
[PATCH 16/26] drm/hdlcd: Use helper support for nonblocking commits
On Tue, May 31, 2016 at 12:02:23PM +0100, Liviu Dudau wrote: > On Sun, May 29, 2016 at 08:35:13PM +0200, Daniel Vetter wrote: > > Again, just doing them as blocking commits isn't cool. > > > > From a cursory check hdlcd does seem to at least try to handle > > drm_pending_vblank_event, so hopefully this works. > > > > Cc: Liviu Dudau > > Signed-off-by: Daniel Vetter > > Daniel, > > I have a proper implementation for this, which I will send out shortly, so I > will > NAK this patch. Please don't implement your own atomic nonblocking commit any more. I have a generic solution, which this patch series implements and then also converts hdlcd over to it. I admit the commit message is a bit unclear with that. If you don't want to pick this up from the mailing lists it's also in my fdo git repo: https://cgit.freedesktop.org/~danvet/drm/log/ So nack on your nack ;-) Cheers, Daniel > > Best regards, > Liviu > > > --- > > drivers/gpu/drm/arm/hdlcd_drv.c | 8 +--- > > 1 file changed, 1 insertion(+), 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c > > b/drivers/gpu/drm/arm/hdlcd_drv.c > > index 4f909378d581..6d1877238cf0 100644 > > --- a/drivers/gpu/drm/arm/hdlcd_drv.c > > +++ b/drivers/gpu/drm/arm/hdlcd_drv.c > > @@ -112,17 +112,11 @@ static void hdlcd_fb_output_poll_changed(struct > > drm_device *drm) > > drm_fbdev_cma_hotplug_event(hdlcd->fbdev); > > } > > > > -static int hdlcd_atomic_commit(struct drm_device *dev, > > - struct drm_atomic_state *state, bool nonblock) > > -{ > > - return drm_atomic_helper_commit(dev, state, false); > > -} > > - > > static const struct drm_mode_config_funcs hdlcd_mode_config_funcs = { > > .fb_create = drm_fb_cma_create, > > .output_poll_changed = hdlcd_fb_output_poll_changed, > > .atomic_check = drm_atomic_helper_check, > > - .atomic_commit = hdlcd_atomic_commit, > > + .atomic_commit = drm_atomic_helper_commit, > > }; > > > > static void hdlcd_setup_mode_config(struct drm_device *drm) > > -- > > 2.8.1 > > > > -- > > | I would like to | > | fix the world, | > | but they're not | > | giving me the | > \ source code! / > --- > ¯\_(ã)_/¯ -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH v6 2/2] vga_switcheroo: Support deferred probing of audio clients
On Tue, May 31, 2016 at 11:13:27AM +0200, Lukas Wunner wrote: > Daniel Vetter pointed out that vga_switcheroo_client_probe_defer() could > be needed by audio clients as well. To avoid mistakes when someone adds > conditions for these in the future, constrain the single existing > condition to VGA clients by checking for PCI_BASE_CLASS_DISPLAY. This > encompasses both PCI_CLASS_DISPLAY_VGA as well as PCI_CLASS_DISPLAY_3D, > which is used by some Nvidia Optimus GPUs. > > Any future checks for audio clients should then be constrained to > PCI_BASE_CLASS_MULTIMEDIA. > > v6: Spun out from commit introducing vga_switcheroo_client_probe_defer() > to keep it a pure refactoring change. (Emil Velikov, Jani Nikula) > > Cc: Daniel Vetter > Cc: Emil Velikov > Cc: Jani Nikula > Signed-off-by: Lukas Wunner Both applied to drm-misc. -Daniel > --- > drivers/gpu/vga/vga_switcheroo.c | 19 +++ > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/vga/vga_switcheroo.c > b/drivers/gpu/vga/vga_switcheroo.c > index d349bf9..2df216b3 100644 > --- a/drivers/gpu/vga/vga_switcheroo.c > +++ b/drivers/gpu/vga/vga_switcheroo.c > @@ -331,7 +331,8 @@ EXPORT_SYMBOL(vga_switcheroo_register_client); > * @id: client identifier > * > * Register audio client (audio device on a GPU). The power state of the > - * client is assumed to be ON. > + * client is assumed to be ON. Beforehand, > vga_switcheroo_client_probe_defer() > + * shall be called to ensure that all prerequisites are met. > * > * Return: 0 on success, -ENOMEM on memory allocation error. > */ > @@ -390,13 +391,15 @@ find_active_client(struct list_head *head) > */ > bool vga_switcheroo_client_probe_defer(struct pci_dev *pdev) > { > - /* > - * apple-gmux is needed on pre-retina MacBook Pro > - * to probe the panel if pdev is the inactive GPU. > - */ > - if (apple_gmux_present() && pdev != vga_default_device() && > - !vgasr_priv.handler_flags) > - return true; > + if ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) { > + /* > + * apple-gmux is needed on pre-retina MacBook Pro > + * to probe the panel if pdev is the inactive GPU. > + */ > + if (apple_gmux_present() && pdev != vga_default_device() && > + !vgasr_priv.handler_flags) > + return true; > + } > > return false; > } > -- > 2.8.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH] drm: hdlcd: Replace the mode config's atomic_commit with the proper implementation.
On Tue, May 31, 2016 at 12:03:04PM +0100, Liviu Dudau wrote: > The HDLCD atomic_commit code was mis-using the drm_atomic_helper_commit() > function to implement the non-blocking code. Replace that with the correct > implementation that does the async queue-ing of commits. > > Signed-off-by: Liviu Dudau Please don't roll your own atomic nonblocking commit any more, but instead use the generic one I'm working on: https://cgit.freedesktop.org/~danvet/drm/log/ Review and testing very much appreciated (the patches are on the m-l, too). Cheers, Daniel > --- > drivers/gpu/drm/arm/hdlcd_crtc.c | 64 +++- > drivers/gpu/drm/arm/hdlcd_drv.c | 90 > > drivers/gpu/drm/arm/hdlcd_drv.h | 3 +- > 3 files changed, 109 insertions(+), 48 deletions(-) > > diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c > b/drivers/gpu/drm/arm/hdlcd_crtc.c > index d1e8d31..523890d 100644 > --- a/drivers/gpu/drm/arm/hdlcd_crtc.c > +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c > @@ -106,7 +106,7 @@ static void hdlcd_crtc_mode_set_nofb(struct drm_crtc > *crtc) > struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); > struct drm_display_mode *m = &crtc->state->adjusted_mode; > struct videomode vm; > - unsigned int polarities, line_length, err; > + unsigned int polarities, err; > > vm.vfront_porch = m->crtc_vsync_start - m->crtc_vdisplay; > vm.vback_porch = m->crtc_vtotal - m->crtc_vsync_end; > @@ -122,23 +122,18 @@ static void hdlcd_crtc_mode_set_nofb(struct drm_crtc > *crtc) > if (m->flags & DRM_MODE_FLAG_PVSYNC) > polarities |= HDLCD_POLARITY_VSYNC; > > - line_length = crtc->primary->state->fb->pitches[0]; > - > /* Allow max number of outstanding requests and largest burst size */ > hdlcd_write(hdlcd, HDLCD_REG_BUS_OPTIONS, > HDLCD_BUS_MAX_OUTSTAND | HDLCD_BUS_BURST_16); > > - hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, line_length); > - hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_PITCH, line_length); > - hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_COUNT, m->crtc_vdisplay - 1); > hdlcd_write(hdlcd, HDLCD_REG_V_DATA, m->crtc_vdisplay - 1); > hdlcd_write(hdlcd, HDLCD_REG_V_BACK_PORCH, vm.vback_porch - 1); > hdlcd_write(hdlcd, HDLCD_REG_V_FRONT_PORCH, vm.vfront_porch - 1); > hdlcd_write(hdlcd, HDLCD_REG_V_SYNC, vm.vsync_len - 1); > + hdlcd_write(hdlcd, HDLCD_REG_H_DATA, m->crtc_hdisplay - 1); > hdlcd_write(hdlcd, HDLCD_REG_H_BACK_PORCH, vm.hback_porch - 1); > hdlcd_write(hdlcd, HDLCD_REG_H_FRONT_PORCH, vm.hfront_porch - 1); > hdlcd_write(hdlcd, HDLCD_REG_H_SYNC, vm.hsync_len - 1); > - hdlcd_write(hdlcd, HDLCD_REG_H_DATA, m->crtc_hdisplay - 1); > hdlcd_write(hdlcd, HDLCD_REG_POLARITIES, polarities); > > err = hdlcd_set_pxl_fmt(crtc); > @@ -153,20 +148,19 @@ static void hdlcd_crtc_enable(struct drm_crtc *crtc) > struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); > > clk_prepare_enable(hdlcd->clk); > + hdlcd_crtc_mode_set_nofb(crtc); > hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 1); > - drm_crtc_vblank_on(crtc); > } > > static void hdlcd_crtc_disable(struct drm_crtc *crtc) > { > struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); > > - if (!crtc->primary->fb) > + if (!crtc->state->active) > return; > > hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0); > clk_disable_unprepare(hdlcd->clk); > - drm_crtc_vblank_off(crtc); > } > > static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc, > @@ -208,6 +202,21 @@ static void hdlcd_crtc_atomic_begin(struct drm_crtc > *crtc, > static void hdlcd_crtc_atomic_flush(struct drm_crtc *crtc, > struct drm_crtc_state *state) > { > + struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); > + struct drm_device *drm = crtc->dev; > + unsigned long flags; > + struct drm_pending_vblank_event *e; > + > + spin_lock_irqsave(&drm->event_lock, flags); > + e = list_first_entry_or_null(&hdlcd->event_list, typeof(*e), base.link); > + > + if (e) { > + list_del(&e->base.link); > + drm_crtc_send_vblank_event(&hdlcd->crtc, e); > + drm_crtc_vblank_put(&hdlcd->crtc); > + } > + > + spin_unlock_irqrestore(&drm->event_lock, flags); > } > > static bool hdlcd_crtc_mode_fixup(struct drm_crtc *crtc, > @@ -219,13 +228,8 @@ static bool hdlcd_crtc_mode_fixup(struct drm_crtc *crtc, > > static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { > .mode_fixup = hdlcd_crtc_mode_fixup, > - .mode_set = drm_helper_crtc_mode_set, > - .mode_set_base = drm_helper_crtc_mode_set_base, > - .mode_set_nofb = hdlcd_crtc_mode_set_nofb, > .enable = hdlcd_crtc_enable, > .disable= hdlcd_crtc_disable, > - .prepare= hdlcd_crtc_disable, > - .commit
[Nouveau] [PATCH 1/9] drm/nouveau: Don't leak runtime pm ref on driver unload
On Mon, May 30, 2016 at 07:03:46PM +0200, Peter Wu wrote: > On Sun, May 29, 2016 at 05:50:06PM +0200, Lukas Wunner wrote: > > How exactly did you reach the situation where the root port didn't wake > > up when you tried to load nouveau again? (IRC conversation this week.) > > Ensure that the pci/pm patches are applied, then: > > 0. Unload nouveau (I have blacklisted it for testing). > 1. Enable rpm for the root port and children (control = auto). > 2. Verify in the kernel logs that the devices are sleeping: > pcieport :00:01.0: power state changed by ACPI to D3cold > 3. (Optional, to rule out issues with delays:) Disable rpm for the > Nvidia device (control = on). > 4. modprobe nouveau. > > The above test with v4.6 + 4 pci/pm patches (8b71f565) gives: > > 50.245795 MXM: GUID detected in BIOS > 50.245948nseval-0227 ns_evaluate : Execute method > [\_SB.PCI0.GFX0._DSM] at AML address c9013b11 length 492 > 50.246016 ACPI Warning: \_SB.PCI0.GFX0._DSM: Argument #4 type mismatch - > Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95) > 50.246044nseval-0227 ns_evaluate : Execute method > [\_SB.PCI0.GFX0._DSM] at AML address c9013b11 length 492 > 50.246110nseval-0227 ns_evaluate : Execute method > [\_SB.PCI0.PEG0.PEGP._DSM] at AML address c9018297 length 1F > 50.246256 ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type > mismatch - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95) > 50.246289nseval-0227 ns_evaluate : Execute method > [\_SB.PCI0.PEG0.PEGP._DSM] at AML address c9018297 length 1F > 50.246443 ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type > mismatch - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95) > 50.246457nseval-0227 ns_evaluate : Execute method > [\_SB.PCI0.PEG0.PEGP._DSM] at AML address c9018297 length 1F > 50.246932 pci :01:00.0: optimus capabilities: enabled, status dynamic > power, hda bios codec supported > 50.247005 VGA switcheroo: detected Optimus DSM method > \_SB_.PCI0.PEG0.PEGP handle > 50.247084nseval-0227 ns_evaluate : Execute method > [\_SB.PCI0.PEG0.PG00._ON] at AML address c901086e length 11D > 50.390140 pcieport :00:01.0: power state changed by ACPI to D0 > 50.491893nseval-0227 ns_evaluate : Execute method > [\_SB.PCI0.PEG0._DSW] at AML address c9010a2d length 1D > 50.492285 pcieport :00:01.0: PME# disabled > 50.492583 nouveau :01:00.0: unknown chipset () > 50.492687 nouveau: probe of :01:00.0 failed with error -12 I've tested this on a MacBook Pro, which does not have ACPI _PR3 methods for the root port to which the discrete GPU is attached. The port can thus only suspend to D3hot, not D3cold. Even without patch [2/9], when unloading nouveau and letting the root port go to D3hot, the port is subsequently correctly resumed to D0 when reloading nouveau. So the issue that you're seeing without patch [2/9] seems to be specific to Optimus/_PR3 machines. If possible you should try to get it working without patch [2/9] because that patch is really optional (as I've written in the commit message). I'm totally unfamiliar with Optimus but maybe lspci could help to debug this? Lukas
[PATCHv2 0/4] drm: fix two atomic modesetting issues on v4.7-rc1
These fix two atomic modesetting issues on v4.7-rc1. The last one is a bit of an RFC. Changes to v1: - drop unnecessary cleanups from "drm: make drm_atomic_set_mode_prop_for_crtc() more reliable". - Cc stable where appropriate - Add "Fixes:" to "drm: fix fb refcount issue with atomic modesetting" Tomi Tomi Valkeinen (4): drm: add missing drm_mode_set_crtcinfo call drm/sti: remove extra mode fixup drm: make drm_atomic_set_mode_prop_for_crtc() more reliable drm: fix fb refcount issue with atomic modesetting drivers/gpu/drm/drm_atomic.c | 3 ++- drivers/gpu/drm/drm_crtc.c | 5 ++--- drivers/gpu/drm/drm_modes.c| 2 ++ drivers/gpu/drm/sti/sti_crtc.c | 10 -- 4 files changed, 6 insertions(+), 14 deletions(-) -- 2.5.0
[PATCHv2 1/4] drm: add missing drm_mode_set_crtcinfo call
When setting mode via MODE_ID property, drm_atomic_set_mode_prop_for_crtc() does not call drm_mode_set_crtcinfo() which possibly causes: "[drm:drm_calc_timestamping_constants [drm]] *ERROR* crtc 32: Can't calculate constants, dotclock = 0!" Whether the error is seen depends on the previous data in state->mode, as state->mode is not cleared when setting new mode. This patch adds drm_mode_set_crtcinfo() call to drm_mode_convert_umode(), which is called in both legacy and atomic paths. This should be fine as there's no reason to call drm_mode_convert_umode() without also setting the crtc related fields. drm_mode_set_crtcinfo() is removed from the legacy drm_mode_setcrtc() as that is no longer needed. Signed-off-by: Tomi Valkeinen Reviewed-by: Daniel Vetter Cc: stable at vger.kernel.org --- drivers/gpu/drm/drm_crtc.c | 2 -- drivers/gpu/drm/drm_modes.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index d2a6d958ca76..06b6e2173697 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2821,8 +2821,6 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, goto out; } - drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); - /* * Check whether the primary plane supports the fb pixel format. * Drivers not implementing the universal planes API use a diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 7def3d58da18..e5e6f504d8cc 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -1518,6 +1518,8 @@ int drm_mode_convert_umode(struct drm_display_mode *out, if (out->status != MODE_OK) goto out; + drm_mode_set_crtcinfo(out, CRTC_INTERLACE_HALVE_V); + ret = 0; out: -- 2.5.0
[PATCHv2 2/4] drm/sti: remove extra mode fixup
Commit 652353e6e561c2aeeac62df183f721f6f9b5b45f ("drm/sti: set CRTC modesetting parameters") added a hack to avoid warnings related to setting mode with atomic API. With the previous patch, the hack should no longer be necessary. Signed-off-by: Tomi Valkeinen Cc: Benjamin Gaignard Cc: Vincent Abriou Reviewed-by: Daniel Vetter --- drivers/gpu/drm/sti/sti_crtc.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_crtc.c b/drivers/gpu/drm/sti/sti_crtc.c index 505620c7c2c8..e04deedabd4a 100644 --- a/drivers/gpu/drm/sti/sti_crtc.c +++ b/drivers/gpu/drm/sti/sti_crtc.c @@ -51,15 +51,6 @@ static void sti_crtc_disabling(struct drm_crtc *crtc) mixer->status = STI_MIXER_DISABLING; } -static bool sti_crtc_mode_fixup(struct drm_crtc *crtc, - const struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) -{ - /* accept the provided drm_display_mode, do not fix it up */ - drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V); - return true; -} - static int sti_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode) { @@ -230,7 +221,6 @@ static void sti_crtc_atomic_flush(struct drm_crtc *crtc, static const struct drm_crtc_helper_funcs sti_crtc_helper_funcs = { .enable = sti_crtc_enable, .disable = sti_crtc_disabling, - .mode_fixup = sti_crtc_mode_fixup, .mode_set = drm_helper_crtc_mode_set, .mode_set_nofb = sti_crtc_mode_set_nofb, .mode_set_base = drm_helper_crtc_mode_set_base, -- 2.5.0
[PATCHv2 3/4] drm: make drm_atomic_set_mode_prop_for_crtc() more reliable
drm_atomic_set_mode_prop_for_crtc() does not clear the state->mode, so old data may be left there when a new mode is set, possibly causing odd issues. This patch improves the situation by always clearing the state->mode first. Signed-off-by: Tomi Valkeinen Cc: stable at vger.kernel.org --- drivers/gpu/drm/drm_atomic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 3ff1ed7b33db..c204ef32df16 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -351,6 +351,8 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state, drm_property_unreference_blob(state->mode_blob); state->mode_blob = NULL; + memset(&state->mode, 0, sizeof(state->mode)); + if (blob) { if (blob->length != sizeof(struct drm_mode_modeinfo) || drm_mode_convert_umode(&state->mode, @@ -363,7 +365,6 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state, DRM_DEBUG_ATOMIC("Set [MODE:%s] for CRTC state %p\n", state->mode.name, state); } else { - memset(&state->mode, 0, sizeof(state->mode)); state->enable = false; DRM_DEBUG_ATOMIC("Set [NOMODE] for CRTC state %p\n", state); -- 2.5.0
[PATCHv2 4/4] drm: fix fb refcount issue with atomic modesetting
After commit 027b3f8ba9277410c3191d72d1ed2c6146d8a668 ("drm/modes: stop handling framebuffer special") extra fb refs are left around when doing atomic modesetting. The problem is that the new drm_property_change_valid_get() does not return anything in the '**ref' parameter, which causes drm_property_change_valid_put() to do nothing. For some reason this doesn't cause problems with legacy API. Also, previously the code only set the 'ref' variable for fbs, with this patch the 'ref' is set for all objects. Fixes: 027b3f8ba927 ("drm/modes: stop handling framebuffer special") Signed-off-by: Tomi Valkeinen Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 06b6e2173697..0e3cc66aa8b7 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -4839,7 +4839,8 @@ bool drm_property_change_valid_get(struct drm_property *property, if (value == 0) return true; - return _object_find(property->dev, value, property->values[0]) != NULL; + *ref = _object_find(property->dev, value, property->values[0]); + return *ref != NULL; } for (i = 0; i < property->num_values; i++) -- 2.5.0
[Nouveau] [PATCH 4/4] drm/nouveau/acpi: fix lockup with PCIe runtime PM
On Mon, May 30, 2016 at 06:13:51PM +0200, Peter Wu wrote: > Do you have any suggestions for the case where the pcieport driver > refuses to put the bridge in D3 (because the BIOS is too old)? In that > case the nouveau driver needs to fallback to the DSM method (but not > when runtime PM is deliberately disabled by writing control=on). The BIOS cut-off date is meant to avoid issues when suspending ports on older chipsets. However if the port is used for an Optimus GPU and we can clearly identify that, and there's a _PR3 method provided, it's probably safe to say that the port is *intended* to be suspended. So you may want to consider amending pci_bridge_d3_possible() to allow D3 for such ports regardless of the BIOS date, as I've done for Thunderbolt in this commit: https://github.com/l1k/linux/commit/3cb8549cd4e5 Not sure how to uniquely identify such ports though. Perhaps check if there's a device in slot 0 below the port which has (pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY && (pdev->vendor == PCI_VENDOR_ID_NVIDIA || pdev->vendor == PCI_VENDOR_ID_ATI) Best regards, Lukas
[PATCH 07/26] drm/exynos: Use for_each_crtc_in_state
2016-05-30 3:35 GMT+09:00 Daniel Vetter : > We want to hide drm_atomic_state internals better. > Acked-by: Inki Dae > Cc: Inki Dae > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/exynos/exynos_drm_drv.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c > b/drivers/gpu/drm/exynos/exynos_drm_drv.c > index 2dd820e23b0c..cabc5fd0246d 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c > @@ -267,6 +267,8 @@ int exynos_atomic_commit(struct drm_device *dev, struct > drm_atomic_state *state, > { > struct exynos_drm_private *priv = dev->dev_private; > struct exynos_atomic_commit *commit; > + struct drm_crtc *crtc; > + struct drm_crtc_state *crtc_state; > int i, ret; > > commit = kzalloc(sizeof(*commit), GFP_KERNEL); > @@ -288,10 +290,8 @@ int exynos_atomic_commit(struct drm_device *dev, struct > drm_atomic_state *state, > /* Wait until all affected CRTCs have completed previous commits and > * mark them as pending. > */ > - for (i = 0; i < dev->mode_config.num_crtc; ++i) { > - if (state->crtcs[i]) > - commit->crtcs |= 1 << drm_crtc_index(state->crtcs[i]); > - } > + for_each_crtc_in_state(state, crtc, crtc_state, i) > + commit->crtcs |= 1 << drm_crtc_index(crtc); > > wait_event(priv->wait, !commit_is_pending(priv, commit->crtcs)); > > -- > 2.8.1 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Intel-gfx] [PATCH 12/26] drm/atomic-helper: Massage swap_state signature somewhat
Op 31-05-16 om 12:46 schreef Daniel Vetter: > On Tue, May 31, 2016 at 10:43:56AM +0200, Maarten Lankhorst wrote: >> Op 30-05-16 om 17:09 schreef Daniel Vetter: >>> On Mon, May 30, 2016 at 03:08:39PM +0200, Maarten Lankhorst wrote: Op 29-05-16 om 20:35 schreef Daniel Vetter: > - dev is redundant, we have state->atomic > - add stall parameter, which must be set when swapping needs to stall > for preceeding commits to stop looking at ->state pointers. Currently > all drivers need this to be, just prep work for a glorious future. I have to disagree, if you want to stall it should be done in a separate helper before swapping state. That function should also have the ability to fail, since we haven't called swap_state yet. :) Maybe with nonblock as parameter, so it could fail with -EBUSY if it would stall, and -EINTR if interrupted? >>> This is not the stalling you're thinking of. The EBUSY check is in >>> drm_atomic_helper_setup_commit (and as such entirely optional). >>> >>> And if you don't ever use the nonblocking helpers, no struct >>> drm_crtc_commit will ever show up in crtc->commit_list, which means this >>> here also doesn't do anything. >>> >>> This stall here is just to make sure that the previous commit doesn't get >>> confused because we've ripped out crtc/plane/connector->state from >>> underneath it. And as soon as we add previous_state pointers to >>> drm_atomic_state and wire it up through all the hooks we can set >>> stall=false here, since then pipelining with a queue depth > 1 is >>> possible. >> If a driver supports depth > 1 it could skip the extra help waiter and just >> call swap_state. >> The helper should return -EINTR when needed. >> >> if (nonblock) { >> ret = drm_atomic_helper_wait_for_completion(state); >> if (ret) >> return ret; >> } >> >> drm_atomic_helper_swap_state.. > That's why there's this stall parameter ... Also, > wait_for_completion(state) is not enough, there's 3 different completions. Yeah but this is pseudocode. I don't think waiting belongs to swap_state, should be done before so we can still back out if wait fails.. ~Maarten
[GIT PULL] omapdrm fixes for 4.7
Hi Dave, So my omapdrm pull request for 4.7 was much too late and missed 4.7 merge (sorry about that). I've picked the fixes from that pull request here. Tomi The following changes since commit 1a695a905c18548062509178b98bc91e67510864: Linux 4.7-rc1 (2016-05-29 09:29:24 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git tags/omapdrm-4.7-fixes for you to fetch changes up to d0196c8d5d3057c5c21a82f3d0113ca8e501033b: drm/omap: include gpio/consumer.h where needed (2016-05-31 08:30:14 +0300) omapdrm fixes for 4.7 * multiple compile break fixes for missing includes, bad kconfig dependencies. * remove regulator API misuse causing deprecation warnings * OMAP5 HDMI fixes for DDC and AVI infoframe * OMAP4 HDMI fix for CEC Arnd Bergmann (3): drm/omapdrm: include pinctrl/consumer.h where needed drm/omap: include linux/seq_file.h where needed drm/omap: include gpio/consumer.h where needed Jim Lodes (2): OMAPDSS: HDMI5: Fix AVI infoframe OMAPDSS: HDMI5: Change DDC timings Peter Ujfalusi (2): drm/omap: Remove regulator API abuse Revert "drm/omap: no need to select OMAP2_DSS" Tomi Valkeinen (2): drm/omap: Fix missing includes drm/omap: fix OMAP4 hdmi_core_powerdown_disable() drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 1 + drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 2 +- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-dpi.c| 2 +- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 1 + drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 2 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 9 - drivers/gpu/drm/omapdrm/dss/dss.c | 1 + drivers/gpu/drm/omapdrm/dss/hdmi4.c | 10 +- drivers/gpu/drm/omapdrm/dss/hdmi4_core.c| 2 +- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 10 +- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c| 6 +++--- drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 1 + drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 1 + drivers/gpu/drm/omapdrm/dss/hdmi_wp.c | 1 + drivers/gpu/drm/omapdrm/omap_debugfs.c | 2 ++ drivers/gpu/drm/omapdrm/omap_dmm_tiler.c| 1 + drivers/gpu/drm/omapdrm/omap_fb.c | 2 ++ drivers/gpu/drm/omapdrm/omap_gem.c | 1 + drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c | 6 +++--- 25 files changed, 30 insertions(+), 42 deletions(-) -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/3cc648f7/attachment.sig>
[PATCH 4/5] add cursor hotspot to drm_framebuffer
On Tue, May 31, 2016 at 12:53:12PM +0200, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann > --- > drivers/gpu/drm/drm_crtc.c | 2 ++ > include/drm/drm_crtc.h | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > index d2a6d95..ce5a280 100644 > --- a/drivers/gpu/drm/drm_crtc.c > +++ b/drivers/gpu/drm/drm_crtc.c > @@ -2977,6 +2977,8 @@ static int drm_mode_cursor_universal(struct drm_crtc > *crtc, > DRM_DEBUG_KMS("failed to wrap cursor buffer in > drm framebuffer\n"); > return PTR_ERR(fb); > } > + fb->hot_x = req->hot_x; > + fb->hot_y = req->hot_y; > } else { > fb = NULL; > } > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > index d1559cd..1460f66 100644 > --- a/include/drm/drm_crtc.h > +++ b/include/drm/drm_crtc.h > @@ -253,6 +253,8 @@ struct drm_framebuffer { > int bits_per_pixel; > int flags; > uint32_t pixel_format; /* fourcc format */ > + int hot_x; > + int hot_y; > struct list_head filp_head; > }; Why store it in the fb and not eg. the plane state? > > -- > 1.8.3.1 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrjälä Intel OTC
[PATCH] virtio-gpu: use src not crtc
Pick up the correct source rectangle from framebuffer. Without this multihead setups are not working correctly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index b7778a7..925ca25 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -85,27 +85,32 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, if (bo->dumb) { virtio_gpu_cmd_transfer_to_host_2d (vgdev, handle, 0, -cpu_to_le32(plane->state->crtc_w), -cpu_to_le32(plane->state->crtc_h), -plane->state->crtc_x, plane->state->crtc_y, NULL); +cpu_to_le32(plane->state->src_w >> 16), +cpu_to_le32(plane->state->src_h >> 16), +plane->state->src_x >> 16, +plane->state->src_y >> 16, NULL); } } else { handle = 0; } - DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d\n", handle, + DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n", handle, plane->state->crtc_w, plane->state->crtc_h, - plane->state->crtc_x, plane->state->crtc_y); + plane->state->crtc_x, plane->state->crtc_y, + plane->state->src_w >> 16, + plane->state->src_h >> 16, + plane->state->src_x >> 16, + plane->state->src_y >> 16); virtio_gpu_cmd_set_scanout(vgdev, output->index, handle, - plane->state->crtc_w, - plane->state->crtc_h, - plane->state->crtc_x, - plane->state->crtc_y); + plane->state->src_w >> 16, + plane->state->src_h >> 16, + plane->state->src_x >> 16, + plane->state->src_y >> 16); virtio_gpu_cmd_resource_flush(vgdev, handle, - plane->state->crtc_x, - plane->state->crtc_y, - plane->state->crtc_w, - plane->state->crtc_h); + plane->state->src_x >> 16, + plane->state->src_y >> 16, + plane->state->src_w >> 16, + plane->state->src_h >> 16); } static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, -- 1.8.3.1
[RFC 00/21] Renesas r8a7795/Salvator-X HDMI output prototype
On Mon, May 30, 2016 at 5:59 PM, Ulrich Hecht wrote: > Hi! > > This is a prototype of HDMI output support for the Renesas r8a7795 SoC and > Salvator-X board. It is based on the renesas-devel-20160516-v4.6 tree and Actually, it is based on renesas-drivers-2016-05-17- v4.6, sorry for the confusion. CU Uli
[PATCH 4/4] drm/nouveau/acpi: fix lockup with PCIe runtime PM
On Mon, May 30, 2016 at 06:13:51PM +0200, Peter Wu wrote: > Do you have any suggestions for the case where the pcieport driver > refuses to put the bridge in D3 (because the BIOS is too old)? In that > case the nouveau driver needs to fallback to the DSM method (but not > when runtime PM is deliberately disabled by writing control=on). Do you know what Windows does then? I think we should do the same if possible. If user has disabled runtime PM from the root port deliberately, there might be good reason to do so. Why we want to fallback to something that could cause problems? I mean _DSM on such systems is probably not that much tested because everybody runs Windows 8+ and using standard ACPI power resources.
[Nouveau] [PATCH 1/9] drm/nouveau: Don't leak runtime pm ref on driver unload
On Tue, May 31, 2016 at 01:34:43PM +0200, Lukas Wunner wrote: > On Mon, May 30, 2016 at 07:03:46PM +0200, Peter Wu wrote: > > On Sun, May 29, 2016 at 05:50:06PM +0200, Lukas Wunner wrote: > > > How exactly did you reach the situation where the root port didn't wake > > > up when you tried to load nouveau again? (IRC conversation this week.) > > > > Ensure that the pci/pm patches are applied, then: > > > > 0. Unload nouveau (I have blacklisted it for testing). > > 1. Enable rpm for the root port and children (control = auto). > > 2. Verify in the kernel logs that the devices are sleeping: > > pcieport :00:01.0: power state changed by ACPI to D3cold > > 3. (Optional, to rule out issues with delays:) Disable rpm for the > > Nvidia device (control = on). > > 4. modprobe nouveau. > > > > The above test with v4.6 + 4 pci/pm patches (8b71f565) gives: > > > > 50.245795 MXM: GUID detected in BIOS > > 50.245948nseval-0227 ns_evaluate : Execute method > > [\_SB.PCI0.GFX0._DSM] at AML address c9013b11 length 492 > > 50.246016 ACPI Warning: \_SB.PCI0.GFX0._DSM: Argument #4 type mismatch > > - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95) > > 50.246044nseval-0227 ns_evaluate : Execute method > > [\_SB.PCI0.GFX0._DSM] at AML address c9013b11 length 492 > > 50.246110nseval-0227 ns_evaluate : Execute method > > [\_SB.PCI0.PEG0.PEGP._DSM] at AML address c9018297 length 1F > > 50.246256 ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type > > mismatch - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95) > > 50.246289nseval-0227 ns_evaluate : Execute method > > [\_SB.PCI0.PEG0.PEGP._DSM] at AML address c9018297 length 1F > > 50.246443 ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type > > mismatch - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95) > > 50.246457nseval-0227 ns_evaluate : Execute method > > [\_SB.PCI0.PEG0.PEGP._DSM] at AML address c9018297 length 1F > > 50.246932 pci :01:00.0: optimus capabilities: enabled, status > > dynamic power, hda bios codec supported > > 50.247005 VGA switcheroo: detected Optimus DSM method > > \_SB_.PCI0.PEG0.PEGP handle > > 50.247084nseval-0227 ns_evaluate : Execute method > > [\_SB.PCI0.PEG0.PG00._ON] at AML address c901086e length 11D > > 50.390140 pcieport :00:01.0: power state changed by ACPI to D0 > > 50.491893nseval-0227 ns_evaluate : Execute method > > [\_SB.PCI0.PEG0._DSW] at AML address c9010a2d length 1D > > 50.492285 pcieport :00:01.0: PME# disabled > > 50.492583 nouveau :01:00.0: unknown chipset () > > 50.492687 nouveau: probe of :01:00.0 failed with error -12 > > I've tested this on a MacBook Pro, which does not have ACPI _PR3 > methods for the root port to which the discrete GPU is attached. > The port can thus only suspend to D3hot, not D3cold. > > Even without patch [2/9], when unloading nouveau and letting the > root port go to D3hot, the port is subsequently correctly resumed > to D0 when reloading nouveau. > > So the issue that you're seeing without patch [2/9] seems to be > specific to Optimus/_PR3 machines. If possible you should try to > get it working without patch [2/9] because that patch is really > optional (as I've written in the commit message). I'm totally > unfamiliar with Optimus but maybe lspci could help to debug this? Without 2/9 I can prevent the issue by writing "on" to /sys/bus/pci/devices/:00:01.0/power/control (the PCIe port), but that effectively gives the same result as applying 2/9. The problem occurs when the power is lost (by putting the PCIe port in D3cold). Maybe it is a bug in the PCI core that does not re-initialize devices under the port, but since a workaround is available (2/9), I will focus on other issues first. Maybe it is worth to mention this issue in the commit message for 2/9 though. -- Kind regards, Peter Wu https://lekensteyn.nl
[PATCH 4/4] drm/nouveau/acpi: fix lockup with PCIe runtime PM
On Tue, May 31, 2016 at 11:43:56AM +0300, Mika Westerberg wrote: > On Mon, May 30, 2016 at 06:13:51PM +0200, Peter Wu wrote: > > Do you have any suggestions for the case where the pcieport driver > > refuses to put the bridge in D3 (because the BIOS is too old)? In that > > case the nouveau driver needs to fallback to the DSM method (but not > > when runtime PM is deliberately disabled by writing control=on). > > Do you know what Windows does then? I think we should do the same if > possible. If the BIOS is too old, then it probably does not have _PR3 objects nor calls to _OSI("Windows 2013"). See below. > If user has disabled runtime PM from the root port deliberately, there > might be good reason to do so. Why we want to fallback to something that > could cause problems? I mean _DSM on such systems is probably not that > much tested because everybody runs Windows 8+ and using standard ACPI > power resources. I agree that when runtime PM on the root port is disabled (control=on), then there should be no fallback to DSM. For devices without _PR3 it is clear that DSM will always be used (if available). In other cases (where _PR3 is available) we can distinguish: - pre-Windows 8 machines. I have never seen this combination. Firmware writers seems to prefer sticking to reference code which did not use power resources before. - Machines targeting Windows 8 or newer. (Note that there exist machines with Windows 8 support that do not have _PR3, DSM is used in that case.) If Windows 7 is running on a Windows 8 machine, PR3 will not be used anyway. If the Linux kernel claims support for Windows 8, but does not use PR3, then we are probably approaching an untested area. So far firmware seems fine with using *only* DSM *or* PR3, but at least my laptop gets confused when you use both at the same time. The latter happens on pci/pm (8b71f565) without other patches: 1. nouveau invokes _DSM and _PS3, device is put in D3cold. 2. pcieport driver calls PG00._OFF (PG00 is returned by _PR3). 3. Wake up Nvidia device (e.g. by power=on). 4. This will trigger PG00._ON (via pcieport) and _PS0 (via nouveau). 5. Nvidia card is not really ready (observed via "restoring config space at offset ... (was 0x, writing ...)", a soft lockup and RCU stall after that requiring a reboot to recover). nouveau could be patched not to invoke DSM when PR3 is detected (proposal is ready) but will keep the device powered on in these cases: - nouveau is patched, but pci/pm patches are not. - PR3 is supported but due to the cutoff date (2015) it is not used. - Boot option pcie_port_pm=off. - runtime PM is disabled for pcieport (should be fine). There is a wealth of acpidumps on Launchpad bug 752542 (https://bugs.launchpad.net/bugs/752542). Search for example for comments in early 2015 or before, those will likely be machine from 2014 or before. Interesting to see is the _PR3 method of a HP Envy TS 15 (11/20/2014): Method (_PR3, 0, NotSerialized) { If (\_OSI ("Windows 2013")) { Return (Package (0x01) { \NVP3 }) } Else { Return (Package (0x00) {}) } } (Note for self: just checking for the _PR3 handle in the nouveau patch is apparently not sufficient, it must really be evaluated.) Other machines with _PR3: - Dell Inspiron 3543 (11/04/2014), comment 757. - Dell XPS 15 9530 (03/28/2014), comment 711. - Novatech 15.6 NSPIRE Laptop (01/20/2014), comment 695. - Lenovo ThinkPad T440p (10/27/2013), comment 659. There were many models from 2013 without _PR3 method but still checking for _OSI("Windows 2013"). Maybe some heuristics based on _PR3 would be more helpful than just a cutoff date? -- Kind regards, Peter Wu https://lekensteyn.nl
did the drm patch to support Iris(TM) Graphics P555 fell through the cracks? (Was: Re: [Intel-gfx] RFC: libdrm: Support Iris Graphics 540 & 550 (Skylake GT3e))
CCing danvet Thorsten Leemhuis wrote on 28.04.2016 10:37: > Kenneth Graunke wrote on 28.04.2016 03:05: >> On Wednesday, April 27, 2016 9:37:07 AM PDT Thorsten Leemhuis wrote: >>> Thorsten Leemhuis wrote on 26.04.2016 13:41: >>> Forget that patch -- a way better one was submitted weeks ago my Michal >>> already: >>> https://lists.freedesktop.org/archives/intel-gfx/2016-February/087819.html >> It looks like it fell through the cracks. Roland just mentioned this on >> IRC...I've reviewed and pushed the patch to master. I'm also making a >> release. > Many thx. Side note, while at it: I think this linux-drm patch from > MichaŠfell through the cracks, too: > https://lists.freedesktop.org/archives/intel-gfx/2016-February/087855.html Quote from that linux-drm patch """ Used by production device: Intel(R) Iris(TM) Graphics P555 """ A Xeon processor with said gpu is now available afaics: http://ark.intel.com/products/93847/Intel-Xeon-Processor-E3-1558L-v5-8M-Cache-1_90-GHz > Whole story: That libdrm patch you applied contained this line: > +#define PCI_CHIP_SKYLAKE_SRV_GT3 0x192D > This id for the Iris Graphics P555 is also present in Mesa master > i965(¹), but missing in Linux master afaics: > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/drm/i915_pciids.h#n279 > And it's not in drm-intel-next either afaics: > https://cgit.freedesktop.org/drm-intel/tree/include/drm/i915_pciids.h?h=drm-intel-next#n279 That patch (see below) afaics still wasn't applied; and it's not in drm-intel-next-queued either. I'm wondering if there is a reason why it wasn't merged or if it is another oversight :-/ CU, knurd P.S.: FWIW, here is the content from https://lists.freedesktop.org/archives/intel-gfx/2016-February/087855.html : """ Used by production device: Intel(R) Iris(TM) Graphics P555 Signed-off-by: MichaŠWiniarski --- include/drm/i915_pciids.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h index 9094599..9266c2c 100644 --- a/include/drm/i915_pciids.h +++ b/include/drm/i915_pciids.h @@ -281,6 +281,7 @@ INTEL_VGA_DEVICE(0x1926, info), /* ULT GT3 */ \ INTEL_VGA_DEVICE(0x1927, info), /* ULT GT3 */ \ INTEL_VGA_DEVICE(0x192B, info), /* Halo GT3 */ \ + INTEL_VGA_DEVICE(0x192D, info), /* SRV GT3 */ \ INTEL_VGA_DEVICE(0x192A, info) /* SRV GT3 */ #define INTEL_SKL_GT4_IDS(info) \ -- 2.7.1 """
[PATCHv2 3/4] drm: make drm_atomic_set_mode_prop_for_crtc() more reliable
On Tue, May 31, 2016 at 03:03:17PM +0300, Tomi Valkeinen wrote: > drm_atomic_set_mode_prop_for_crtc() does not clear the state->mode, so > old data may be left there when a new mode is set, possibly causing odd > issues. > > This patch improves the situation by always clearing the state->mode > first. > > Signed-off-by: Tomi Valkeinen > Cc: stable at vger.kernel.org Reviewed-by: Daniel Vetter > --- > drivers/gpu/drm/drm_atomic.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c > index 3ff1ed7b33db..c204ef32df16 100644 > --- a/drivers/gpu/drm/drm_atomic.c > +++ b/drivers/gpu/drm/drm_atomic.c > @@ -351,6 +351,8 @@ int drm_atomic_set_mode_prop_for_crtc(struct > drm_crtc_state *state, > drm_property_unreference_blob(state->mode_blob); > state->mode_blob = NULL; > > + memset(&state->mode, 0, sizeof(state->mode)); > + > if (blob) { > if (blob->length != sizeof(struct drm_mode_modeinfo) || > drm_mode_convert_umode(&state->mode, > @@ -363,7 +365,6 @@ int drm_atomic_set_mode_prop_for_crtc(struct > drm_crtc_state *state, > DRM_DEBUG_ATOMIC("Set [MODE:%s] for CRTC state %p\n", >state->mode.name, state); > } else { > - memset(&state->mode, 0, sizeof(state->mode)); > state->enable = false; > DRM_DEBUG_ATOMIC("Set [NOMODE] for CRTC state %p\n", >state); > -- > 2.5.0 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH 01/10] drm: Initialize a linear gamma table by default
Op 30-03-16 om 11:51 schreef Daniel Vetter: > Code stolen from gma500. It would be useful to mention why this is done. :) But even with this patch it seems the legacy gamma in gamma_get is not very reliable. A failed call to gamma_set could leave wrong values in crtc->gamma_store either by calling the ioctl with lut.blue set to NULL, or call gamma_set and interrupt with a signal. For atomic color management get_gamma won't be accurate at all if mixed with new color management. ~Maarten
[PATCH 4/5] add cursor hotspot to drm_framebuffer
On Di, 2016-05-31 at 15:36 +0300, Ville Syrjälä wrote: > Why store it in the fb and not eg. the plane state? Well, drm_plane_state is allocated by drm_atomic_helper_update_plane. When sticking the hotspot into the the plane state we have to add hot_x and hot_y parameters to drm_plane_funcs->update_plane() and cause quite some churn all over the drm tree. Or create a separate code path for cursor updates which uses a special drm_atomic_helper_update_plane version, which doesn't look very attractive too due to code duplication. Sticking it into the drm_framebuffer instead looks like a reasonable alternative. I'm open to better suggestions. cheers, Gerd
[PATCH 02/10] drm/fb-helper: Remove dead code in setcolreg
Op 30-03-16 om 11:51 schreef Daniel Vetter: > DRM fbdev emulation only supports pallete_color with depth == 8, and > truecolor with depth > 8. Handling depth == 16 for palettes is hence > dead code, let's remove it. Hooray, less chance for failure! Reviewed-by: Maarten Lankhorst
[PATCH 05/10] drm/cirrus: Drop redundnant gamma size check
Op 30-03-16 om 11:51 schreef Daniel Vetter: > The core does this for us already. Unfortunately some other drivers do the same. :( various variations of end = min_t(start + size, 256); I'll kill the rest off when killing start parameter and returning int. Reviewed-by: Maarten Lankhorst
[PATCH 16/26] drm/hdlcd: Use helper support for nonblocking commits
On Tue, May 31, 2016 at 01:07:15PM +0200, Daniel Vetter wrote: > On Tue, May 31, 2016 at 12:02:23PM +0100, Liviu Dudau wrote: > > On Sun, May 29, 2016 at 08:35:13PM +0200, Daniel Vetter wrote: > > > Again, just doing them as blocking commits isn't cool. > > > > > > From a cursory check hdlcd does seem to at least try to handle > > > drm_pending_vblank_event, so hopefully this works. > > > > > > Cc: Liviu Dudau > > > Signed-off-by: Daniel Vetter > > > > Daniel, > > > > I have a proper implementation for this, which I will send out shortly, so > > I will > > NAK this patch. > > Please don't implement your own atomic nonblocking commit any more. I have > a generic solution, which this patch series implements and then also > converts hdlcd over to it. I admit the commit message is a bit unclear > with that. > > If you don't want to pick this up from the mailing lists it's also in my > fdo git repo: > > https://cgit.freedesktop.org/~danvet/drm/log/ > > So nack on your nack ;-) OK, in that case: Acked-by: Liviu Dudau Working towards validating your patch series with the HDLCD driver as well. Best regards, Liviu > > Cheers, Daniel > > > > > Best regards, > > Liviu > > > > > --- > > > drivers/gpu/drm/arm/hdlcd_drv.c | 8 +--- > > > 1 file changed, 1 insertion(+), 7 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c > > > b/drivers/gpu/drm/arm/hdlcd_drv.c > > > index 4f909378d581..6d1877238cf0 100644 > > > --- a/drivers/gpu/drm/arm/hdlcd_drv.c > > > +++ b/drivers/gpu/drm/arm/hdlcd_drv.c > > > @@ -112,17 +112,11 @@ static void hdlcd_fb_output_poll_changed(struct > > > drm_device *drm) > > > drm_fbdev_cma_hotplug_event(hdlcd->fbdev); > > > } > > > > > > -static int hdlcd_atomic_commit(struct drm_device *dev, > > > -struct drm_atomic_state *state, bool nonblock) > > > -{ > > > - return drm_atomic_helper_commit(dev, state, false); > > > -} > > > - > > > static const struct drm_mode_config_funcs hdlcd_mode_config_funcs = { > > > .fb_create = drm_fb_cma_create, > > > .output_poll_changed = hdlcd_fb_output_poll_changed, > > > .atomic_check = drm_atomic_helper_check, > > > - .atomic_commit = hdlcd_atomic_commit, > > > + .atomic_commit = drm_atomic_helper_commit, > > > }; > > > > > > static void hdlcd_setup_mode_config(struct drm_device *drm) > > > -- > > > 2.8.1 > > > > > > > -- > > > > | I would like to | > > | fix the world, | > > | but they're not | > > | giving me the | > > \ source code! / > > --- > > ¯\_(ã)_/¯ > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch > -- | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --- ¯\_(ã)_/¯
[PATCH 06/10] drm/msm: Nuke dummy gamma_set/get functions
Op 30-03-16 om 11:51 schreef Daniel Vetter: > Again the fbdev emulation gamma_set/get functions are only needed for > drivers that try to also use 8bpp paletted mode. Which msm doesn't, so > this is dead code. Let's rip it out. > > Cc: Rob Clark > Signed-off-by: Daniel Vetter Reviewed-by: Maarten Lankhorst
[PATCH 09/10] drm/qxl: Don't set a gamma table size
Op 30-03-16 om 11:51 schreef Daniel Vetter: > qxl doesn't have any functions for setting the gamma table, so this is > completely defunct. > > Not nice to lie to userspace, so let's stop! Reviewed-by: Maarten Lankhorst
[PATCH 16/27] drm/vgem: Use lockless gem BO free callback
On Mon, May 30, 2016 at 1:53 PM, Daniel Vetter wrote: > No dev->struct_mutex anywhere to be seen. > > Cc: seanpaul at chromium.org > Signed-off-by: Daniel Vetter Reviewed-by: Sean Paul > --- > drivers/gpu/drm/vgem/vgem_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c > index 341f9be3dde6..1b4cc8b27080 100644 > --- a/drivers/gpu/drm/vgem/vgem_drv.c > +++ b/drivers/gpu/drm/vgem/vgem_drv.c > @@ -235,7 +235,7 @@ static const struct file_operations vgem_driver_fops = { > > static struct drm_driver vgem_driver = { > .driver_features= DRIVER_GEM, > - .gem_free_object= vgem_gem_free_object, > + .gem_free_object_unlocked = vgem_gem_free_object, > .gem_vm_ops = &vgem_gem_vm_ops, > .ioctls = vgem_ioctls, > .fops = &vgem_driver_fops, > -- > 2.8.1 >
[PATCH 01/10] drm: Initialize a linear gamma table by default
On Tue, May 31, 2016 at 03:05:32PM +0200, Maarten Lankhorst wrote: > Op 30-03-16 om 11:51 schreef Daniel Vetter: > > Code stolen from gma500. > It would be useful to mention why this is done. :) > > But even with this patch it seems the legacy gamma in gamma_get is not very > reliable. > A failed call to gamma_set could leave wrong values in crtc->gamma_store > either by calling the ioctl with lut.blue set to NULL, or call gamma_set and > interrupt with a signal. > For atomic color management get_gamma won't be accurate at all if mixed with > new color management. Hm, it's just some safety code I found laying around, and figured that looks like a good idea. You think it's worth it with some improved commit message added? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH 02/10] drm/fb-helper: Remove dead code in setcolreg
On Tue, May 31, 2016 at 03:09:42PM +0200, Maarten Lankhorst wrote: > Op 30-03-16 om 11:51 schreef Daniel Vetter: > > DRM fbdev emulation only supports pallete_color with depth == 8, and > > truecolor with depth > 8. Handling depth == 16 for palettes is hence > > dead code, let's remove it. > Hooray, less chance for failure! > > Reviewed-by: Maarten Lankhorst Applied to drm-misc, thanks for the review. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH 09/10] drm/qxl: Don't set a gamma table size
On Tue, May 31, 2016 at 03:17:57PM +0200, Maarten Lankhorst wrote: > Op 30-03-16 om 11:51 schreef Daniel Vetter: > > qxl doesn't have any functions for setting the gamma table, so this is > > completely defunct. > > > > Not nice to lie to userspace, so let's stop! > Reviewed-by: Maarten Lankhorst Applied the other patches you've reviewed, too. Thanks for the reviews. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH 16/27] drm/vgem: Use lockless gem BO free callback
On Tue, May 31, 2016 at 09:20:07AM -0400, Sean Paul wrote: > On Mon, May 30, 2016 at 1:53 PM, Daniel Vetter > wrote: > > No dev->struct_mutex anywhere to be seen. > > > > Cc: seanpaul at chromium.org > > Signed-off-by: Daniel Vetter > > Reviewed-by: Sean Paul Applied to drm-misc, thanks for the review. -Daniel > > > --- > > drivers/gpu/drm/vgem/vgem_drv.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/vgem/vgem_drv.c > > b/drivers/gpu/drm/vgem/vgem_drv.c > > index 341f9be3dde6..1b4cc8b27080 100644 > > --- a/drivers/gpu/drm/vgem/vgem_drv.c > > +++ b/drivers/gpu/drm/vgem/vgem_drv.c > > @@ -235,7 +235,7 @@ static const struct file_operations vgem_driver_fops = { > > > > static struct drm_driver vgem_driver = { > > .driver_features= DRIVER_GEM, > > - .gem_free_object= vgem_gem_free_object, > > + .gem_free_object_unlocked = vgem_gem_free_object, > > .gem_vm_ops = &vgem_gem_vm_ops, > > .ioctls = vgem_ioctls, > > .fops = &vgem_driver_fops, > > -- > > 2.8.1 > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH 01/10] drm: Initialize a linear gamma table by default
Op 31-05-16 om 15:24 schreef Daniel Vetter: > On Tue, May 31, 2016 at 03:05:32PM +0200, Maarten Lankhorst wrote: >> Op 30-03-16 om 11:51 schreef Daniel Vetter: >>> Code stolen from gma500. >> It would be useful to mention why this is done. :) >> >> But even with this patch it seems the legacy gamma in gamma_get is not very >> reliable. >> A failed call to gamma_set could leave wrong values in crtc->gamma_store >> either by calling the ioctl with lut.blue set to NULL, or call gamma_set and >> interrupt with a signal. >> For atomic color management get_gamma won't be accurate at all if mixed with >> new color management. > Hm, it's just some safety code I found laying around, and figured that > looks like a good idea. You think it's worth it with some improved commit > message added? Might as well. It makes gamma_get ioctl slightly more reliable, but for reliable gamma should probably use crtc properties or atomic. :)
[PATCH 00/27] locklesss gem BO free driver patches
Hi Daniel! On 30 May 2016 at 23:22, Daniel Vetter wrote: > HI all, > > Here's the pile of lockless gem BO free conversion patches. Assuming I didn't > botch it these are all the ones that didn't yet get an ack. Since this is all > pretty boring stuff I'll just send a pull request to Dave later this week if > no > one pipes. > For the series, please feel free to add my R-b, fwiw. > Thanks, Daniel > Best, Sumit. > Benjamin Gaignard (1): > drm: sti: remove useless call to dev->struct_mutex > > Daniel Vetter (26): > drm/armada: Use lockless gem BO free callback > drm/ast: Use lockless gem BO free callback > drm/atmel: Use lockless gem BO free callback > drm/bochs: Use lockless gem BO free callback > drm/cirrus: Use lockless gem BO free callback > drm/fls-dcu: Use lockless gem BO free callback > drm/mga200g: Use lockless gem BO free callback > drm/nouveau: Use lockless gem BO free callback > drm/qxl: Use lockless gem BO free callback > drm/rcar-du: Use lockless gem BO free callback > drm/rockchip: Use lockless gem BO free callback > drm/shmob: Use lockless gem BO free callback > drm/tilcdc: Use lockless gem BO free callback > drm/vc4: Use drm_gem_object_unreference_unlocked > drm/vc4: Use lockless gem BO free callback > drm/vgem: Use lockless gem BO free callback > drm/virtio: Use lockless gem BO free callback > drm/virtio: Use lockless gem BO free callback > drm/rockchip: Use cma gem vm ops > drm/msm: Nuke dummy fb->dirty callback > drm/omapdrm: Nuke dummy fb->dirty callback > drm/sun4i: Use lockless gem BO free callback > drm/arcpgu: Use lockless gem BO free callback > drm/hlcd: Use lockless gem BO free callback > drm/hisilicon: Use lockless gem BO free callback > drm/mediatek: Use lockless gem BO free callback > > drivers/gpu/drm/arc/arcpgu_drv.c| 2 +- > drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- > drivers/gpu/drm/armada/armada_drv.c | 2 +- > drivers/gpu/drm/ast/ast_drv.c | 2 +- > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c| 2 +- > drivers/gpu/drm/bochs/bochs_drv.c | 2 +- > drivers/gpu/drm/cirrus/cirrus_drv.c | 2 +- > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- > drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 +- > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 +- > drivers/gpu/drm/mgag200/mgag200_drv.c | 2 +- > drivers/gpu/drm/msm/msm_fb.c| 8 > drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- > drivers/gpu/drm/omapdrm/omap_fb.c | 8 > drivers/gpu/drm/qxl/qxl_drv.c | 2 +- > drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 10 +++--- > drivers/gpu/drm/shmobile/shmob_drm_drv.c| 2 +- > drivers/gpu/drm/sti/sti_cursor.c| 7 --- > drivers/gpu/drm/sti/sti_drv.c | 8 +--- > drivers/gpu/drm/sti/sti_dvo.c | 7 --- > drivers/gpu/drm/sti/sti_gdp.c | 14 -- > drivers/gpu/drm/sti/sti_hda.c | 7 --- > drivers/gpu/drm/sti/sti_hdmi.c | 7 --- > drivers/gpu/drm/sti/sti_hqvdp.c | 7 --- > drivers/gpu/drm/sti/sti_mixer.c | 7 --- > drivers/gpu/drm/sti/sti_tvout.c | 7 --- > drivers/gpu/drm/sti/sti_vid.c | 7 --- > drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +- > drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +- > drivers/gpu/drm/vc4/vc4_bo.c| 2 -- > drivers/gpu/drm/vc4/vc4_drv.c | 2 +- > drivers/gpu/drm/vc4/vc4_gem.c | 11 +++ > drivers/gpu/drm/vgem/vgem_drv.c | 2 +- > drivers/gpu/drm/virtio/virtgpu_drv.c| 2 +- > 35 files changed, 27 insertions(+), 130 deletions(-) > > -- > 2.8.1 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel
Bad flicker on skylake HQD due to code in the 4.7 merge window
On Tue, 2016-05-31 at 10:51 +0300, Jani Nikula wrote: > On Mon, 30 May 2016, James Bottomley < > James.Bottomley at HansenPartnership.com> wrote: > > I've tested a pristine 4.6.0 system, so it's definitely something > > that > > went in during the merge window. The flicker isn't continuous, > > it's > > periodic, with an interval of something like 2-5 seconds. It looks > > like an old analogue TV going out of sync and then resyncing. I've > > attached the dmesg and X.org log below just in case they can help. > > I > > might be able to bisect this next week, but, unfortunately, this is > > my > > current laptop and I'm travelling this week. > > Please try i915.enable_psr=0 module parameter. Makes no discernable difference. Current parameter settings are: disable_display: N disable_power_well: 1 edp_vswing: 0 enable_cmd_parser: 1 enable_dc: -1 enable_dp_mst: Y enable_execlists: 1 enable_fbc: -1 enable_guc_submission: N enable_hangcheck: Y enable_ips: 1 enable_ppgtt: 3 enable_psr: 0 enable_rc6: 1 fastboot: N guc_log_level: -1 inject_load_failure: 0 invert_brightness: 0 load_detect_test: N lvds_channel_mode: 0 lvds_use_ssc: -1 mmio_debug: 0 modeset: -1 nuclear_pageflip: N panel_ignore_lid: 1 prefault_disable: N preliminary_hw_support: 1 reset: Y semaphores: -1 use_mmio_flip: 0 vbt_sdvo_panel_type: -1 verbose_state_checks: Y James
[PATCH] drm/omap: rename panel/encoder Kconfig names
omapdrm is using much too generic Kconfig names for its panels and encoders. Rename them to have "DRM_OMAP" in the name. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/displays/Kconfig | 28 ++-- drivers/gpu/drm/omapdrm/displays/Makefile | 28 ++-- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/Kconfig b/drivers/gpu/drm/omapdrm/displays/Kconfig index 2a618afe0f53..c226da145fb3 100644 --- a/drivers/gpu/drm/omapdrm/displays/Kconfig +++ b/drivers/gpu/drm/omapdrm/displays/Kconfig @@ -1,80 +1,80 @@ menu "OMAPDRM External Display Device Drivers" -config DISPLAY_ENCODER_OPA362 +config DRM_OMAP_ENCODER_OPA362 tristate "OPA362 external analog amplifier" help Driver for OPA362 external analog TV amplifier controlled through a GPIO. -config DISPLAY_ENCODER_TFP410 +config DRM_OMAP_ENCODER_TFP410 tristate "TFP410 DPI to DVI Encoder" help Driver for TFP410 DPI to DVI encoder. -config DISPLAY_ENCODER_TPD12S015 +config DRM_OMAP_ENCODER_TPD12S015 tristate "TPD12S015 HDMI ESD protection and level shifter" help Driver for TPD12S015, which offers HDMI ESD protection and level shifting. -config DISPLAY_CONNECTOR_DVI +config DRM_OMAP_CONNECTOR_DVI tristate "DVI Connector" depends on I2C help Driver for a generic DVI connector. -config DISPLAY_CONNECTOR_HDMI +config DRM_OMAP_CONNECTOR_HDMI tristate "HDMI Connector" help Driver for a generic HDMI connector. -config DISPLAY_CONNECTOR_ANALOG_TV +config DRM_OMAP_CONNECTOR_ANALOG_TV tristate "Analog TV Connector" help Driver for a generic analog TV connector. -config DISPLAY_PANEL_DPI +config DRM_OMAP_PANEL_DPI tristate "Generic DPI panel" help Driver for generic DPI panels. -config DISPLAY_PANEL_DSI_CM +config DRM_OMAP_PANEL_DSI_CM tristate "Generic DSI Command Mode Panel" depends on BACKLIGHT_CLASS_DEVICE help Driver for generic DSI command mode panels. -config DISPLAY_PANEL_SONY_ACX565AKM +config DRM_OMAP_PANEL_SONY_ACX565AKM tristate "ACX565AKM Panel" depends on SPI && BACKLIGHT_CLASS_DEVICE help This is the LCD panel used on Nokia N900 -config DISPLAY_PANEL_LGPHILIPS_LB035Q02 +config DRM_OMAP_PANEL_LGPHILIPS_LB035Q02 tristate "LG.Philips LB035Q02 LCD Panel" depends on SPI help LCD Panel used on the Gumstix Overo Palo35 -config DISPLAY_PANEL_SHARP_LS037V7DW01 +config DRM_OMAP_PANEL_SHARP_LS037V7DW01 tristate "Sharp LS037V7DW01 LCD Panel" depends on BACKLIGHT_CLASS_DEVICE help LCD Panel used in TI's SDP3430 and EVM boards -config DISPLAY_PANEL_TPO_TD028TTEC1 +config DRM_OMAP_PANEL_TPO_TD028TTEC1 tristate "TPO TD028TTEC1 LCD Panel" depends on SPI help LCD panel used in Openmoko. -config DISPLAY_PANEL_TPO_TD043MTEA1 +config DRM_OMAP_PANEL_TPO_TD043MTEA1 tristate "TPO TD043MTEA1 LCD Panel" depends on SPI help LCD Panel used in OMAP3 Pandora -config DISPLAY_PANEL_NEC_NL8048HL11 +config DRM_OMAP_PANEL_NEC_NL8048HL11 tristate "NEC NL8048HL11 Panel" depends on SPI depends on BACKLIGHT_CLASS_DEVICE diff --git a/drivers/gpu/drm/omapdrm/displays/Makefile b/drivers/gpu/drm/omapdrm/displays/Makefile index 9aa176bfbf2e..46baafb1a83e 100644 --- a/drivers/gpu/drm/omapdrm/displays/Makefile +++ b/drivers/gpu/drm/omapdrm/displays/Makefile @@ -1,14 +1,14 @@ -obj-$(CONFIG_DISPLAY_ENCODER_OPA362) += encoder-opa362.o -obj-$(CONFIG_DISPLAY_ENCODER_TFP410) += encoder-tfp410.o -obj-$(CONFIG_DISPLAY_ENCODER_TPD12S015) += encoder-tpd12s015.o -obj-$(CONFIG_DISPLAY_CONNECTOR_DVI) += connector-dvi.o -obj-$(CONFIG_DISPLAY_CONNECTOR_HDMI) += connector-hdmi.o -obj-$(CONFIG_DISPLAY_CONNECTOR_ANALOG_TV) += connector-analog-tv.o -obj-$(CONFIG_DISPLAY_PANEL_DPI) += panel-dpi.o -obj-$(CONFIG_DISPLAY_PANEL_DSI_CM) += panel-dsi-cm.o -obj-$(CONFIG_DISPLAY_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o -obj-$(CONFIG_DISPLAY_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o -obj-$(CONFIG_DISPLAY_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o -obj-$(CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o -obj-$(CONFIG_DISPLAY_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o -obj-$(CONFIG_DISPLAY_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o +obj-$(CONFIG_DRM_OMAP_ENCODER_OPA362) += encoder-opa362.o +obj-$(CONFIG_DRM_OMAP_ENCODER_TFP410) += encoder-tfp410.o +obj-$(CONFIG_DRM_OMAP_ENCODER_TPD12S015) += encoder-tpd12s015.o +obj-$(CONFIG_DRM_OMAP_CONNECTOR_DVI) += connector-dvi.o +obj-$(CONFIG_DRM_OMAP_CONNECTOR_HDMI) += connector-hdmi.o +obj-$(CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV) += connector-analog-tv.o +obj-$(CONFIG_DRM_OMAP_PAN
[RFC PATCH v1 0/2]
The full name of PSR is Panel Self Refresh, panel device could refresh itself with the hardware framebuffer in panel, this would make a lots of sense to save the power consumption. For example, when desktop haven't change the context for a long time, then we could refresh the data to the hardware framebuffer of panel, and then let panel enter into PSR mode. After that system could poweroff the LCDC controller and eDP controller, just let panel refresh the screen by itself. It's hard to decide when panel should enter into PSR or exit from PSR, in this time I chose to let the drm_vblank enable/disable event driver the PSR. This thread is based on Mark's RK3399 VOP thread[0] and my RK3399 eDP thread[1]. [0]: https://patchwork.kernel.org/patch/8886041/ [1]: https://patchwork.kernel.org/patch/9132713/ - Yakir Thanks, Yakir Yang (2): drm/rockchip: add a notify event about vblank enable/disable drm/rockchip: analogix: add eDP PSR function drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 69 ++ drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 5 + drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 54 +++ drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h | 28 ++ drivers/gpu/drm/rockchip/Makefile | 2 +- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c| 65 + drivers/gpu/drm/rockchip/rockchip_drm_notify.c | 105 + drivers/gpu/drm/rockchip/rockchip_drm_notify.h | 33 +++ drivers/gpu/drm/rockchip/rockchip_drm_vop.c| 96 +++ drivers/gpu/drm/rockchip/rockchip_drm_vop.h| 3 + drivers/gpu/drm/rockchip/rockchip_vop_reg.c| 2 + include/drm/bridge/analogix_dp.h | 3 + 12 files changed, 464 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_notify.c create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_notify.h -- 1.9.1
[RFC PATCH v1 1/2] drm/rockchip: add a notify event about vblank enable/disable
EDP PSR function is interesting in vblank enable or disable event, so it would be great introduce a way to notify encoder about this event. Signed-off-by: Yakir Yang --- drivers/gpu/drm/rockchip/Makefile | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_notify.c | 66 ++ drivers/gpu/drm/rockchip/rockchip_drm_notify.h | 29 +++ drivers/gpu/drm/rockchip/rockchip_drm_vop.c| 5 ++ 4 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_notify.c create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_notify.h diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/rockchip/Makefile index 05d0713..49fee8c 100644 --- a/drivers/gpu/drm/rockchip/Makefile +++ b/drivers/gpu/drm/rockchip/Makefile @@ -3,7 +3,7 @@ # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. rockchipdrm-y := rockchip_drm_drv.o rockchip_drm_fb.o \ - rockchip_drm_gem.o rockchip_drm_vop.o + rockchip_drm_gem.o rockchip_drm_vop.o rockchip_drm_notify.o rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += rockchip_drm_fbdev.o obj-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_notify.c b/drivers/gpu/drm/rockchip/rockchip_drm_notify.c new file mode 100644 index 000..84111d9 --- /dev/null +++ b/drivers/gpu/drm/rockchip/rockchip_drm_notify.c @@ -0,0 +1,66 @@ +#include "rockchip_drm_notify.h" + +static RAW_NOTIFIER_HEAD(vblank_chain); +static DEFINE_MUTEX(vblank_lock); + +/** + * rockchip_drm_vblank_enable - Send Vblank enable event. Will only enable send + * Vblank if there are 1 or fewer notifiers. + */ +void rockchip_drm_vblank_enable(void) +{ + mutex_lock(&vblank_lock); + raw_notifier_call_chain(&vblank_chain, VBLANK_ENABLE, NULL); + mutex_unlock(&vblank_lock); +} +EXPORT_SYMBOL_GPL(rockchip_drm_vblank_enable); + +/** + * rockchip_drm_vblank_disable - Send VBlank disable event. + */ +void rockchip_drm_vblank_disable(void) +{ + mutex_lock(&vblank_lock); + raw_notifier_call_chain(&vblank_chain, VBLANK_DISABLE, NULL); + mutex_unlock(&vblank_lock); +} +EXPORT_SYMBOL_GPL(rockchip_drm_vblank_disable); + +/** + * rockchip_drm_vblank_register_notifier - Add notifier to Vblank notifiers. + * + * Enable notifiers are called when we enable/disable vblank. This can be done + * through rockchip_drm_vblank_enable/disable or when there is more than one + * sync notifier. Must call rockchip_drm_vblank_lock before calling this. + * @nb The notifier to add + */ +int rockchip_drm_vblank_register_notifier(struct notifier_block *nb) +{ + int ret = 0; + + if (!nb) + return -EINVAL; + + ret = raw_notifier_chain_register(&vblank_chain, nb); + return ret; +} +EXPORT_SYMBOL_GPL(rockchip_drm_vblank_register_notifier); + +/** + * rockchip_drm_vblank_unregister_notifier - Remove notifier from Vblank + * notifiers. + * + * Must call rockchip_drm_vblank_lock before calling this. + * @nb The notifier to remove. + */ +int rockchip_drm_vblank_unregister_notifier(struct notifier_block *nb) +{ + int ret = 0; + + if (!nb) + return -EINVAL; + + ret = raw_notifier_chain_unregister(&vblank_chain, nb); + return ret; +} +EXPORT_SYMBOL_GPL(rockchip_drm_vblank_unregister_notifier); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_notify.h b/drivers/gpu/drm/rockchip/rockchip_drm_notify.h new file mode 100644 index 000..2f28afa --- /dev/null +++ b/drivers/gpu/drm/rockchip/rockchip_drm_notify.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2014 Google, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __ROCKCHIP_DRM_NOTIFY_H +#define __ROCKCHIP_DRM_NOTIFY_H + +#include + +enum vblank_enable_op { + VBLANK_ENABLE = 0, + VBLANK_DISABLE, +}; + +void rockchip_drm_vblank_enable(void); +void rockchip_drm_vblank_disable(void); +int rockchip_drm_vblank_register_notifier(struct notifier_block *nb); +int rockchip_drm_vblank_unregister_notifier(struct notifier_block *nb); + +#endif /* __ROCKCHIP_DRM_NOTIFY_H */ diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 257501f..fb6ce4b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -35,6 +35,7 @@ #include "rockchip_drm_gem.h" #include "rockchip_drm_fb.h" #include "rockchip_drm_vop.h" +#include "rockchip_drm_notify.h" #define __REG_SET_RELAXED(x, off, mask, shift, v, write_ma
[RFC PATCH v1 2/2] drm/rockchip: analogix: add eDP PSR function
The full name of PSR is Panel Self Refresh, panel device could refresh itself with the hardware framebuffer in panel, this would make a lots of sense to save the power consumption. For example, when desktop haven't change the context for a long time, then we could refresh the data to the hardware framebuffer of panel, and then let panel enter into PSR mode. After that system could poweroff the LCDC controller and eDP controller, just let panel refresh the screen by itself. Signed-off-by: Yakir Yang --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 69 drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 5 ++ drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 54 + drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h | 28 +++ drivers/gpu/drm/rockchip/analogix_dp-rockchip.c| 65 drivers/gpu/drm/rockchip/rockchip_drm_notify.c | 39 ++ drivers/gpu/drm/rockchip/rockchip_drm_notify.h | 4 + drivers/gpu/drm/rockchip/rockchip_drm_vop.c| 91 ++ drivers/gpu/drm/rockchip/rockchip_drm_vop.h| 3 + drivers/gpu/drm/rockchip/rockchip_vop_reg.c| 2 + include/drm/bridge/analogix_dp.h | 3 + 11 files changed, 363 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 5af9ce4..a66ccb6 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -39,6 +39,72 @@ struct bridge_init { struct device_node *node; }; +int analogix_dp_actice_psr(struct device *dev) +{ + struct analogix_dp_device *dp = dev_get_drvdata(dev); + + if (!dp->psr_support) + return -EINVAL; + + analogix_dp_send_vsc(dp, EDP_VSC_PSR_STATE_ACTIVE | +EDP_VSC_PSR_CRC_VALUES_VALID); + + return 0; +} +EXPORT_SYMBOL_GPL(analogix_dp_actice_psr); + +int analogix_dp_inactice_psr(struct device *dev) +{ + struct analogix_dp_device *dp = dev_get_drvdata(dev); + + if (!dp->psr_support) + return -EINVAL; + + analogix_dp_send_vsc(dp, 0); + + return 0; +} +EXPORT_SYMBOL_GPL(analogix_dp_inactice_psr); + +int analogix_dp_enable_psr(struct analogix_dp_device *dp) +{ + unsigned char psr_version, psr_caps; + unsigned char psr_en; + + /* disable psr function */ + analogix_dp_read_byte_from_dpcd(dp, DP_PSR_EN_CFG, &psr_en); + psr_en &= ~DP_PSR_ENABLE; + analogix_dp_write_byte_to_dpcd(dp, DP_PSR_EN_CFG, psr_en); + + /* check panel psr version */ + analogix_dp_read_byte_from_dpcd(dp, DP_PSR_SUPPORT, &psr_version); + analogix_dp_read_byte_from_dpcd(dp, DP_PSR_CAPS, &psr_caps); + dev_info(dp->dev, "Panel PSR version : %x.%x\n", psr_version, psr_caps); + + if (!(psr_version & DP_PSR_IS_SUPPORTED)) + return -1; + + /* Main-Link transmitter remains active during PSR active states */ + analogix_dp_read_byte_from_dpcd(dp, DP_PSR_EN_CFG, &psr_en); + psr_en = DP_PSR_MAIN_LINK_ACTIVE | DP_PSR_CRC_VERIFICATION; + analogix_dp_write_byte_to_dpcd(dp, DP_PSR_EN_CFG, psr_en); + + /* enable PSR function */ + analogix_dp_read_byte_from_dpcd(dp, DP_PSR_EN_CFG, &psr_en); + psr_en = DP_PSR_ENABLE | DP_PSR_MAIN_LINK_ACTIVE | +DP_PSR_CRC_VERIFICATION; + analogix_dp_write_byte_to_dpcd(dp, DP_PSR_EN_CFG, psr_en); + + /* read sink psr state */ + analogix_dp_read_byte_from_dpcd(dp, DP_PSR_EN_CFG, &psr_en); + dev_info(dp->dev, "DP_PSR_EN_CFG: %x\n", psr_en); + + analogix_dp_enable_psr_crc(dp); + dp->psr_support = true; + + return 0; +} + static void analogix_dp_init_dp(struct analogix_dp_device *dp) { analogix_dp_reset(dp); @@ -921,6 +987,9 @@ static void analogix_dp_commit(struct analogix_dp_device *dp) /* Enable video */ analogix_dp_start_video(dp); + + /* Enable PSR support */ + analogix_dp_enable_psr(dp); } int analogix_dp_get_modes(struct drm_connector *connector) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h index b456380..948e59a 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h @@ -178,6 +178,8 @@ struct analogix_dp_device { boolforce_hpd; unsigned char edid[EDID_BLOCK_LENGTH * 2]; + boolpsr_support; + struct analogix_dp_plat_data *plat_data; }; @@ -278,4 +280,7 @@ int analogix_dp_is_video_stream_on(struct analogix_dp_device *dp); void analogix_dp_config_video_slave_mode(struct analogix_dp_device *dp); void analogix_dp_enable_scrambling(struct analogix_dp_device *dp); void analogix_dp_disable_scrambling(struct analogix_dp_device *dp); +void analogix_dp_enabl
[Bug 94860] [radeonsi/amdgpu][DCC] screen is corrupted when logging out of kde
https://bugs.freedesktop.org/show_bug.cgi?id=94860 --- Comment #6 from lumks at ymail.com --- (In reply to Michel Dänzer from comment #5) > Setting the environment variable R600_DEBUG=nodcc for the kwin process works > around this problem for me. +1 it also worksaround wayland session and maybe also this one: https://bugs.kde.org/show_bug.cgi?id=361154 (i dont know right now for sure but it looks like it does) -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/0feccc41/attachment.html>
[PATCH 4/5] add cursor hotspot to drm_framebuffer
On Tue, May 31, 2016 at 03:09:13PM +0200, Gerd Hoffmann wrote: > On Di, 2016-05-31 at 15:36 +0300, Ville Syrjälä wrote: > > > Why store it in the fb and not eg. the plane state? > > Well, drm_plane_state is allocated by drm_atomic_helper_update_plane. > > When sticking the hotspot into the the plane state we have to add hot_x > and hot_y parameters to drm_plane_funcs->update_plane() and cause quite > some churn all over the drm tree. > > Or create a separate code path for cursor updates which uses a special > drm_atomic_helper_update_plane version, which doesn't look very > attractive too due to code duplication. > > Sticking it into the drm_framebuffer instead looks like a reasonable > alternative. > > I'm open to better suggestions. Hmm. Too many layers. I guess this is the easiest solution then. I was hoping to avoid fattening the fb for something so rarely used, but I guess there's no sane way to achieve that. -- Ville Syrjälä Intel OTC
[Intel-gfx] [PATCH] drm/atomic-helper: nonblocking commit support
Op 30-05-16 om 10:01 schreef Daniel Vetter: > Design ideas: > > - split up the actual commit into different phases, and have > completions for each of them. This will be useful for the future > when we want to interleave phases much more aggressively, for e.g. > queue depth > 1. For not it's just a minimal optimization compared > to current common nonblocking implementation patterns from drivers, > which all stall for the entire commit to complete, including vblank > waits and cleanups. > > - Extract a separate atomic_commit_hw hook since that's the part most > drivers will need to overwrite, hopefully allowing even more shared > code. > > - Enforce EBUSY seamntics by attaching one of the completions to the > flip_done vblank event. Side benefit of forcing atomic drivers using > these helpers to implement event handlign at least semi-correct. I'm > evil that way ;-) > > - Ridiculously modular, as usual. > > - The main tracking unit for a commit stays struct drm_atomic_state, > and the ownership rules for that are unchanged. Ownership still > gets transferred to the driver (and subsequently to the worker) on > successful commits. What is added is a small, per-crtc, refcounted > structure to track pending commits called struct drm_crtc_commit. > No actual state is attached to that though, it's purely for ordering > and waiting. > > - Dependencies are implicitly handled by assuming that any CRTC part > of &drm_atomic_state is a dependency, and that the current commit > must wait for any commits to complete on those CRTC. This way > drivers can easily add more depencies using > drm_atomic_get_crtc_state(), which is very natural since in most > case a dependency exists iff there's some bit of state that needs to > be cross checked. > > Removing depencies is not possible, drivers simply need to be > careful to not include every CRTC in a commit if that's not > necessary. Which is a good idea anyway, since that also avoids > ww_mutex lock contention. > > - Queue depth > 1 sees some prep work in this patch by adding a stall > paramater to drm_atomic_helper_swap_states(). To be able to push > commits entirely free-standing and in a deeper queue through the > back-end the driver must not access any obj->state pointers. This > means we need to track the old state in drm_atomic_state (much > easier with the consolidated arrays), and pass them all explicitly > to driver backends (this will be serious amounts of churn). > > Once that's done stall can be set to false in swap_states. > > Features: Contains bugs because totally untested. > > v2: Dont ask for flip_done signalling when the CRTC is off and stays > off: Drivers don't handle events in that case. Instead complete right > away. This way future commits don't need to have special-case logic, > but can keep blocking for the flip_done completion. > > v3: Tons of fixes: > - Stall for preceeding commit for real, not the current one by > accident. > - Add WARN_ON in case drivers don't fire the drm event. > - Don't double-free drm events. > > v4: Make legacy cursor not stall. > > v5: Extend the helper hook to cover the entire commit tail. Some > drivers need special code for cleanup and vblank waiting, this makes > it a bit more useful. Inspired by the rockchip driver. > > v6: Add WARN_ON to catch drivers who forget to send out the > drm event. > > v7: Fixup the stalls in swap_state for real!! I don't think stalling belongs to swap_state, that should be a separate helper call. When nonblocking = false the waiting is still performed uninterruptibly. I believe that this is an error, and all blocking waiting should be completed before calling swap_state to ensure -EINTR can be propagated correctly as much as possible. Perhaps also return -EBUSY if wait times out. You specified a timeout of 10 HZ, why is that? If we wait interruptibly then there's no need for a timeout. I also think the timeout may be too short, if we commit 3 crtc's it leaves 3.3 seconds for each. In case there's a modeset enable and disable, that leaves 1.6 seconds for each enable/disable. Might be too short.. Patch is also a bit hard to review with so many lines changed, could this be done in pieces instead of all at once?
[PATCH 1/2] MAINTAINERS: add entry for the Sync File Framework
From: Gustavo Padovan Add Gustavo as maintainer for the Sync File Framework. Sumit is co-maintainer as he maintains drivers/dma-buf/. It also uses Sumit's tree as base. Signed-off-by: Gustavo Padovan Acked-by: Sumit Semwal Acked-by: Maarten Lankhorst --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fb487d9..0891228 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3677,6 +3677,17 @@ F: include/linux/*fence.h F: Documentation/dma-buf-sharing.txt T: git git://git.linaro.org/people/sumitsemwal/linux-dma-buf.git +SYNC FILE FRAMEWORK +M: Sumit Semwal +R: Gustavo Padovan +S: Maintained +L: linux-media at vger.kernel.org +L: dri-devel at lists.freedesktop.org +F: drivers/dma-buf/sync_file.c +F: include/linux/sync_file.h +F: Documentation/sync_file.txt +T: git git://git.linaro.org/people/sumitsemwal/linux-dma-buf.git + DMA GENERIC OFFLOAD ENGINE SUBSYSTEM M: Vinod Koul L: dmaengine at vger.kernel.org -- 2.5.5
[PATCH 2/2] dma-buf/sync_file: improve Kconfig description for Sync Files
From: Gustavo Padovan We've got a complaint saying that the description was quite obtuse and indeed it was. This patch tries to improve it. Cc: Dave Jones Signed-off-by: Gustavo Padovan --- drivers/dma-buf/Kconfig | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig index 9824bc4..7e2d2c4 100644 --- a/drivers/dma-buf/Kconfig +++ b/drivers/dma-buf/Kconfig @@ -1,11 +1,20 @@ menu "DMABUF options" config SYNC_FILE - bool "sync_file support for fences" + bool "Explicit Synchronization Framework" default n select ANON_INODES select DMA_SHARED_BUFFER ---help--- - This option enables the fence framework synchronization to export - sync_files to userspace that can represent one or more fences. + The Sync File Framework adds explicit syncronization via + userspace. It enables send/receive 'struct fence' objects to/from + userspace via Sync File fds for synchronization between drivers via + userspace components. It has been ported from Android. + + The first and main user for this is graphics in which a fence is + associated with a buffer. When a job is submitted to the GPU a fence + is attached to the buffer and is transfered via userspace, using Sync + Files fds, to the DRM driver for example. More details at + Documentation/sync_file.txt. + endmenu -- 2.5.5
[Intel-gfx] [PATCH] drm/atomic-helper: nonblocking commit support
On Tue, May 31, 2016 at 04:22:57PM +0200, Maarten Lankhorst wrote: > Op 30-05-16 om 10:01 schreef Daniel Vetter: > > Design ideas: > > > > - split up the actual commit into different phases, and have > > completions for each of them. This will be useful for the future > > when we want to interleave phases much more aggressively, for e.g. > > queue depth > 1. For not it's just a minimal optimization compared > > to current common nonblocking implementation patterns from drivers, > > which all stall for the entire commit to complete, including vblank > > waits and cleanups. > > > > - Extract a separate atomic_commit_hw hook since that's the part most > > drivers will need to overwrite, hopefully allowing even more shared > > code. > > > > - Enforce EBUSY seamntics by attaching one of the completions to the > > flip_done vblank event. Side benefit of forcing atomic drivers using > > these helpers to implement event handlign at least semi-correct. I'm > > evil that way ;-) > > > > - Ridiculously modular, as usual. > > > > - The main tracking unit for a commit stays struct drm_atomic_state, > > and the ownership rules for that are unchanged. Ownership still > > gets transferred to the driver (and subsequently to the worker) on > > successful commits. What is added is a small, per-crtc, refcounted > > structure to track pending commits called struct drm_crtc_commit. > > No actual state is attached to that though, it's purely for ordering > > and waiting. > > > > - Dependencies are implicitly handled by assuming that any CRTC part > > of &drm_atomic_state is a dependency, and that the current commit > > must wait for any commits to complete on those CRTC. This way > > drivers can easily add more depencies using > > drm_atomic_get_crtc_state(), which is very natural since in most > > case a dependency exists iff there's some bit of state that needs to > > be cross checked. > > > > Removing depencies is not possible, drivers simply need to be > > careful to not include every CRTC in a commit if that's not > > necessary. Which is a good idea anyway, since that also avoids > > ww_mutex lock contention. > > > > - Queue depth > 1 sees some prep work in this patch by adding a stall > > paramater to drm_atomic_helper_swap_states(). To be able to push > > commits entirely free-standing and in a deeper queue through the > > back-end the driver must not access any obj->state pointers. This > > means we need to track the old state in drm_atomic_state (much > > easier with the consolidated arrays), and pass them all explicitly > > to driver backends (this will be serious amounts of churn). > > > > Once that's done stall can be set to false in swap_states. > > > > Features: Contains bugs because totally untested. > > > > v2: Dont ask for flip_done signalling when the CRTC is off and stays > > off: Drivers don't handle events in that case. Instead complete right > > away. This way future commits don't need to have special-case logic, > > but can keep blocking for the flip_done completion. > > > > v3: Tons of fixes: > > - Stall for preceeding commit for real, not the current one by > > accident. > > - Add WARN_ON in case drivers don't fire the drm event. > > - Don't double-free drm events. > > > > v4: Make legacy cursor not stall. > > > > v5: Extend the helper hook to cover the entire commit tail. Some > > drivers need special code for cleanup and vblank waiting, this makes > > it a bit more useful. Inspired by the rockchip driver. > > > > v6: Add WARN_ON to catch drivers who forget to send out the > > drm event. > > > > v7: Fixup the stalls in swap_state for real!! > I don't think stalling belongs to swap_state, that should be a separate > helper call. Imo swap_state and stalling for hw_done is crucial that they're never split up. At least until we have queue depth > 1. Splitting it up just means there's more stuff drivers can get wrong, and I haven't found a single driver where there's a need to split things up. And I looked at all 17 of them. That's why I don't think splitting makes sense. All the other helpers might seem like things are split up a lot, but for each separate helper function I'm adding here there's that absolutely needs that split to insert/replace a bit. > When nonblocking = false the waiting is still performed uninterruptibly. I > believe that this is an error, > and all blocking waiting should be completed before calling swap_state to > ensure -EINTR can be > propagated correctly as much as possible. Perhaps also return -EBUSY if wait > times out. The trouble with failing with -EBUSY is that drivers are broken in their drm even handling, which means they'll fail. By eventually continuing there's at least some chances that you'll see something on the screen. Wrt interruptible waits, the stall check does wait interruptible. Everything else is imo part of the commit, which isn't allowed to fail/get interrupted. And for queue depth
[RFC PATCH v1 1/2] drm/rockchip: add a notify event about vblank enable/disable
On Tue, May 31, 2016 at 09:39:19PM +0800, Yakir Yang wrote: > EDP PSR function is interesting in vblank enable or disable event, > so it would be great introduce a way to notify encoder about this > event. > > Signed-off-by: Yakir Yang notifiers considered evil, especially if you add a global notifier for something that's very specific to a given crtc. I think the better fix would be add a suitable hook to drm_bridge to allow encoders to go into self refresh, and to wake them up from self-refresh again. -Daniel > --- > drivers/gpu/drm/rockchip/Makefile | 2 +- > drivers/gpu/drm/rockchip/rockchip_drm_notify.c | 66 > ++ > drivers/gpu/drm/rockchip/rockchip_drm_notify.h | 29 +++ > drivers/gpu/drm/rockchip/rockchip_drm_vop.c| 5 ++ > 4 files changed, 101 insertions(+), 1 deletion(-) > create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_notify.c > create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_notify.h > > diff --git a/drivers/gpu/drm/rockchip/Makefile > b/drivers/gpu/drm/rockchip/Makefile > index 05d0713..49fee8c 100644 > --- a/drivers/gpu/drm/rockchip/Makefile > +++ b/drivers/gpu/drm/rockchip/Makefile > @@ -3,7 +3,7 @@ > # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. > > rockchipdrm-y := rockchip_drm_drv.o rockchip_drm_fb.o \ > - rockchip_drm_gem.o rockchip_drm_vop.o > + rockchip_drm_gem.o rockchip_drm_vop.o rockchip_drm_notify.o > rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += rockchip_drm_fbdev.o > > obj-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_notify.c > b/drivers/gpu/drm/rockchip/rockchip_drm_notify.c > new file mode 100644 > index 000..84111d9 > --- /dev/null > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_notify.c > @@ -0,0 +1,66 @@ > +#include "rockchip_drm_notify.h" > + > +static RAW_NOTIFIER_HEAD(vblank_chain); > +static DEFINE_MUTEX(vblank_lock); > + > +/** > + * rockchip_drm_vblank_enable - Send Vblank enable event. Will only enable > send > + * Vblank if there are 1 or fewer notifiers. > + */ > +void rockchip_drm_vblank_enable(void) > +{ > + mutex_lock(&vblank_lock); > + raw_notifier_call_chain(&vblank_chain, VBLANK_ENABLE, NULL); > + mutex_unlock(&vblank_lock); > +} > +EXPORT_SYMBOL_GPL(rockchip_drm_vblank_enable); > + > +/** > + * rockchip_drm_vblank_disable - Send VBlank disable event. > + */ > +void rockchip_drm_vblank_disable(void) > +{ > + mutex_lock(&vblank_lock); > + raw_notifier_call_chain(&vblank_chain, VBLANK_DISABLE, NULL); > + mutex_unlock(&vblank_lock); > +} > +EXPORT_SYMBOL_GPL(rockchip_drm_vblank_disable); > + > +/** > + * rockchip_drm_vblank_register_notifier - Add notifier to Vblank notifiers. > + * > + * Enable notifiers are called when we enable/disable vblank. This can be > done > + * through rockchip_drm_vblank_enable/disable or when there is more than one > + * sync notifier. Must call rockchip_drm_vblank_lock before calling this. > + * @nb The notifier to add > + */ > +int rockchip_drm_vblank_register_notifier(struct notifier_block *nb) > +{ > + int ret = 0; > + > + if (!nb) > + return -EINVAL; > + > + ret = raw_notifier_chain_register(&vblank_chain, nb); > + return ret; > +} > +EXPORT_SYMBOL_GPL(rockchip_drm_vblank_register_notifier); > + > +/** > + * rockchip_drm_vblank_unregister_notifier - Remove notifier from Vblank > + * notifiers. > + * > + * Must call rockchip_drm_vblank_lock before calling this. > + * @nb The notifier to remove. > + */ > +int rockchip_drm_vblank_unregister_notifier(struct notifier_block *nb) > +{ > + int ret = 0; > + > + if (!nb) > + return -EINVAL; > + > + ret = raw_notifier_chain_unregister(&vblank_chain, nb); > + return ret; > +} > +EXPORT_SYMBOL_GPL(rockchip_drm_vblank_unregister_notifier); > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_notify.h > b/drivers/gpu/drm/rockchip/rockchip_drm_notify.h > new file mode 100644 > index 000..2f28afa > --- /dev/null > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_notify.h > @@ -0,0 +1,29 @@ > +/* > + * Copyright (C) 2014 Google, Inc. > + * > + * This software is licensed under the terms of the GNU General Public > + * License version 2, as published by the Free Software Foundation, and > + * may be copied, distributed, and modified under those terms. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + */ > + > +#ifndef __ROCKCHIP_DRM_NOTIFY_H > +#define __ROCKCHIP_DRM_NOTIFY_H > + > +#include > + > +enum vblank_enable_op { > + VBLANK_ENABLE = 0, > + VBLANK_DISABLE, > +}; > + > +void rockchip_drm_vblank_enable(void); > +void rockchip_drm_vblank_disable(void); > +int rockchip_drm_vblank_register_notif
[RFC PATCH v1 0/2]
On Tue, May 31, 2016 at 09:37:36PM +0800, Yakir Yang wrote: > The full name of PSR is Panel Self Refresh, panel device could refresh > itself with the hardware framebuffer in panel, this would make a lots > of sense to save the power consumption. > > For example, when desktop haven't change the context for a long time, > then we could refresh the data to the hardware framebuffer of panel, > and then let panel enter into PSR mode. After that system could poweroff > the LCDC controller and eDP controller, just let panel refresh the screen > by itself. > > It's hard to decide when panel should enter into PSR or exit from PSR, in > this time I chose to let the drm_vblank enable/disable event driver the PSR. > > This thread is based on Mark's RK3399 VOP thread[0] and my RK3399 eDP > thread[1]. > > [0]: https://patchwork.kernel.org/patch/8886041/ > [1]: https://patchwork.kernel.org/patch/9132713/ Looks like you didn't wire up the drm_framebuffer->funcs->dirty callback for manual upload of simple clients like bootsplash or fbdev. I think that's needed. At least it's needed for every other manual upload dsi and edp psr implementation. -Daniel > > - Yakir > Thanks, > > > Yakir Yang (2): > drm/rockchip: add a notify event about vblank enable/disable > drm/rockchip: analogix: add eDP PSR function > > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 69 ++ > drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 5 + > drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 54 +++ > drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h | 28 ++ > drivers/gpu/drm/rockchip/Makefile | 2 +- > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c| 65 + > drivers/gpu/drm/rockchip/rockchip_drm_notify.c | 105 > + > drivers/gpu/drm/rockchip/rockchip_drm_notify.h | 33 +++ > drivers/gpu/drm/rockchip/rockchip_drm_vop.c| 96 +++ > drivers/gpu/drm/rockchip/rockchip_drm_vop.h| 3 + > drivers/gpu/drm/rockchip/rockchip_vop_reg.c| 2 + > include/drm/bridge/analogix_dp.h | 3 + > 12 files changed, 464 insertions(+), 1 deletion(-) > create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_notify.c > create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_notify.h > > -- > 1.9.1 > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH] drm: hdlcd: Cleanup the atomic operations
Dispatch DRM pending events from crtc_atomic_flush() and not from the IRQ handler. Don't disable the vsync interrupt, as the hardware lacks hardware counters for vsync time stamping. Signed-off-by: Liviu Dudau --- This replaces the previous patch "drm: hdlcd: Replace the mode config's atomic_commit with the proper implementation." and removes the in-house async implementation for atomic commit. drivers/gpu/drm/arm/hdlcd_crtc.c | 64 +++- drivers/gpu/drm/arm/hdlcd_drv.c | 42 ++ drivers/gpu/drm/arm/hdlcd_drv.h | 1 - 3 files changed, 53 insertions(+), 54 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index d1e8d31..523890d 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -106,7 +106,7 @@ static void hdlcd_crtc_mode_set_nofb(struct drm_crtc *crtc) struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); struct drm_display_mode *m = &crtc->state->adjusted_mode; struct videomode vm; - unsigned int polarities, line_length, err; + unsigned int polarities, err; vm.vfront_porch = m->crtc_vsync_start - m->crtc_vdisplay; vm.vback_porch = m->crtc_vtotal - m->crtc_vsync_end; @@ -122,23 +122,18 @@ static void hdlcd_crtc_mode_set_nofb(struct drm_crtc *crtc) if (m->flags & DRM_MODE_FLAG_PVSYNC) polarities |= HDLCD_POLARITY_VSYNC; - line_length = crtc->primary->state->fb->pitches[0]; - /* Allow max number of outstanding requests and largest burst size */ hdlcd_write(hdlcd, HDLCD_REG_BUS_OPTIONS, HDLCD_BUS_MAX_OUTSTAND | HDLCD_BUS_BURST_16); - hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, line_length); - hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_PITCH, line_length); - hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_COUNT, m->crtc_vdisplay - 1); hdlcd_write(hdlcd, HDLCD_REG_V_DATA, m->crtc_vdisplay - 1); hdlcd_write(hdlcd, HDLCD_REG_V_BACK_PORCH, vm.vback_porch - 1); hdlcd_write(hdlcd, HDLCD_REG_V_FRONT_PORCH, vm.vfront_porch - 1); hdlcd_write(hdlcd, HDLCD_REG_V_SYNC, vm.vsync_len - 1); + hdlcd_write(hdlcd, HDLCD_REG_H_DATA, m->crtc_hdisplay - 1); hdlcd_write(hdlcd, HDLCD_REG_H_BACK_PORCH, vm.hback_porch - 1); hdlcd_write(hdlcd, HDLCD_REG_H_FRONT_PORCH, vm.hfront_porch - 1); hdlcd_write(hdlcd, HDLCD_REG_H_SYNC, vm.hsync_len - 1); - hdlcd_write(hdlcd, HDLCD_REG_H_DATA, m->crtc_hdisplay - 1); hdlcd_write(hdlcd, HDLCD_REG_POLARITIES, polarities); err = hdlcd_set_pxl_fmt(crtc); @@ -153,20 +148,19 @@ static void hdlcd_crtc_enable(struct drm_crtc *crtc) struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); clk_prepare_enable(hdlcd->clk); + hdlcd_crtc_mode_set_nofb(crtc); hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 1); - drm_crtc_vblank_on(crtc); } static void hdlcd_crtc_disable(struct drm_crtc *crtc) { struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); - if (!crtc->primary->fb) + if (!crtc->state->active) return; hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0); clk_disable_unprepare(hdlcd->clk); - drm_crtc_vblank_off(crtc); } static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc, @@ -208,6 +202,21 @@ static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, static void hdlcd_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *state) { + struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); + struct drm_device *drm = crtc->dev; + unsigned long flags; + struct drm_pending_vblank_event *e; + + spin_lock_irqsave(&drm->event_lock, flags); + e = list_first_entry_or_null(&hdlcd->event_list, typeof(*e), base.link); + + if (e) { + list_del(&e->base.link); + drm_crtc_send_vblank_event(&hdlcd->crtc, e); + drm_crtc_vblank_put(&hdlcd->crtc); + } + + spin_unlock_irqrestore(&drm->event_lock, flags); } static bool hdlcd_crtc_mode_fixup(struct drm_crtc *crtc, @@ -219,13 +228,8 @@ static bool hdlcd_crtc_mode_fixup(struct drm_crtc *crtc, static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { .mode_fixup = hdlcd_crtc_mode_fixup, - .mode_set = drm_helper_crtc_mode_set, - .mode_set_base = drm_helper_crtc_mode_set_base, - .mode_set_nofb = hdlcd_crtc_mode_set_nofb, .enable = hdlcd_crtc_enable, .disable= hdlcd_crtc_disable, - .prepare= hdlcd_crtc_disable, - .commit = hdlcd_crtc_enable, .atomic_check = hdlcd_crtc_atomic_check, .atomic_begin = hdlcd_crtc_atomic_begin, .atomic_flush = hdlcd_crtc_atomic_flush, @@ -234,6 +238,15 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_func
[Bug 94860] [radeonsi/amdgpu][DCC] screen is corrupted when logging out of kde
https://bugs.freedesktop.org/show_bug.cgi?id=94860 --- Comment #7 from lumks at ymail.com --- (In reply to lumks from comment #6) > https://bugs.kde.org/show_bug.cgi?id=361154 nope thats something different (: .. still is there even with nodcc so just ignore it -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/ea213ff5/attachment-0001.html>
[PATCH 0/6] drm/i915: Remaining PSR fixes
From: Ville Syrjälä Here's a repost of my PSR fixes, and one straggler from Daniel. One interesting thing I noticed is that my SKL actually hits the PSR setup time vs. vblank length check, so after these patches that machine won't actually use PSR. The panel does support a lower refresh rate timing as well though which doesn't suffer from this limitation, so I hacked the code to use that mode instead, and PSR did seem to work without problems. With the original mode I had some screen stalls while running xonotic, which I'm going to assume were due to the setup time exceeding the safe limit. I also hooked up the PSR interrupts for BDW+ and pushed the patches to [1], but I'm not including those patches here since the PSR interrupts don't seem to gain us anything useful in practice. [1] git://github.com/vsyrjala/linux.git psr_interrupts Daniel Vetter (1): drm/i915/psr: Skip aux handeshake if the vbt tells us to Ville Syrjälä (5): drm/dp: Add drm_dp_psr_setup_time() drm/dp: Add drm_dp_psr_need_train_on_exit() drm/i915: Check PSR setup time vs. vblank length drm/i915: Ask the sink whether training is required when exiting PSR main-link off mode drm/i915: Move psr.link_standby setup to intel_psr_match_conditions() drivers/gpu/drm/drm_dp_helper.c | 46 ++ drivers/gpu/drm/i915/intel_drv.h| 2 ++ drivers/gpu/drm/i915/intel_psr.c| 64 + drivers/gpu/drm/i915/intel_sprite.c | 6 ++-- include/drm/drm_dp_helper.h | 3 ++ 5 files changed, 97 insertions(+), 24 deletions(-) -- 2.7.4
[PATCH v2 1/6] drm/dp: Add drm_dp_psr_setup_time()
From: Ville Syrjälä Add a small helper to parse the PSR setup time from the DPCD PSR capabilities and return the value in microseconds. v2: Don't waste so many bytes on the psr_setup_time_us[] table Cc: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_helper.c | 32 include/drm/drm_dp_helper.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index eeaf5a7c3aa7..1f914629031e 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -822,3 +822,35 @@ void drm_dp_aux_unregister(struct drm_dp_aux *aux) i2c_del_adapter(&aux->ddc); } EXPORT_SYMBOL(drm_dp_aux_unregister); + +#define PSR_SETUP_TIME(x) [DP_PSR_SETUP_TIME_ ## x >> DP_PSR_SETUP_TIME_SHIFT] = (x) + +/** + * drm_dp_psr_setup_time() - PSR setup in time usec + * @psr_cap: PSR capabilities from DPCD + * + * Returns: + * PSR setup time for the panel in microseconds, negative + * error code on failure. + */ +int drm_dp_psr_setup_time(const u8 psr_cap[EDP_PSR_RECEIVER_CAP_SIZE]) +{ + static const u16 psr_setup_time_us[] = { + PSR_SETUP_TIME(330), + PSR_SETUP_TIME(275), + PSR_SETUP_TIME(165), + PSR_SETUP_TIME(110), + PSR_SETUP_TIME(55), + PSR_SETUP_TIME(0), + }; + int i; + + i = (psr_cap[1] & DP_PSR_SETUP_TIME_MASK) >> DP_PSR_SETUP_TIME_SHIFT; + if (i >= ARRAY_SIZE(psr_setup_time_us)) + return -EINVAL; + + return psr_setup_time_us[i]; +} +EXPORT_SYMBOL(drm_dp_psr_setup_time); + +#undef PSR_SETUP_TIME diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 5a848e734422..6aa74f7d45b4 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -657,6 +657,8 @@ struct edp_vsc_psr { #define EDP_VSC_PSR_UPDATE_RFB (1<<1) #define EDP_VSC_PSR_CRC_VALUES_VALID (1<<2) +int drm_dp_psr_setup_time(const u8 psr_cap[EDP_PSR_RECEIVER_CAP_SIZE]); + static inline int drm_dp_max_link_rate(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) { -- 2.7.4
[PATCH v2 2/6] drm/dp: Add drm_dp_psr_need_train_on_exit()
From: Ville Syrjälä Add a small helper to parse from the DPCD whether link training is required when exiting PSR main-link off mode. v2: Rebased Cc: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_helper.c | 14 ++ include/drm/drm_dp_helper.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 1f914629031e..cc7b55a695b5 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -854,3 +854,17 @@ int drm_dp_psr_setup_time(const u8 psr_cap[EDP_PSR_RECEIVER_CAP_SIZE]) EXPORT_SYMBOL(drm_dp_psr_setup_time); #undef PSR_SETUP_TIME + +/** + * drm_dp_psr_need_train_on_exit() - Indicate whether link training is needed on PSR exit + * @psr_cap: PSR capabilities from DPCD + * + * Returns: + * Whether link training is required when exiting PSR main-link off mode. + */ +bool drm_dp_psr_need_train_on_exit(const u8 psr_cap[EDP_PSR_RECEIVER_CAP_SIZE]) +{ + /* DP_PSR_NO_TRAIN_ON_EXIT is "don't care" for PSR2 capable devices */ + return psr_cap[0] < 0x2 && (psr_cap[1] & DP_PSR_NO_TRAIN_ON_EXIT) == 0; +} +EXPORT_SYMBOL(drm_dp_psr_need_train_on_exit); diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 6aa74f7d45b4..2437f1b6e776 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -658,6 +658,7 @@ struct edp_vsc_psr { #define EDP_VSC_PSR_CRC_VALUES_VALID (1<<2) int drm_dp_psr_setup_time(const u8 psr_cap[EDP_PSR_RECEIVER_CAP_SIZE]); +bool drm_dp_psr_need_train_on_exit(const u8 psr_cap[EDP_PSR_RECEIVER_CAP_SIZE]); static inline int drm_dp_max_link_rate(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) -- 2.7.4
[PATCH 3/6] drm/i915: Check PSR setup time vs. vblank length
From: Ville Syrjälä Bspec says: "Restriction : SRD must not be enabled when the PSR Setup time from DPCD 00071h is greater than the time for vertical blank minus one line." Let's check for that and disallow PSR if we exceed the limit. Cc: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_drv.h| 2 ++ drivers/gpu/drm/i915/intel_psr.c| 19 ++- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 9b5f6634c558..56ae3b78e25e 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -1672,6 +1672,8 @@ bool intel_sdvo_init(struct drm_device *dev, /* intel_sprite.c */ +int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode, +int usecs); int intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane); int intel_sprite_set_colorkey(struct drm_device *dev, void *data, struct drm_file *file_priv); diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c index 29a09bf6bd18..aacd8d1767f2 100644 --- a/drivers/gpu/drm/i915/intel_psr.c +++ b/drivers/gpu/drm/i915/intel_psr.c @@ -327,6 +327,9 @@ static bool intel_psr_match_conditions(struct intel_dp *intel_dp) struct drm_i915_private *dev_priv = dev->dev_private; struct drm_crtc *crtc = dig_port->base.base.crtc; struct intel_crtc *intel_crtc = to_intel_crtc(crtc); + const struct drm_display_mode *adjusted_mode = + &intel_crtc->config->base.adjusted_mode; + int psr_setup_time; lockdep_assert_held(&dev_priv->psr.lock); WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); @@ -365,11 +368,25 @@ static bool intel_psr_match_conditions(struct intel_dp *intel_dp) } if (IS_HASWELL(dev) && - intel_crtc->config->base.adjusted_mode.flags & DRM_MODE_FLAG_INTERLACE) { + adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) { DRM_DEBUG_KMS("PSR condition failed: Interlaced is Enabled\n"); return false; } + psr_setup_time = drm_dp_psr_setup_time(intel_dp->psr_dpcd); + if (psr_setup_time < 0) { + DRM_DEBUG_KMS("PSR condition failed: Invalid PSR setup time (0x%02x)\n", + intel_dp->psr_dpcd[1]); + return false; + } + + if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) > + adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay - 1) { + DRM_DEBUG_KMS("PSR condition failed: PSR setup time (%d us) too long\n", + psr_setup_time); + return false; + } + dev_priv->psr.source_ok = true; return true; } diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 324ccb06397d..293b48007006 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -53,8 +53,8 @@ format_is_yuv(uint32_t format) } } -static int usecs_to_scanlines(const struct drm_display_mode *adjusted_mode, - int usecs) +int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode, +int usecs) { /* paranoia */ if (!adjusted_mode->crtc_htotal) @@ -91,7 +91,7 @@ void intel_pipe_update_start(struct intel_crtc *crtc) vblank_start = DIV_ROUND_UP(vblank_start, 2); /* FIXME needs to be calibrated sensibly */ - min = vblank_start - usecs_to_scanlines(adjusted_mode, 100); + min = vblank_start - intel_usecs_to_scanlines(adjusted_mode, 100); max = vblank_start - 1; local_irq_disable(); -- 2.7.4
[PATCH 4/6] drm/i915/psr: Skip aux handeshake if the vbt tells us to
From: Daniel Vetter Not sure we can trust VBT on this one, but let's try. Cc: Rodrigo Vivi Cc: Sonika Jindal Cc: Durgadoss R Signed-off-by: Daniel Vetter Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_psr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c index aacd8d1767f2..c073cbbf1b91 100644 --- a/drivers/gpu/drm/i915/intel_psr.c +++ b/drivers/gpu/drm/i915/intel_psr.c @@ -298,6 +298,9 @@ static void hsw_psr_enable_source(struct intel_dp *intel_dp) else val |= EDP_PSR_TP1_TP2_SEL; + if (!dev_priv->vbt.psr.require_aux_wakeup) + val |= EDP_PSR_SKIP_AUX_EXIT; + I915_WRITE(EDP_PSR_CTL, val); if (!dev_priv->psr.psr2_support) -- 2.7.4
[PATCH 5/6] drm/i915: Ask the sink whether training is required when exiting PSR main-link off mode
From: Ville Syrjälä The sink can tell us if link training needs to be performed when exiting PSR main-link off mode. Currently we get that information from the VBT, but at least on my HSW the VBT says one thing, the sink another. And in practice the sink doesn't seem to notice any screen updates unless we do the training. Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_psr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c index c073cbbf1b91..4db9c26fb970 100644 --- a/drivers/gpu/drm/i915/intel_psr.c +++ b/drivers/gpu/drm/i915/intel_psr.c @@ -298,7 +298,8 @@ static void hsw_psr_enable_source(struct intel_dp *intel_dp) else val |= EDP_PSR_TP1_TP2_SEL; - if (!dev_priv->vbt.psr.require_aux_wakeup) + if (!dev_priv->vbt.psr.require_aux_wakeup && + !drm_dp_psr_need_train_on_exit(intel_dp->psr_dpcd)) val |= EDP_PSR_SKIP_AUX_EXIT; I915_WRITE(EDP_PSR_CTL, val); -- 2.7.4
[PATCH 6/6] drm/i915: Move psr.link_standby setup to intel_psr_match_conditions()
From: Ville Syrjälä Determine the value of psr.link_standby at runtime rather than at init time. This helps in testing since you can change between link-off and link-standby at runtime. Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_psr.c | 41 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c index 4db9c26fb970..8c70420cc6db 100644 --- a/drivers/gpu/drm/i915/intel_psr.c +++ b/drivers/gpu/drm/i915/intel_psr.c @@ -339,6 +339,27 @@ static bool intel_psr_match_conditions(struct intel_dp *intel_dp) WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); + /* Set link_standby x link_off defaults */ + if (IS_HASWELL(dev) || IS_BROADWELL(dev)) + /* HSW and BDW require workarounds that we don't implement. */ + dev_priv->psr.link_standby = false; + else if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) + /* On VLV and CHV only standby mode is supported. */ + dev_priv->psr.link_standby = true; + else + /* For new platforms let's respect VBT back again */ + dev_priv->psr.link_standby = dev_priv->vbt.psr.full_link; + + /* Override link_standby x link_off defaults */ + if (i915.enable_psr == 2 && !dev_priv->psr.link_standby) { + DRM_DEBUG_KMS("PSR: Forcing link standby\n"); + dev_priv->psr.link_standby = true; + } + if (i915.enable_psr == 3 && dev_priv->psr.link_standby) { + DRM_DEBUG_KMS("PSR: Forcing main link off\n"); + dev_priv->psr.link_standby = false; + } + dev_priv->psr.source_ok = false; /* @@ -830,26 +851,6 @@ void intel_psr_init(struct drm_device *dev) i915.enable_psr = 0; } - /* Set link_standby x link_off defaults */ - if (IS_HASWELL(dev) || IS_BROADWELL(dev)) - /* HSW and BDW require workarounds that we don't implement. */ - dev_priv->psr.link_standby = false; - else if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) - /* On VLV and CHV only standby mode is supported. */ - dev_priv->psr.link_standby = true; - else - /* For new platforms let's respect VBT back again */ - dev_priv->psr.link_standby = dev_priv->vbt.psr.full_link; - - /* Override link_standby x link_off defaults */ - if (i915.enable_psr == 2 && !dev_priv->psr.link_standby) { - DRM_DEBUG_KMS("PSR: Forcing link standby\n"); - dev_priv->psr.link_standby = true; - } - if (i915.enable_psr == 3 && dev_priv->psr.link_standby) { - DRM_DEBUG_KMS("PSR: Forcing main link off\n"); - dev_priv->psr.link_standby = false; - } INIT_DELAYED_WORK(&dev_priv->psr.work, intel_psr_work); mutex_init(&dev_priv->psr.lock); -- 2.7.4
[Bug 94860] [radeonsi/amdgpu][DCC] screen is corrupted when logging out of kde
https://bugs.freedesktop.org/show_bug.cgi?id=94860 --- Comment #8 from Laurent carlier --- My kde bugreport: https://bugs.kde.org/show_bug.cgi?id=361154 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/943c9c1a/attachment-0001.html>
[Bug 94860] [radeonsi/amdgpu][DCC] screen is corrupted when logging out of kde
https://bugs.freedesktop.org/show_bug.cgi?id=94860 --- Comment #9 from Laurent carlier --- Oups sorry, wrong cut&paste https://bugs.kde.org/show_bug.cgi?id=361933 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/91ce6f0c/attachment.html>
[Bug 93216] Artifacts with DCC when render target also texture
https://bugs.freedesktop.org/show_bug.cgi?id=93216 --- Comment #6 from Bas Nieuwenhuizen --- Does the series available at https://patchwork.freedesktop.org/series/8048/ fix this issue? -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/19e4e1a8/attachment.html>
[PATCH 2/4] drm/fb_helper: Fix references to dev->mode_config.num_connector
commit 255f0e7c418ad95a4baeda017ae6182ba9b3c423 upstream. During boot, MST hotplugs are generally expected (even if no physical hotplugging occurs) and result in DRM's connector topology changing. This means that using num_connector from the current mode configuration can lead to the number of connectors changing under us. This can lead to some nasty scenarios in fbcon: - We allocate an array to the size of dev->mode_config.num_connectors. - MST hotplug occurs, dev->mode_config.num_connectors gets incremented. - We try to loop through each element in the array using the new value of dev->mode_config.num_connectors, and end up going out of bounds since dev->mode_config.num_connectors is now larger then the array we allocated. fb_helper->connector_count however, will always remain consistent while we do a modeset in fb_helper. This fix is only required for 4.6 and below. David Airlie's patchseries for 4.7 to add connector reference counting provides a more proper fix for this. Changes since v1: - Remove leftover *dev variable from drm_pick_crtcs since it's not used now Upstream fix: 0552f7651bc2 ("drm/i915/mst: use reference counted connectors. (v3)") Reviewed-by: Daniel Vetter Signed-off-by: Lyude --- drivers/gpu/drm/drm_fb_helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 855108e..fe4df97 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1895,7 +1895,6 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper, int n, int width, int height) { int c, o; - struct drm_device *dev = fb_helper->dev; struct drm_connector *connector; const struct drm_connector_helper_funcs *connector_funcs; struct drm_encoder *encoder; @@ -1914,7 +1913,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper, if (modes[n] == NULL) return best_score; - crtcs = kzalloc(dev->mode_config.num_connector * + crtcs = kzalloc(fb_helper->connector_count * sizeof(struct drm_fb_helper_crtc *), GFP_KERNEL); if (!crtcs) return best_score; @@ -1960,7 +1959,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper, if (score > best_score) { best_score = score; memcpy(best_crtcs, crtcs, - dev->mode_config.num_connector * + fb_helper->connector_count * sizeof(struct drm_fb_helper_crtc *)); } } -- 2.5.5
[PATCH 4/4] drm/atomic: Verify connector->funcs != NULL when clearing states
Unfortunately since we don't have Dave's connector refcounting patch here yet, it's very possible that drm_atomic_state_default_clear() could get called by intel_display_resume() when intel_dp_mst_destroy_connector() isn't completely finished destroying an mst connector, but has already finished setting connector->funcs to NULL. As such, we need to treat the connector like it's already been destroyed and just skip it, otherwise we'll end up dereferencing a NULL pointer. This fix is only required for 4.6 and below. David Airlie's patchseries for 4.7 to add connector reference counting provides a more proper fix for this. Changes since v1: - Fix leftover whitespace Upstream fix: 0552f7651bc2 ("drm/i915/mst: use reference counted connectors. (v3)") Reviewed-by: Daniel Vetter Signed-off-by: Lyude --- drivers/gpu/drm/drm_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 8ee1db8..d307d96 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -139,7 +139,7 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state) for (i = 0; i < state->num_connector; i++) { struct drm_connector *connector = state->connectors[i]; - if (!connector) + if (!connector || !connector->funcs) continue; /* -- 2.5.5
[RFC v2] dma-mapping: Use unsigned long for dma_attrs
On Mon, May 30, 2016 at 01:54:06PM +0200, Krzysztof Kozlowski wrote: > The dma-mapping core and the implementations do not change the > DMA attributes passed by pointer. Thus the pointer can point to const > data. However the attributes do not have to be a bitfield. Instead > unsigned long will do fine: > > 1. This is just simpler. Both in terms of reading the code and setting >attributes. Instead of initializing local attributes on the stack and >passing pointer to it to dma_set_attr(), just set the bits. > > 2. It brings safeness and checking for const correctness because the >attributes are passed by value. > > Please have in mind that this is RFC, not finished yet. Only ARM and > ARM64 are fixed (and not everywhere). > However other API users also have to be converted which is quite > intrusive. I would rather avoid it until the overall approach is > accepted. This looks great! Please continue doing the full conversion. > +/** > + * List of possible attributes associated with a DMA mapping. The semantics > + * of each attribute should be defined in Documentation/DMA-attributes.txt. > + */ > +#define DMA_ATTR_WRITE_BARRIER BIT(1) > +#define DMA_ATTR_WEAK_ORDERING BIT(2) > +#define DMA_ATTR_WRITE_COMBINE BIT(3) > +#define DMA_ATTR_NON_CONSISTENT BIT(4) > +#define DMA_ATTR_NO_KERNEL_MAPPING BIT(5) > +#define DMA_ATTR_SKIP_CPU_SYNC BIT(6) > +#define DMA_ATTR_FORCE_CONTIGUOUSBIT(7) > +#define DMA_ATTR_ALLOC_SINGLE_PAGES BIT(8) No really for this patch, but I would much prefer to document them next to the code in the long run. Also I really think these BIT() macros are a distraction compared to the (1 << N) notation. > +/** > + * dma_get_attr - check for a specific attribute > + * @attr: attribute to look for > + * @attrs: attributes to check within > + */ > +static inline bool dma_get_attr(unsigned long attr, unsigned long attrs) > +{ > + return !!(attr & attrs); > +} I'd just kill this helper, much easier to simply open code it in the caller.
[PATCH 15/27] drm/vc4: Use lockless gem BO free callback
Daniel Vetter writes: > No dev->struct_mutex anywhere to be seen. The vc4 patches are: Reviewed-by: Eric Anholt -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/9d569ec0/attachment.sig>
[RFT v3] drm: use late_initcall() for amdkfd and radeon
On Tue, May 31, 2016 at 8:15 PM, Luis R. Rodriguez wrote: > On Sun, May 29, 2016 at 05:49:17PM +0300, Oded Gabbay wrote: >> On Fri, May 27, 2016 at 4:18 AM, Luis R. Rodriguez >> wrote: >> > diff --git a/drivers/gpu/drm/radeon/radeon_drv.c >> > b/drivers/gpu/drm/radeon/radeon_drv.c >> > index b55aa740171f..1fa1b7f3a89c 100644 >> > --- a/drivers/gpu/drm/radeon/radeon_drv.c >> > +++ b/drivers/gpu/drm/radeon/radeon_drv.c >> > @@ -609,7 +609,7 @@ static void __exit radeon_exit(void) >> > radeon_unregister_atpx_handler(); >> > } >> > >> > -module_init(radeon_init); >> > +late_initcall(radeon_init); >> > module_exit(radeon_exit); >> >> Need to modify also amdgpu module_init > > Thanks, so other than considering the first two hunks are only for testing > purposes > (a proper [PATCH] will drop these hunks on the Makefile), you're suggestng > this > then, is that right?: Yes, the below should cover the amdgpu case as well. > > --- > drivers/Makefile| 6 ++ > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- > drivers/gpu/drm/amd/amdkfd/kfd_module.c | 2 +- > drivers/gpu/drm/radeon/radeon_drv.c | 2 +- > 4 files changed, 5 insertions(+), 7 deletions(-) > > diff --git a/drivers/Makefile b/drivers/Makefile > index 0b6f3d60193d..0fbe3982041f 100644 > --- a/drivers/Makefile > +++ b/drivers/Makefile > @@ -50,10 +50,7 @@ obj-$(CONFIG_RESET_CONTROLLER) += reset/ > obj-y += tty/ > obj-y += char/ > > -# iommu/ comes before gpu as gpu are using iommu controllers > -obj-$(CONFIG_IOMMU_SUPPORT)+= iommu/ > - > -# gpu/ comes after char for AGP vs DRM startup and after iommu > +# gpu/ comes after char for AGP vs DRM startup > obj-y += gpu/ > > obj-$(CONFIG_CONNECTOR)+= connector/ > @@ -147,6 +144,7 @@ obj-y += clk/ > > obj-$(CONFIG_MAILBOX) += mailbox/ > obj-$(CONFIG_HWSPINLOCK) += hwspinlock/ > +obj-$(CONFIG_IOMMU_SUPPORT)+= iommu/ > obj-$(CONFIG_REMOTEPROC) += remoteproc/ > obj-$(CONFIG_RPMSG)+= rpmsg/ > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > index 1dab5f2b725b..1ca448f2b4d2 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > @@ -589,7 +589,7 @@ static void __exit amdgpu_exit(void) > amdgpu_sync_fini(); > } > > -module_init(amdgpu_init); > +late_initcall(amdgpu_init); > module_exit(amdgpu_exit); > > MODULE_AUTHOR(DRIVER_AUTHOR); > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c > b/drivers/gpu/drm/amd/amdkfd/kfd_module.c > index 850a5623661f..3d1dab8a31c7 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c > @@ -141,7 +141,7 @@ static void __exit kfd_module_exit(void) > dev_info(kfd_device, "Removed module\n"); > } > > -module_init(kfd_module_init); > +late_initcall(kfd_module_init); > module_exit(kfd_module_exit); > > MODULE_AUTHOR(KFD_DRIVER_AUTHOR); > diff --git a/drivers/gpu/drm/radeon/radeon_drv.c > b/drivers/gpu/drm/radeon/radeon_drv.c > index b55aa740171f..1fa1b7f3a89c 100644 > --- a/drivers/gpu/drm/radeon/radeon_drv.c > +++ b/drivers/gpu/drm/radeon/radeon_drv.c > @@ -609,7 +609,7 @@ static void __exit radeon_exit(void) > radeon_unregister_atpx_handler(); > } > > -module_init(radeon_init); > +late_initcall(radeon_init); > module_exit(radeon_exit); > > MODULE_AUTHOR(DRIVER_AUTHOR); > -- > 2.8.2 > > >> I tested this on Kaveri, and amdkfd is working. For amdkfd that's >> fine, but IMO that's not enough testing for radeon/amdgpu. I would >> like to hear AMD's developers take on this. > > Sure. Hopefully the above extensions suffice. In the future we should be able > to also replace the radeon amdkfd -EPROBE_DEFER kludge and the implicit > sensitivity in Makefiles over GPU drivers and IOMMUs, but a bit more work is > needed before that happens. > > Luis
[RFC v2] dma-mapping: Use unsigned long for dma_attrs
On Mon, May 30, 2016 at 01:54:06PM +0200, Krzysztof Kozlowski wrote: > The dma-mapping core and the implementations do not change the > DMA attributes passed by pointer. Thus the pointer can point to const > data. However the attributes do not have to be a bitfield. Instead > unsigned long will do fine: > > 1. This is just simpler. Both in terms of reading the code and setting >attributes. Instead of initializing local attributes on the stack and >passing pointer to it to dma_set_attr(), just set the bits. > > 2. It brings safeness and checking for const correctness because the >attributes are passed by value. .. why not go the next step a do an enum? Perhaps that should be mentioned as part of the description? Thanks. > > Please have in mind that this is RFC, not finished yet. Only ARM and > ARM64 are fixed (and not everywhere). > However other API users also have to be converted which is quite > intrusive. I would rather avoid it until the overall approach is > accepted. > > Signed-off-by: Krzysztof Kozlowski > --- > Documentation/DMA-API.txt | 2 +- > Documentation/DMA-attributes.txt | 2 +- > arch/arm/include/asm/dma-mapping.h| 13 ++-- > arch/arm/include/asm/xen/page-coherent.h | 16 ++--- > arch/arm/mm/dma-mapping.c | 82 +++ > arch/arm/xen/mm.c | 4 +- > arch/arm64/mm/dma-mapping.c | 57 > drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +- > drivers/gpu/drm/exynos/exynos_drm_g2d.c | 1 - > drivers/gpu/drm/exynos/exynos_drm_gem.c | 20 +++--- > drivers/gpu/drm/exynos/exynos_drm_gem.h | 2 +- > drivers/iommu/dma-iommu.c | 6 +- > drivers/xen/swiotlb-xen.c | 14 ++-- > include/linux/dma-attrs.h | 71 > include/linux/dma-iommu.h | 6 +- > include/linux/dma-mapping.h | 105 > +- > include/linux/swiotlb.h | 10 +-- > include/xen/swiotlb-xen.h | 12 ++-- > lib/dma-noop.c| 9 +-- > lib/swiotlb.c | 13 ++-- > 20 files changed, 195 insertions(+), 252 deletions(-) > delete mode 100644 include/linux/dma-attrs.h > > diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt > index 45ef3f279c3b..0b55cb7c5aaa 100644 > --- a/Documentation/DMA-API.txt > +++ b/Documentation/DMA-API.txt > @@ -391,7 +391,7 @@ without the _attrs suffixes, except that they pass an > optional > struct dma_attrs*. > > struct dma_attrs encapsulates a set of "DMA attributes". For the > -definition of struct dma_attrs see linux/dma-attrs.h. > +definition of struct dma_attrs see linux/dma-mapping.h. > > The interpretation of DMA attributes is architecture-specific, and > each attribute should be documented in Documentation/DMA-attributes.txt. > diff --git a/Documentation/DMA-attributes.txt > b/Documentation/DMA-attributes.txt > index e8cf9cf873b3..2d455a5cf671 100644 > --- a/Documentation/DMA-attributes.txt > +++ b/Documentation/DMA-attributes.txt > @@ -2,7 +2,7 @@ > == > > This document describes the semantics of the DMA attributes that are > -defined in linux/dma-attrs.h. > +defined in linux/dma-mapping.h. > > DMA_ATTR_WRITE_BARRIER > -- > diff --git a/arch/arm/include/asm/dma-mapping.h > b/arch/arm/include/asm/dma-mapping.h > index a83570f10124..d009f7911ffc 100644 > --- a/arch/arm/include/asm/dma-mapping.h > +++ b/arch/arm/include/asm/dma-mapping.h > @@ -5,7 +5,6 @@ > > #include > #include > -#include > #include > > #include > @@ -174,7 +173,7 @@ static inline void dma_mark_clean(void *addr, size_t > size) { } > * to be the device-viewed address. > */ > extern void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t > *handle, > -gfp_t gfp, struct dma_attrs *attrs); > +gfp_t gfp, unsigned long attrs); > > /** > * arm_dma_free - free memory allocated by arm_dma_alloc > @@ -191,7 +190,7 @@ extern void *arm_dma_alloc(struct device *dev, size_t > size, dma_addr_t *handle, > * during and after this call executing are illegal. > */ > extern void arm_dma_free(struct device *dev, size_t size, void *cpu_addr, > - dma_addr_t handle, struct dma_attrs *attrs); > + dma_addr_t handle, unsigned long attrs); > > /** > * arm_dma_mmap - map a coherent DMA allocation into user space > @@ -208,7 +207,7 @@ extern void arm_dma_free(struct device *dev, size_t size, > void *cpu_addr, > */ > extern int arm_dma_mmap(struct device *dev, struct vm_area_struct *vma, > void *cpu_addr, dma_addr_t dma_addr, size_t size, > - struct dma_attrs *attrs); > + unsigned long attrs); > > /* > * This can
[Bug 93217] [tonga] [powerplay] Radon M395X isn't initialised with the powerplay branch
https://bugs.freedesktop.org/show_bug.cgi?id=93217 --- Comment #33 from Alex Deucher --- What model laptop is this? -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/a6bb9a80/attachment.html>
[Bug 93217] [tonga] [powerplay] Radon M395X isn't initialised with the powerplay branch
https://bugs.freedesktop.org/show_bug.cgi?id=93217 --- Comment #34 from Mike Lothian --- Alienware 15 R2 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/54493392/attachment.html>
[RFT v3] drm: use late_initcall() for amdkfd and radeon
On Tue, May 31, 2016 at 06:58:34PM +0200, Luis R. Rodriguez wrote: > On Sun, May 29, 2016 at 08:27:07PM +0200, Daniel Vetter wrote: > > On Fri, May 27, 2016 at 3:18 AM, Luis R. Rodriguez > > wrote: > > > To get KFD support in radeon we need the following > > > initialization to happen in this order, their > > > respective driver file that has its init routine > > > listed next to it: > > > > > > 0. AMD IOMMUv1:arch/x86/kernel/pci-dma.c > > > 1. AMD IOMMUv2:drivers/iommu/amd_iommu_v2.c > > > 2. AMD KFD:drivers/gpu/drm/amd/amdkfd/kfd_module.c > > > 3. AMD Radeon: drivers/gpu/drm/radeon/radeon_drv.c > > > > > > Order is rather implicit, but these drivers can currently > > > only do so much given the amount of leg room available. > > > Below are the respective init routines and how they are > > > initialized: > > > > > > arch/x86/kernel/pci-dma.c rootfs_initcall(pci_iommu_init); > > > drivers/iommu/amd_iommu_v2.cmodule_init(amd_iommu_v2_init); > > > drivers/gpu/drm/amd/amdkfd/kfd_module.c module_init(kfd_module_init); > > > drivers/gpu/drm/radeon/radeon_drv.c module_init(radeon_init); > > > > > > When a driver is built-in module_init() folds to use > > > device_initcall(), and we have the following possible > > > orders: > > > > > > #define pure_initcall(fn)__define_initcall(fn, 0) > > > #define core_initcall(fn)__define_initcall(fn, 1) > > > #define postcore_initcall(fn)__define_initcall(fn, 2) > > > #define arch_initcall(fn)__define_initcall(fn, 3) > > > #define subsys_initcall(fn) __define_initcall(fn, 4) > > > #define fs_initcall(fn) __define_initcall(fn, 5) > > > - > > > #define rootfs_initcall(fn) __define_initcall(fn, rootfs) > > > #define device_initcall(fn) __define_initcall(fn, 6) > > > #define late_initcall(fn)__define_initcall(fn, 7) > > > > > > Since we start off from rootfs_initcall(), it gives us 3 more > > > levels of leg room to play with for order semantics, this isn't > > > enough to address all required levels of dependencies, this > > > is specially true given that AMD-KFD needs to be loaded before > > > the radeon driver -- -but this it not enforced by symbols. > > > If the AMD-KFD driver is not loaded prior to the radeon driver > > > because otherwise the radeon driver will not initialize the > > > AMD-KFD driver and you get no KFD functionality in userspace. > > > > > > Commit 1bacc894c227fad8a7 ("drivers: Move iommu/ before gpu/ in > > > Makefile") works around some of the possibe races between > > > the AMD IOMMU v2 and GPU drivers by changing the link order. > > > This is fragile, however its the bets we can do, given that > > > making the GPU drivers use late_initcall() would also implicate > > > a similar race between them. That possible race is fortunatley > > > addressed given that the drm Makefile currently has amdkfd > > > linked prior to radeon: > > > > > > drivers/gpu/drm/Makefile > > > ... > > > obj-$(CONFIG_HSA_AMD) += amd/amdkfd/ > > > obj-$(CONFIG_DRM_RADEON)+= radeon/ > > > ... > > > > > > Changing amdkfd and radeon to late_initcall() however is > > > still the right call in orde to annotate explicitly a > > > delayed dependency requirement between the GPU drivers > > > and the IOMMUs. > > > > > > We can't address the fragile nature of the link order > > > right now, but in the future that might be possible. > > > > > > Signed-off-by: Luis R. Rodriguez > > > --- > > > > > > Please note, the changes to drivers/Makefile are just > > > for the sake of forcing the possible race to occur, > > > if this works well the actual [PATCH] submission will > > > skip those changes as its pointless to remove those > > > work arounds as it stands, due to the limited nature > > > of the levels available for addressing requirements. > > > > > > Also, if you are aware of further dependency hell > > > things like these -- please do let me know as I am > > > interested in looking at addressing them. > > > > This should be fixed with -EDEFER_PROBE instead. Frobbing initcall > > levels should then just be done as an optimization to avoid too much > > reprobing. > > radeon already uses -EDEFER_PROBE but it assumes that amdkfd *is* loaded > first, > and only if it is already loaded can it count on getting -EDEFER_PROBE. The > radeon driver will deffer probe *iff* kgd2kfd_init() returns -EDEFER_PROBE, > which only happens when amdkfd_init_completed is no longer present. If radeon > gets linked first though the symbol fetch for kgd2kfd_init() will make it as > not-present though. So the current heuristic used does not address proper link > / load order. Part of the issue mentioned on the commit log is another race > underneath the hood with the AMD IOMMU v2 which is needed for amdkfd. The > underlying issue however really is the lack of available clear semantics for > dependencies over
[PATCH 0/6] drm/i915: Remaining PSR fixes
On Tue, May 31, 2016 at 06:50:24PM +0300, ville.syrjala at linux.intel.com wrote: > From: Ville Syrjälä > > Here's a repost of my PSR fixes, and one straggler from Daniel. > > One interesting thing I noticed is that my SKL actually hits the PSR setup > time vs. vblank length check, so after these patches that machine won't > actually use PSR. The panel does support a lower refresh rate timing as well > though which doesn't suffer from this limitation, so I hacked the code to > use that mode instead, and PSR did seem to work without problems. With the > original mode I had some screen stalls while running xonotic, which I'm > going to assume were due to the setup time exceeding the safe limit. Hm, is there a way to make that hack less hackish and merge it? Selecting a mode with slightly different timings (but same resolution ofc) to make PSR possible seems like a very sensible idea. Or is this a 60Hz vs 30Hz kind of thing? Scrolled through patches, still lgtm. -Daniel > > I also hooked up the PSR interrupts for BDW+ and pushed the patches to [1], > but I'm not including those patches here since the PSR interrupts don't > seem to gain us anything useful in practice. > > [1] git://github.com/vsyrjala/linux.git psr_interrupts > > Daniel Vetter (1): > drm/i915/psr: Skip aux handeshake if the vbt tells us to > > Ville Syrjälä (5): > drm/dp: Add drm_dp_psr_setup_time() > drm/dp: Add drm_dp_psr_need_train_on_exit() > drm/i915: Check PSR setup time vs. vblank length > drm/i915: Ask the sink whether training is required when exiting PSR > main-link off mode > drm/i915: Move psr.link_standby setup to intel_psr_match_conditions() > > drivers/gpu/drm/drm_dp_helper.c | 46 ++ > drivers/gpu/drm/i915/intel_drv.h| 2 ++ > drivers/gpu/drm/i915/intel_psr.c| 64 > + > drivers/gpu/drm/i915/intel_sprite.c | 6 ++-- > include/drm/drm_dp_helper.h | 3 ++ > 5 files changed, 97 insertions(+), 24 deletions(-) > > -- > 2.7.4 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH 15/27] drm/vc4: Use lockless gem BO free callback
On Tue, May 31, 2016 at 10:23:32AM -0700, Eric Anholt wrote: > Daniel Vetter writes: > > > No dev->struct_mutex anywhere to be seen. > > The vc4 patches are: > > Reviewed-by: Eric Anholt Thanks for the review, both applied to drm-misc. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH 0/6] drm/i915: Remaining PSR fixes
On Tue, May 31, 2016 at 09:07:49PM +0200, Daniel Vetter wrote: > On Tue, May 31, 2016 at 06:50:24PM +0300, ville.syrjala at linux.intel.com > wrote: > > From: Ville Syrjälä > > > > Here's a repost of my PSR fixes, and one straggler from Daniel. > > > > One interesting thing I noticed is that my SKL actually hits the PSR setup > > time vs. vblank length check, so after these patches that machine won't > > actually use PSR. The panel does support a lower refresh rate timing as well > > though which doesn't suffer from this limitation, so I hacked the code to > > use that mode instead, and PSR did seem to work without problems. With the > > original mode I had some screen stalls while running xonotic, which I'm > > going to assume were due to the setup time exceeding the safe limit. > > Hm, is there a way to make that hack less hackish and merge it? Selecting > a mode with slightly different timings (but same resolution ofc) to make > PSR possible seems like a very sensible idea. Or is this a 60Hz vs 30Hz > kind of thing? 60 vs. 48 in this case, so might not want it as a default. However this is not a production machine anyway, so I wouldn't worry about it too much unless someone comes across a real machine with a similar setup. > > Scrolled through patches, still lgtm. > -Daniel > > > > > I also hooked up the PSR interrupts for BDW+ and pushed the patches to [1], > > but I'm not including those patches here since the PSR interrupts don't > > seem to gain us anything useful in practice. > > > > [1] git://github.com/vsyrjala/linux.git psr_interrupts > > > > Daniel Vetter (1): > > drm/i915/psr: Skip aux handeshake if the vbt tells us to > > > > Ville Syrjälä (5): > > drm/dp: Add drm_dp_psr_setup_time() > > drm/dp: Add drm_dp_psr_need_train_on_exit() > > drm/i915: Check PSR setup time vs. vblank length > > drm/i915: Ask the sink whether training is required when exiting PSR > > main-link off mode > > drm/i915: Move psr.link_standby setup to intel_psr_match_conditions() > > > > drivers/gpu/drm/drm_dp_helper.c | 46 ++ > > drivers/gpu/drm/i915/intel_drv.h| 2 ++ > > drivers/gpu/drm/i915/intel_psr.c| 64 > > + > > drivers/gpu/drm/i915/intel_sprite.c | 6 ++-- > > include/drm/drm_dp_helper.h | 3 ++ > > 5 files changed, 97 insertions(+), 24 deletions(-) > > > > -- > > 2.7.4 > > > > ___ > > dri-devel mailing list > > dri-devel at lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch -- Ville Syrjälä Intel OTC
[PATCH 00/18] staging/android: clean up SW_SYNC
From: Gustavo Padovan Hi, The following patches do a clean up on the sw_sync inteface. It starts by removing struct sync_timeline_ops, which was creating unecessary wrappers in the code and the start to organize the sync_timeline and sw_sync code better. sw_sync interface was moved to sw_sync.c along with sync_timeline - which is now internal to sw_sync. The next step after this work is the actual de-stage of SW_SYNC and the upstreaming of selftests for sw_sync and sync_file. Please review! Gustavo --- Gustavo Padovan (18): staging/android: store last signaled value on sync timeline staging/android: remove .{fence,timeline}_value_str() from timeline_ops staging/android: remove struct sync_timeline_ops staging/android: remove sw_sync_timeline and sw_sync_pt staging/android: remove sw_sync.[ch] files staging/android: rename android_fence to timeline_fence staging/android: remove unnecessary check for fence staging/android: remove size arg of sync_timeline_create() staging/android: bring struct sync_pt back staging/android: move sw_sync related code to sw_sync.c staging/android: clean up #includes in the sync framework staging/android: make sync_timeline internal to sw_sync staging/android: make sw_ioctl info internal to sw_sync.c staging/android: remove 'destroyed' member from struct sync_timeline staging/android: remove sync_timeline_destroy() staging/android: remove drv_name from sync_timeline staging/android: rename sync.h to sync_debug.h staging/android: add DEBUG_FS dependence on Kconfig drivers/staging/android/Kconfig| 17 +- drivers/staging/android/Makefile | 3 +- drivers/staging/android/sw_sync.c | 341 - drivers/staging/android/sw_sync.h | 59 -- drivers/staging/android/sync.c | 221 - drivers/staging/android/sync.h | 154 --- drivers/staging/android/sync_debug.c | 154 +-- drivers/staging/android/sync_debug.h | 83 drivers/staging/android/trace/sync.h | 14 +- drivers/staging/android/uapi/sw_sync.h | 32 include/linux/fence.h | 2 - 11 files changed, 399 insertions(+), 681 deletions(-) delete mode 100644 drivers/staging/android/sw_sync.h delete mode 100644 drivers/staging/android/sync.c delete mode 100644 drivers/staging/android/sync.h create mode 100644 drivers/staging/android/sync_debug.h delete mode 100644 drivers/staging/android/uapi/sw_sync.h -- 2.5.5
[PATCH 01/18] staging/android: store last signaled value on sync timeline
From: Gustavo Padovan Now fence timeline is aware of the last signaled fence, as it receives the increment to the current value in sync_timeline_signal(). That allow us to remove .has_signaled() from timeline_ops as we can directly compare using timeline->value and fence->seqno in sync.c Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c | 16 ++-- drivers/staging/android/sync.c| 15 +++ drivers/staging/android/sync.h| 14 +- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index af39ff5..428e22c 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -30,7 +30,7 @@ struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value) struct sw_sync_pt *pt; pt = (struct sw_sync_pt *) - sync_pt_create(&obj->obj, sizeof(struct sw_sync_pt)); + sync_pt_create(&obj->obj, sizeof(struct sw_sync_pt), value); pt->value = value; @@ -38,15 +38,6 @@ struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value) } EXPORT_SYMBOL(sw_sync_pt_create); -static int sw_sync_fence_has_signaled(struct fence *fence) -{ - struct sw_sync_pt *pt = (struct sw_sync_pt *)fence; - struct sw_sync_timeline *obj = - (struct sw_sync_timeline *)fence_parent(fence); - - return (pt->value > obj->value) ? 0 : 1; -} - static void sw_sync_timeline_value_str(struct sync_timeline *sync_timeline, char *str, int size) { @@ -64,7 +55,6 @@ static void sw_sync_fence_value_str(struct fence *fence, char *str, int size) static struct sync_timeline_ops sw_sync_timeline_ops = { .driver_name = "sw_sync", - .has_signaled = sw_sync_fence_has_signaled, .timeline_value_str = sw_sync_timeline_value_str, .fence_value_str = sw_sync_fence_value_str, }; @@ -82,8 +72,6 @@ EXPORT_SYMBOL(sw_sync_timeline_create); void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc) { - obj->value += inc; - - sync_timeline_signal(&obj->obj); + sync_timeline_signal(&obj->obj, inc); } EXPORT_SYMBOL(sw_sync_timeline_inc); diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 1d14c83..8dd2181 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -90,7 +90,7 @@ void sync_timeline_destroy(struct sync_timeline *obj) } EXPORT_SYMBOL(sync_timeline_destroy); -void sync_timeline_signal(struct sync_timeline *obj) +void sync_timeline_signal(struct sync_timeline *obj, unsigned int inc) { unsigned long flags; struct fence *fence, *next; @@ -99,6 +99,8 @@ void sync_timeline_signal(struct sync_timeline *obj) spin_lock_irqsave(&obj->child_list_lock, flags); + obj->value += inc; + list_for_each_entry_safe(fence, next, &obj->active_list_head, active_list) { if (fence_is_signaled_locked(fence)) @@ -109,7 +111,8 @@ void sync_timeline_signal(struct sync_timeline *obj) } EXPORT_SYMBOL(sync_timeline_signal); -struct fence *sync_pt_create(struct sync_timeline *obj, int size) +struct fence *sync_pt_create(struct sync_timeline *obj, int size, +unsigned int value) { unsigned long flags; struct fence *fence; @@ -124,7 +127,7 @@ struct fence *sync_pt_create(struct sync_timeline *obj, int size) spin_lock_irqsave(&obj->child_list_lock, flags); sync_timeline_get(obj); fence_init(fence, &android_fence_ops, &obj->child_list_lock, - obj->context, ++obj->value); + obj->context, value); list_add_tail(&fence->child_list, &obj->child_list_head); INIT_LIST_HEAD(&fence->active_list); spin_unlock_irqrestore(&obj->child_list_lock, flags); @@ -164,12 +167,8 @@ static void android_fence_release(struct fence *fence) static bool android_fence_signaled(struct fence *fence) { struct sync_timeline *parent = fence_parent(fence); - int ret; - ret = parent->ops->has_signaled(fence); - if (ret < 0) - fence->status = ret; - return ret; + return (fence->seqno > parent->value) ? false : true; } static bool android_fence_enable_signaling(struct fence *fence) diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index b56885c..627525c 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -28,19 +28,12 @@ struct sync_timeline; /** * struct sync_timeline_ops - sync object implementation ops * @driver_name: name of the implementation - * @has_signaled: returns: - * 1 if pt has signaled - * 0 if pt has not signaled - * <0 on error * @timeline_value_str: fill str with the value of the syn
[PATCH 02/18] staging/android: remove .{fence, timeline}_value_str() from timeline_ops
From: Gustavo Padovan Now that the value of fence and the timeline are not stored by sw_sync anymore we can remove this extra abstraction to retrieve this data. This patch changes both fence_ops (.fence_value_str and .timeline_value_str) to return the str directly. It also clean up struct sync_timeline_ops by removing both ops from there. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c| 17 - drivers/staging/android/sync.c | 16 ++-- drivers/staging/android/sync.h | 9 - drivers/staging/android/sync_debug.c | 12 ++-- drivers/staging/android/trace/sync.h | 12 +++- 5 files changed, 7 insertions(+), 59 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index 428e22c..4200b12 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -38,25 +38,8 @@ struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value) } EXPORT_SYMBOL(sw_sync_pt_create); -static void sw_sync_timeline_value_str(struct sync_timeline *sync_timeline, - char *str, int size) -{ - struct sw_sync_timeline *timeline = - (struct sw_sync_timeline *)sync_timeline; - snprintf(str, size, "%d", timeline->value); -} - -static void sw_sync_fence_value_str(struct fence *fence, char *str, int size) -{ - struct sw_sync_pt *pt = (struct sw_sync_pt *)fence; - - snprintf(str, size, "%d", pt->value); -} - static struct sync_timeline_ops sw_sync_timeline_ops = { .driver_name = "sw_sync", - .timeline_value_str = sw_sync_timeline_value_str, - .fence_value_str = sw_sync_fence_value_str, }; struct sw_sync_timeline *sw_sync_timeline_create(const char *name) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 8dd2181..c75d1e6 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -185,14 +185,7 @@ static bool android_fence_enable_signaling(struct fence *fence) static void android_fence_value_str(struct fence *fence, char *str, int size) { - struct sync_timeline *parent = fence_parent(fence); - - if (!parent->ops->fence_value_str) { - if (size) - *str = 0; - return; - } - parent->ops->fence_value_str(fence, str, size); + snprintf(str, size, "%d", fence->seqno); } static void android_fence_timeline_value_str(struct fence *fence, @@ -200,12 +193,7 @@ static void android_fence_timeline_value_str(struct fence *fence, { struct sync_timeline *parent = fence_parent(fence); - if (!parent->ops->timeline_value_str) { - if (size) - *str = 0; - return; - } - parent->ops->timeline_value_str(parent, str, size); + snprintf(str, size, "%d", parent->value); } static const struct fence_ops android_fence_ops = { diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 627525c..29f8c19 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -28,18 +28,9 @@ struct sync_timeline; /** * struct sync_timeline_ops - sync object implementation ops * @driver_name: name of the implementation - * @timeline_value_str: fill str with the value of the sync_timeline's counter - * @fence_value_str: fill str with the value of the fence */ struct sync_timeline_ops { const char *driver_name; - - /* optional */ - void (*timeline_value_str)(struct sync_timeline *timeline, char *str, - int size); - - /* optional */ - void (*fence_value_str)(struct fence *fence, char *str, int size); }; /** diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index 5f57499..c532457 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -133,16 +133,8 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj) struct list_head *pos; unsigned long flags; - seq_printf(s, "%s %s", obj->name, obj->ops->driver_name); - - if (obj->ops->timeline_value_str) { - char value[64]; - - obj->ops->timeline_value_str(obj, value, sizeof(value)); - seq_printf(s, ": %s", value); - } - - seq_puts(s, "\n"); + seq_printf(s, "%s %s: %d\n", obj->name, obj->ops->driver_name, + obj->value); spin_lock_irqsave(&obj->child_list_lock, flags); list_for_each(pos, &obj->child_list_head) { diff --git a/drivers/staging/android/trace/sync.h b/drivers/staging/android/trace/sync.h index a0f80f4..d7f6457f 100644 --- a/drivers/staging/android/trace/sync.h +++ b/drivers/staging/android/trace/sync.h @@ -15,21 +15,15 @@ TRACE_EVENT(sync_timeline, TP_STRUCT__e
[PATCH 04/18] staging/android: remove sw_sync_timeline and sw_sync_pt
From: Gustavo Padovan As we moved value storage to sync_timeline and fence those two structs became useless and can be removed now. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c| 24 +++- drivers/staging/android/sw_sync.h| 24 ++-- drivers/staging/android/sync_debug.c | 12 ++-- 3 files changed, 19 insertions(+), 41 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index c5e92c6..461dbd9 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -25,31 +25,21 @@ #include "sw_sync.h" -struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value) +struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value) { - struct sw_sync_pt *pt; - - pt = (struct sw_sync_pt *) - sync_pt_create(&obj->obj, sizeof(struct sw_sync_pt), value); - - pt->value = value; - - return (struct fence *)pt; + return sync_pt_create(obj, sizeof(struct fence), value); } EXPORT_SYMBOL(sw_sync_pt_create); -struct sw_sync_timeline *sw_sync_timeline_create(const char *name) +struct sync_timeline *sw_sync_timeline_create(const char *name) { - struct sw_sync_timeline *obj = (struct sw_sync_timeline *) - sync_timeline_create(sizeof(struct sw_sync_timeline), -"sw_sync", name); - - return obj; + return sync_timeline_create(sizeof(struct sync_timeline), + "sw_sync", name); } EXPORT_SYMBOL(sw_sync_timeline_create); -void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc) +void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc) { - sync_timeline_signal(&obj->obj, inc); + sync_timeline_signal(obj, inc); } EXPORT_SYMBOL(sw_sync_timeline_inc); diff --git a/drivers/staging/android/sw_sync.h b/drivers/staging/android/sw_sync.h index e18667b..9f26c62 100644 --- a/drivers/staging/android/sw_sync.h +++ b/drivers/staging/android/sw_sync.h @@ -22,34 +22,22 @@ #include "sync.h" #include "uapi/sw_sync.h" -struct sw_sync_timeline { - struct sync_timeline obj; - - u32 value; -}; - -struct sw_sync_pt { - struct fencept; - - u32 value; -}; - #if IS_ENABLED(CONFIG_SW_SYNC) -struct sw_sync_timeline *sw_sync_timeline_create(const char *name); -void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc); +struct sync_timeline *sw_sync_timeline_create(const char *name); +void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc); -struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value); +struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value); #else -static inline struct sw_sync_timeline *sw_sync_timeline_create(const char *name) +static inline struct sync_timeline *sw_sync_timeline_create(const char *name) { return NULL; } -static inline void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc) +static inline void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc) { } -static inline struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, +static inline struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value) { return NULL; diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index e5634f2..e207a4d 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -209,7 +209,7 @@ static const struct file_operations sync_info_debugfs_fops = { /* opening sw_sync create a new sync obj */ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) { - struct sw_sync_timeline *obj; + struct sync_timeline *obj; char task_comm[TASK_COMM_LEN]; get_task_comm(task_comm, current); @@ -225,13 +225,13 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) static int sw_sync_debugfs_release(struct inode *inode, struct file *file) { - struct sw_sync_timeline *obj = file->private_data; + struct sync_timeline *obj = file->private_data; - sync_timeline_destroy(&obj->obj); + sync_timeline_destroy(obj); return 0; } -static long sw_sync_ioctl_create_fence(struct sw_sync_timeline *obj, +static long sw_sync_ioctl_create_fence(struct sync_timeline *obj, unsigned long arg) { int fd = get_unused_fd_flags(O_CLOEXEC); @@ -277,7 +277,7 @@ err: return err; } -static long sw_sync_ioctl_inc(struct sw_sync_timeline *obj, unsigned long arg) +static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg) { u32 value; @@ -292,7 +292,7 @@ static long sw_sync_ioctl_inc(struct sw_sync_timeline *obj, unsigned long arg) static long sw_sync_ioctl(struct file *file, unsigned int
[PATCH 03/18] staging/android: remove struct sync_timeline_ops
From: Gustavo Padovan Move drv_name, the last field of sync_timeline_ops, to sync_timeline and remove sync_timeline_ops. struct sync_timeline_ops was just an extra abstraction on top of fence_ops, and in the last few commits we removed all it ops in favor of cleaner fence_ops. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c| 9 ++--- drivers/staging/android/sync.c | 8 drivers/staging/android/sync.h | 28 +--- drivers/staging/android/sync_debug.c | 3 +-- 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index 4200b12..c5e92c6 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -38,16 +38,11 @@ struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value) } EXPORT_SYMBOL(sw_sync_pt_create); -static struct sync_timeline_ops sw_sync_timeline_ops = { - .driver_name = "sw_sync", -}; - struct sw_sync_timeline *sw_sync_timeline_create(const char *name) { struct sw_sync_timeline *obj = (struct sw_sync_timeline *) - sync_timeline_create(&sw_sync_timeline_ops, -sizeof(struct sw_sync_timeline), -name); + sync_timeline_create(sizeof(struct sw_sync_timeline), +"sw_sync", name); return obj; } diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index c75d1e6..b3efcaa 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -30,8 +30,8 @@ static const struct fence_ops android_fence_ops; -struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, - int size, const char *name) +struct sync_timeline *sync_timeline_create(int size, const char *drv_name, + const char *name) { struct sync_timeline *obj; @@ -43,9 +43,9 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, return NULL; kref_init(&obj->kref); - obj->ops = ops; obj->context = fence_context_alloc(1); strlcpy(obj->name, name, sizeof(obj->name)); + strlcpy(obj->drv_name, drv_name, sizeof(obj->drv_name)); INIT_LIST_HEAD(&obj->child_list_head); INIT_LIST_HEAD(&obj->active_list_head); @@ -139,7 +139,7 @@ static const char *android_fence_get_driver_name(struct fence *fence) { struct sync_timeline *parent = fence_parent(fence); - return parent->ops->driver_name; + return parent->drv_name; } static const char *android_fence_get_timeline_name(struct fence *fence) diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 29f8c19..f003e97 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -23,20 +23,10 @@ #include #include -struct sync_timeline; - -/** - * struct sync_timeline_ops - sync object implementation ops - * @driver_name: name of the implementation - */ -struct sync_timeline_ops { - const char *driver_name; -}; - /** * struct sync_timeline - sync object * @kref: reference count on fence. - * @ops: ops that define the implementation of the sync_timeline + * @drv_name: drv_name of the driver using the sync_timeline * @name: name of the sync_timeline. Useful for debugging * @destroyed: set when sync_timeline is destroyed * @child_list_head: list of children sync_pts for this sync_timeline @@ -47,7 +37,7 @@ struct sync_timeline_ops { */ struct sync_timeline { struct kref kref; - const struct sync_timeline_ops *ops; + chardrv_name[32]; charname[32]; /* protected by child_list_lock */ @@ -76,17 +66,17 @@ static inline struct sync_timeline *fence_parent(struct fence *fence) /** * sync_timeline_create() - creates a sync object - * @ops: specifies the implementation ops for the object * @size: size to allocate for this obj + * @drv_name: sync_timeline driver name * @name: sync_timeline name * - * Creates a new sync_timeline which will use the implementation specified by - * @ops. @size bytes will be allocated allowing for implementation specific - * data to be kept after the generic sync_timeline struct. Returns the - * sync_timeline object or NULL in case of error. + * Creates a new sync_timeline. @size bytes will be allocated allowing + * for implementation specific data to be kept after the generic + * sync_timeline struct. Returns the sync_timeline object or NULL in + * case of error. */ -struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, - int size, const char *name); +stru
[PATCH 05/18] staging/android: remove sw_sync.[ch] files
From: Gustavo Padovan We can glue the sw_sync file operations directly on the sync framework without the need to pass through sw_sync wrappers. It only builds sw_sync debugfs file support if CONFIG_SW_SYNC is enabled. Signed-off-by: Gustavo Padovan --- drivers/staging/android/Makefile | 1 - drivers/staging/android/sw_sync.c| 45 -- drivers/staging/android/sw_sync.h| 47 drivers/staging/android/sync_debug.c | 17 ++--- 4 files changed, 13 insertions(+), 97 deletions(-) delete mode 100644 drivers/staging/android/sw_sync.c delete mode 100644 drivers/staging/android/sw_sync.h diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile index 980d6dc..bf45967 100644 --- a/drivers/staging/android/Makefile +++ b/drivers/staging/android/Makefile @@ -5,4 +5,3 @@ obj-y += ion/ obj-$(CONFIG_ASHMEM) += ashmem.o obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER)+= lowmemorykiller.o obj-$(CONFIG_SYNC) += sync.o sync_debug.o -obj-$(CONFIG_SW_SYNC) += sw_sync.o diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c deleted file mode 100644 index 461dbd9..000 --- a/drivers/staging/android/sw_sync.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * drivers/base/sw_sync.c - * - * Copyright (C) 2012 Google, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sw_sync.h" - -struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value) -{ - return sync_pt_create(obj, sizeof(struct fence), value); -} -EXPORT_SYMBOL(sw_sync_pt_create); - -struct sync_timeline *sw_sync_timeline_create(const char *name) -{ - return sync_timeline_create(sizeof(struct sync_timeline), - "sw_sync", name); -} -EXPORT_SYMBOL(sw_sync_timeline_create); - -void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc) -{ - sync_timeline_signal(obj, inc); -} -EXPORT_SYMBOL(sw_sync_timeline_inc); diff --git a/drivers/staging/android/sw_sync.h b/drivers/staging/android/sw_sync.h deleted file mode 100644 index 9f26c62..000 --- a/drivers/staging/android/sw_sync.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * include/linux/sw_sync.h - * - * Copyright (C) 2012 Google, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef _LINUX_SW_SYNC_H -#define _LINUX_SW_SYNC_H - -#include -#include -#include "sync.h" -#include "uapi/sw_sync.h" - -#if IS_ENABLED(CONFIG_SW_SYNC) -struct sync_timeline *sw_sync_timeline_create(const char *name); -void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc); - -struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value); -#else -static inline struct sync_timeline *sw_sync_timeline_create(const char *name) -{ - return NULL; -} - -static inline void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc) -{ -} - -static inline struct fence *sw_sync_pt_create(struct sync_timeline *obj, - u32 value) -{ - return NULL; -} -#endif /* IS_ENABLED(CONFIG_SW_SYNC) */ - -#endif /* _LINUX_SW_SYNC_H */ diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index e207a4d..dc85d5f 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -27,7 +27,11 @@ #include #include #include -#include "sw_sync.h" +#include +#include + +#include "uapi/sw_sync.h" +#include "sync.h" #ifdef CONFIG_DEBUG_FS @@ -200,6 +204,7 @@ static const struct file_operations sync_info_debugfs_fops = { .release= single_release, }; +#if IS_ENABLED(CONFIG_SW_SYNC) /* * *WARNING* * @@ -214,7 +219,7 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) get_task_comm(task_comm, current); - obj = sw_sync_timeline_create(task_comm); + obj = sync_timeline_create(sizeof(*obj), "sw_sync", task_comm); if (!obj) retu
[PATCH 06/18] staging/android: rename android_fence to timeline_fence
From: Gustavo Padovan We are moving out of staging/android so rename it to a name that is not related to android anymore. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sync.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index b3efcaa..442d808 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -28,7 +28,7 @@ #define CREATE_TRACE_POINTS #include "trace/sync.h" -static const struct fence_ops android_fence_ops; +static const struct fence_ops timeline_fence_ops; struct sync_timeline *sync_timeline_create(int size, const char *drv_name, const char *name) @@ -126,7 +126,7 @@ struct fence *sync_pt_create(struct sync_timeline *obj, int size, spin_lock_irqsave(&obj->child_list_lock, flags); sync_timeline_get(obj); - fence_init(fence, &android_fence_ops, &obj->child_list_lock, + fence_init(fence, &timeline_fence_ops, &obj->child_list_lock, obj->context, value); list_add_tail(&fence->child_list, &obj->child_list_head); INIT_LIST_HEAD(&fence->active_list); @@ -135,21 +135,21 @@ struct fence *sync_pt_create(struct sync_timeline *obj, int size, } EXPORT_SYMBOL(sync_pt_create); -static const char *android_fence_get_driver_name(struct fence *fence) +static const char *timeline_fence_get_driver_name(struct fence *fence) { struct sync_timeline *parent = fence_parent(fence); return parent->drv_name; } -static const char *android_fence_get_timeline_name(struct fence *fence) +static const char *timeline_fence_get_timeline_name(struct fence *fence) { struct sync_timeline *parent = fence_parent(fence); return parent->name; } -static void android_fence_release(struct fence *fence) +static void timeline_fence_release(struct fence *fence) { struct sync_timeline *parent = fence_parent(fence); unsigned long flags; @@ -164,31 +164,31 @@ static void android_fence_release(struct fence *fence) fence_free(fence); } -static bool android_fence_signaled(struct fence *fence) +static bool timeline_fence_signaled(struct fence *fence) { struct sync_timeline *parent = fence_parent(fence); return (fence->seqno > parent->value) ? false : true; } -static bool android_fence_enable_signaling(struct fence *fence) +static bool timeline_fence_enable_signaling(struct fence *fence) { struct sync_timeline *parent = fence_parent(fence); - if (android_fence_signaled(fence)) + if (timeline_fence_signaled(fence)) return false; list_add_tail(&fence->active_list, &parent->active_list_head); return true; } -static void android_fence_value_str(struct fence *fence, +static void timeline_fence_value_str(struct fence *fence, char *str, int size) { snprintf(str, size, "%d", fence->seqno); } -static void android_fence_timeline_value_str(struct fence *fence, +static void timeline_fence_timeline_value_str(struct fence *fence, char *str, int size) { struct sync_timeline *parent = fence_parent(fence); @@ -196,13 +196,13 @@ static void android_fence_timeline_value_str(struct fence *fence, snprintf(str, size, "%d", parent->value); } -static const struct fence_ops android_fence_ops = { - .get_driver_name = android_fence_get_driver_name, - .get_timeline_name = android_fence_get_timeline_name, - .enable_signaling = android_fence_enable_signaling, - .signaled = android_fence_signaled, +static const struct fence_ops timeline_fence_ops = { + .get_driver_name = timeline_fence_get_driver_name, + .get_timeline_name = timeline_fence_get_timeline_name, + .enable_signaling = timeline_fence_enable_signaling, + .signaled = timeline_fence_signaled, .wait = fence_default_wait, - .release = android_fence_release, - .fence_value_str = android_fence_value_str, - .timeline_value_str = android_fence_timeline_value_str, + .release = timeline_fence_release, + .fence_value_str = timeline_fence_value_str, + .timeline_value_str = timeline_fence_timeline_value_str, }; -- 2.5.5
[PATCH 07/18] staging/android: remove unnecessary check for fence
From: Gustavo Padovan When we call sync_print_fence() fence is always valid. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sync_debug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index dc85d5f..6282046 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -109,7 +109,7 @@ static void sync_print_fence(struct seq_file *s, struct fence *fence, bool show) seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec); } - if ((!fence || fence->ops->timeline_value_str) && + if (fence->ops->timeline_value_str && fence->ops->fence_value_str) { char value[64]; bool success; @@ -117,10 +117,9 @@ static void sync_print_fence(struct seq_file *s, struct fence *fence, bool show) fence->ops->fence_value_str(fence, value, sizeof(value)); success = strlen(value); - if (success) + if (success) { seq_printf(s, ": %s", value); - if (success && fence) { fence->ops->timeline_value_str(fence, value, sizeof(value)); -- 2.5.5
[PATCH 08/18] staging/android: remove size arg of sync_timeline_create()
From: Gustavo Padovan After we removed sw_sync_timeline this arg has not been really used by anyone, all its users pass the size of struct sync_timeline there. So simplify this function but not requiring the size anymore. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sync.c | 7 ++- drivers/staging/android/sync.h | 7 ++- drivers/staging/android/sync_debug.c | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 442d808..c83a599 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -30,15 +30,12 @@ static const struct fence_ops timeline_fence_ops; -struct sync_timeline *sync_timeline_create(int size, const char *drv_name, +struct sync_timeline *sync_timeline_create(const char *drv_name, const char *name) { struct sync_timeline *obj; - if (size < sizeof(struct sync_timeline)) - return NULL; - - obj = kzalloc(size, GFP_KERNEL); + obj = kzalloc(sizeof(*obj), GFP_KERNEL); if (!obj) return NULL; diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index f003e97..f2fbf98 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -66,16 +66,13 @@ static inline struct sync_timeline *fence_parent(struct fence *fence) /** * sync_timeline_create() - creates a sync object - * @size: size to allocate for this obj * @drv_name: sync_timeline driver name * @name: sync_timeline name * - * Creates a new sync_timeline. @size bytes will be allocated allowing - * for implementation specific data to be kept after the generic - * sync_timeline struct. Returns the sync_timeline object or NULL in + * Creates a new sync_timeline. Returns the sync_timeline object or NULL in * case of error. */ -struct sync_timeline *sync_timeline_create(int size, const char *drv_name, +struct sync_timeline *sync_timeline_create(const char *drv_name, const char *name); /** diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index 6282046..cb0f888 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -218,7 +218,7 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) get_task_comm(task_comm, current); - obj = sync_timeline_create(sizeof(*obj), "sw_sync", task_comm); + obj = sync_timeline_create("sw_sync", task_comm); if (!obj) return -ENOMEM; -- 2.5.5
[PATCH 09/18] staging/android: bring struct sync_pt back
From: Gustavo Padovan Move the list_head members from sync_pt to struct fence was a mistake, they will not be used by struct fence as planned before, so here we create sync_pt again to bring the list heads back. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sync.c | 40 ++-- drivers/staging/android/sync.h | 29 ++ drivers/staging/android/sync_debug.c | 16 +++ include/linux/fence.h| 2 -- 4 files changed, 53 insertions(+), 34 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index c83a599..aab80ec 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -28,8 +28,6 @@ #define CREATE_TRACE_POINTS #include "trace/sync.h" -static const struct fence_ops timeline_fence_ops; - struct sync_timeline *sync_timeline_create(const char *drv_name, const char *name) { @@ -90,7 +88,7 @@ EXPORT_SYMBOL(sync_timeline_destroy); void sync_timeline_signal(struct sync_timeline *obj, unsigned int inc) { unsigned long flags; - struct fence *fence, *next; + struct sync_pt *pt, *next; trace_sync_timeline(obj); @@ -98,37 +96,37 @@ void sync_timeline_signal(struct sync_timeline *obj, unsigned int inc) obj->value += inc; - list_for_each_entry_safe(fence, next, &obj->active_list_head, + list_for_each_entry_safe(pt, next, &obj->active_list_head, active_list) { - if (fence_is_signaled_locked(fence)) - list_del_init(&fence->active_list); + if (fence_is_signaled_locked(&pt->base)) + list_del_init(&pt->active_list); } spin_unlock_irqrestore(&obj->child_list_lock, flags); } EXPORT_SYMBOL(sync_timeline_signal); -struct fence *sync_pt_create(struct sync_timeline *obj, int size, +struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size, unsigned int value) { unsigned long flags; - struct fence *fence; + struct sync_pt *pt; - if (size < sizeof(*fence)) + if (size < sizeof(*pt)) return NULL; - fence = kzalloc(size, GFP_KERNEL); - if (!fence) + pt = kzalloc(size, GFP_KERNEL); + if (!pt) return NULL; spin_lock_irqsave(&obj->child_list_lock, flags); sync_timeline_get(obj); - fence_init(fence, &timeline_fence_ops, &obj->child_list_lock, + fence_init(&pt->base, &timeline_fence_ops, &obj->child_list_lock, obj->context, value); - list_add_tail(&fence->child_list, &obj->child_list_head); - INIT_LIST_HEAD(&fence->active_list); + list_add_tail(&pt->child_list, &obj->child_list_head); + INIT_LIST_HEAD(&pt->active_list); spin_unlock_irqrestore(&obj->child_list_lock, flags); - return fence; + return pt; } EXPORT_SYMBOL(sync_pt_create); @@ -148,13 +146,14 @@ static const char *timeline_fence_get_timeline_name(struct fence *fence) static void timeline_fence_release(struct fence *fence) { + struct sync_pt *pt = fence_to_sync_pt(fence); struct sync_timeline *parent = fence_parent(fence); unsigned long flags; spin_lock_irqsave(fence->lock, flags); - list_del(&fence->child_list); - if (WARN_ON_ONCE(!list_empty(&fence->active_list))) - list_del(&fence->active_list); + list_del(&pt->child_list); + if (WARN_ON_ONCE(!list_empty(&pt->active_list))) + list_del(&pt->active_list); spin_unlock_irqrestore(fence->lock, flags); sync_timeline_put(parent); @@ -170,12 +169,13 @@ static bool timeline_fence_signaled(struct fence *fence) static bool timeline_fence_enable_signaling(struct fence *fence) { + struct sync_pt *pt = fence_to_sync_pt(fence); struct sync_timeline *parent = fence_parent(fence); if (timeline_fence_signaled(fence)) return false; - list_add_tail(&fence->active_list, &parent->active_list_head); + list_add_tail(&pt->active_list, &parent->active_list_head); return true; } @@ -193,7 +193,7 @@ static void timeline_fence_timeline_value_str(struct fence *fence, snprintf(str, size, "%d", parent->value); } -static const struct fence_ops timeline_fence_ops = { +const struct fence_ops timeline_fence_ops = { .get_driver_name = timeline_fence_get_driver_name, .get_timeline_name = timeline_fence_get_timeline_name, .enable_signaling = timeline_fence_enable_signaling, diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index f2fbf98..14b61cb 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -60,6 +60,27 @@ static inline struct sync_timeline *fence_parent(struct fence *fence)
[PATCH v2 0/10] Add RK3399 eDP support and fix some bugs to analogix_dp driver.
Hello Yakir, On 05/27/2016 02:16 AM, Yakir Yang wrote: > Hi Javier, > > On 05/26/2016 08:48 PM, Javier Martinez Canillas wrote: >> Hello Yakir, >> >> On 05/26/2016 05:34 AM, Yakir Yang wrote: >>> Hi Javier, >>> >>> On 05/24/2016 01:01 PM, Yakir Yang wrote: Hi all, This series have been posted about one month, still no comments, help here :( >>> This series works rightly on Rockchip platform, and most of them haven't >>> touch the >>> common analogix_dp driver (except for the hotplug fixed). So i guess Exynos >>> platform >>> should also happy with this changes. >>> >>> But not sure about that. So, is it possible that you could help to check >>> this on Exynos >>> Chromebook, if so i would be very grateful about that. >>> >> Of course, I' ll test. Could you please provide me a branch that I can >> pull directly to avoid cherry-picking all the patches from the list? >> > Ah, thanks a lot, I do have a tree > https://github.com/yakir-Yang/linux/tree/fromlist/3399-edp > I tested your branch on an Exynos5800 Peach Pi Chromebook and display is working correctly. So feel free to add for the whole series: Tested-by: Javier Martinez Canillas Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America
[PATCH 14/18] staging/android: remove 'destroyed' member from struct sync_timeline
From: Gustavo Padovan 'destroyed' was set but not used ny anyone. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c | 5 - drivers/staging/android/sync.h| 5 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index 72262ba..1f956b9 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -107,11 +107,6 @@ static void sync_timeline_put(struct sync_timeline *obj) */ static void sync_timeline_destroy(struct sync_timeline *obj) { - obj->destroyed = true; - /* -* Ensure timeline is marked as destroyed before -* changing timeline's fences status. -*/ smp_wmb(); sync_timeline_put(obj); diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 3a50851..3c551f5 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -25,10 +25,8 @@ * @kref: reference count on fence. * @drv_name: drv_name of the driver using the sync_timeline * @name: name of the sync_timeline. Useful for debugging - * @destroyed: set when sync_timeline is destroyed * @child_list_head: list of children sync_pts for this sync_timeline - * @child_list_lock: lock protecting @child_list_head, destroyed, and - * fence.status + * @child_list_lock: lock protecting @child_list_head and fence.status * @active_list_head: list of active (unsignaled/errored) sync_pts * @sync_timeline_list:membership in global sync_timeline_list */ @@ -38,7 +36,6 @@ struct sync_timeline { charname[32]; /* protected by child_list_lock */ - booldestroyed; int context, value; struct list_headchild_list_head; -- 2.5.5
[PATCH 11/18] staging/android: clean up #includes in the sync framework
From: Gustavo Padovan Most of the includes there are not necessary anymore. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sync.c | 6 -- drivers/staging/android/sync.h | 3 --- drivers/staging/android/sync_debug.c | 16 3 files changed, 25 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index aab80ec..bb12d86 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -14,14 +14,8 @@ * */ -#include #include -#include -#include -#include #include -#include -#include #include "sync.h" diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 02ecf44..54c515b 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -13,9 +13,6 @@ #ifndef _LINUX_SYNC_H #define _LINUX_SYNC_H -#include -#include -#include #include #include #include diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index 2733cc3..864ad01 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -15,22 +15,6 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "uapi/sw_sync.h" #include "sync.h" #ifdef CONFIG_DEBUG_FS -- 2.5.5
[PATCH 18/18] staging/android: add DEBUG_FS dependence on Kconfig
From: Gustavo Padovan SW_SYNC only works with DEBUG_FS so state it in the Kconfig file. Signed-off-by: Gustavo Padovan --- drivers/staging/android/Kconfig | 1 + drivers/staging/android/sync_debug.c | 4 drivers/staging/android/sync_debug.h | 4 +--- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig index f52c682..06e41d2 100644 --- a/drivers/staging/android/Kconfig +++ b/drivers/staging/android/Kconfig @@ -28,6 +28,7 @@ config SW_SYNC bool "Software synchronization framework" default n depends on SYNC_FILE + depends on DEBUG_FS ---help--- A sync object driver that uses a 32bit counter to coordinate synchronization. Useful when there is no hardware primitive backing diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index b760226..9032969 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -17,8 +17,6 @@ #include #include "sync_debug.h" -#ifdef CONFIG_DEBUG_FS - static struct dentry *dbgfs; static LIST_HEAD(sync_timeline_list_head); @@ -225,5 +223,3 @@ void sync_dump(void) } } } - -#endif diff --git a/drivers/staging/android/sync_debug.h b/drivers/staging/android/sync_debug.h index 48e2d1c..425ebc5 100644 --- a/drivers/staging/android/sync_debug.h +++ b/drivers/staging/android/sync_debug.h @@ -41,9 +41,7 @@ struct sync_timeline { struct list_headactive_list_head; -#ifdef CONFIG_DEBUG_FS struct list_headsync_timeline_list; -#endif }; static inline struct sync_timeline *fence_parent(struct fence *fence) @@ -64,7 +62,7 @@ struct sync_pt { struct list_head active_list; }; -#ifdef CONFIG_DEBUG_FS +#ifdef CONFIG_SW_SYNC extern const struct file_operations sw_sync_debugfs_fops; -- 2.5.5
[PATCH 10/18] staging/android: move sw_sync related code to sw_sync.c
From: Gustavo Padovan Split sync_debug and sw_sync in two different files. Signed-off-by: Gustavo Padovan --- drivers/staging/android/Makefile | 1 + drivers/staging/android/sw_sync.c| 136 +++ drivers/staging/android/sync.h | 2 + drivers/staging/android/sync_debug.c | 115 - 4 files changed, 139 insertions(+), 115 deletions(-) create mode 100644 drivers/staging/android/sw_sync.c diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile index bf45967..980d6dc 100644 --- a/drivers/staging/android/Makefile +++ b/drivers/staging/android/Makefile @@ -5,3 +5,4 @@ obj-y += ion/ obj-$(CONFIG_ASHMEM) += ashmem.o obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER)+= lowmemorykiller.o obj-$(CONFIG_SYNC) += sync.o sync_debug.o +obj-$(CONFIG_SW_SYNC) += sw_sync.o diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c new file mode 100644 index 000..90e3ee5 --- /dev/null +++ b/drivers/staging/android/sw_sync.c @@ -0,0 +1,136 @@ +/* + * drivers/dma-buf/sw_sync.c + * + * Copyright (C) 2012 Google, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#include +#include +#include + +#include "uapi/sw_sync.h" +#include "sync.h" + +/* + * *WARNING* + * + * improper use of this can result in deadlocking kernel drivers from userspace. + */ + +/* opening sw_sync create a new sync obj */ +static int sw_sync_debugfs_open(struct inode *inode, struct file *file) +{ + struct sync_timeline *obj; + char task_comm[TASK_COMM_LEN]; + + get_task_comm(task_comm, current); + + obj = sync_timeline_create("sw_sync", task_comm); + if (!obj) + return -ENOMEM; + + file->private_data = obj; + + return 0; +} + +static int sw_sync_debugfs_release(struct inode *inode, struct file *file) +{ + struct sync_timeline *obj = file->private_data; + + sync_timeline_destroy(obj); + return 0; +} + +static long sw_sync_ioctl_create_fence(struct sync_timeline *obj, + unsigned long arg) +{ + int fd = get_unused_fd_flags(O_CLOEXEC); + int err; + struct sync_pt *pt; + struct sync_file *sync_file; + struct sw_sync_create_fence_data data; + + if (fd < 0) + return fd; + + if (copy_from_user(&data, (void __user *)arg, sizeof(data))) { + err = -EFAULT; + goto err; + } + + pt = sync_pt_create(obj, sizeof(*pt), data.value); + if (!pt) { + err = -ENOMEM; + goto err; + } + + sync_file = sync_file_create(&pt->base); + if (!sync_file) { + fence_put(&pt->base); + err = -ENOMEM; + goto err; + } + + data.fence = fd; + if (copy_to_user((void __user *)arg, &data, sizeof(data))) { + fput(sync_file->file); + err = -EFAULT; + goto err; + } + + fd_install(fd, sync_file->file); + + return 0; + +err: + put_unused_fd(fd); + return err; +} + +static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg) +{ + u32 value; + + if (copy_from_user(&value, (void __user *)arg, sizeof(value))) + return -EFAULT; + + sync_timeline_signal(obj, value); + + return 0; +} + +static long sw_sync_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) +{ + struct sync_timeline *obj = file->private_data; + + switch (cmd) { + case SW_SYNC_IOC_CREATE_FENCE: + return sw_sync_ioctl_create_fence(obj, arg); + + case SW_SYNC_IOC_INC: + return sw_sync_ioctl_inc(obj, arg); + + default: + return -ENOTTY; + } +} + +const struct file_operations sw_sync_debugfs_fops = { + .open = sw_sync_debugfs_open, + .release= sw_sync_debugfs_release, + .unlocked_ioctl = sw_sync_ioctl, + .compat_ioctl = sw_sync_ioctl, +}; diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 14b61cb..02ecf44 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -132,6 +132,8 @@ struct sync_pt *sync_pt_create(struct sync_timeline *parent, int size, #ifdef CONFIG_DEBUG_FS +extern const struct file_operations sw_sync_debugfs_fops; + void sync
[PATCH 12/18] staging/android: make sync_timeline internal to sw_sync
From: Gustavo Padovan The only use sync_timeline will have in upstream kernel is for debugging through the SW_SYNC interface. So make it internal to SW_SYNC to avoid people use it in the future. Signed-off-by: Gustavo Padovan --- drivers/staging/android/Kconfig | 16 +-- drivers/staging/android/Makefile | 3 +- drivers/staging/android/sw_sync.c| 220 +++ drivers/staging/android/sync.c | 199 --- drivers/staging/android/sync.h | 58 - drivers/staging/android/sync_debug.c | 2 - 6 files changed, 225 insertions(+), 273 deletions(-) delete mode 100644 drivers/staging/android/sync.c diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig index 6480f60..f52c682 100644 --- a/drivers/staging/android/Kconfig +++ b/drivers/staging/android/Kconfig @@ -24,26 +24,18 @@ config ANDROID_LOW_MEMORY_KILLER scripts (/init.rc), and it defines priority values with minimum free memory size for each priority. -config SYNC - bool "Synchronization framework" - default n - select ANON_INODES - select DMA_SHARED_BUFFER - ---help--- - This option enables the framework for synchronization between multiple - drivers. Sync implementations can take advantage of hardware - synchronization built into devices like GPUs. - config SW_SYNC - bool "Software synchronization objects" + bool "Software synchronization framework" default n - depends on SYNC depends on SYNC_FILE ---help--- A sync object driver that uses a 32bit counter to coordinate synchronization. Useful when there is no hardware primitive backing the synchronization. + WARNING: improper use of this can result in deadlocking kernel + drivers from userspace. Intended for test and debug only. + source "drivers/staging/android/ion/Kconfig" endif # if ANDROID diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile index 980d6dc..7ca61b7 100644 --- a/drivers/staging/android/Makefile +++ b/drivers/staging/android/Makefile @@ -4,5 +4,4 @@ obj-y += ion/ obj-$(CONFIG_ASHMEM) += ashmem.o obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER)+= lowmemorykiller.o -obj-$(CONFIG_SYNC) += sync.o sync_debug.o -obj-$(CONFIG_SW_SYNC) += sw_sync.o +obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index 90e3ee5..c149ac90 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -17,11 +17,231 @@ #include #include #include +#include #include #include "uapi/sw_sync.h" #include "sync.h" +#define CREATE_TRACE_POINTS +#include "trace/sync.h" + +static const struct fence_ops timeline_fence_ops; + +static inline struct sync_pt *fence_to_sync_pt(struct fence *fence) +{ + if (fence->ops != &timeline_fence_ops) + return NULL; + return container_of(fence, struct sync_pt, base); +} + +/** + * sync_timeline_create() - creates a sync object + * @drv_name: sync_timeline driver name + * @name: sync_timeline name + * + * Creates a new sync_timeline. Returns the sync_timeline object or NULL in + * case of error. + */ +struct sync_timeline *sync_timeline_create(const char *drv_name, + const char *name) +{ + struct sync_timeline *obj; + + obj = kzalloc(sizeof(*obj), GFP_KERNEL); + if (!obj) + return NULL; + + kref_init(&obj->kref); + obj->context = fence_context_alloc(1); + strlcpy(obj->name, name, sizeof(obj->name)); + strlcpy(obj->drv_name, drv_name, sizeof(obj->drv_name)); + + INIT_LIST_HEAD(&obj->child_list_head); + INIT_LIST_HEAD(&obj->active_list_head); + spin_lock_init(&obj->child_list_lock); + + sync_timeline_debug_add(obj); + + return obj; +} + +static void sync_timeline_free(struct kref *kref) +{ + struct sync_timeline *obj = + container_of(kref, struct sync_timeline, kref); + + sync_timeline_debug_remove(obj); + + kfree(obj); +} + +static void sync_timeline_get(struct sync_timeline *obj) +{ + kref_get(&obj->kref); +} + +static void sync_timeline_put(struct sync_timeline *obj) +{ + kref_put(&obj->kref, sync_timeline_free); +} + +/** + * sync_timeline_destroy() - destroys a sync object + * @obj: sync_timeline to destroy + * + * A sync implementation should call this when the @obj is going away + * (i.e. module unload.) @obj won't actually be freed until all its children + * fences are freed. + */ +static void sync_timeline_destroy(struct sync_timeline *obj) +{ + obj->destroyed = true; + /* +* Ensure timeline is marked as destroyed before +
[PATCH 13/18] staging/android: make sw_ioctl info internal to sw_sync.c
From: Gustavo Padovan We don't want to export this from the kernel. This is interface is only for testing and debug. So testers shall copy the ioctl info in their own projects. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c | 13 - drivers/staging/android/uapi/sw_sync.h | 32 2 files changed, 12 insertions(+), 33 deletions(-) delete mode 100644 drivers/staging/android/uapi/sw_sync.h diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index c149ac90..72262ba 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -20,12 +20,23 @@ #include #include -#include "uapi/sw_sync.h" #include "sync.h" #define CREATE_TRACE_POINTS #include "trace/sync.h" +struct sw_sync_create_fence_data { + __u32 value; + charname[32]; + __s32 fence; /* fd of new fence */ +}; + +#define SW_SYNC_IOC_MAGIC 'W' + +#define SW_SYNC_IOC_CREATE_FENCE _IOWR(SW_SYNC_IOC_MAGIC, 0,\ + struct sw_sync_create_fence_data) +#define SW_SYNC_IOC_INC_IOW(SW_SYNC_IOC_MAGIC, 1, __u32) + static const struct fence_ops timeline_fence_ops; static inline struct sync_pt *fence_to_sync_pt(struct fence *fence) diff --git a/drivers/staging/android/uapi/sw_sync.h b/drivers/staging/android/uapi/sw_sync.h deleted file mode 100644 index 9b5d486..000 --- a/drivers/staging/android/uapi/sw_sync.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2012 Google, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef _UAPI_LINUX_SW_SYNC_H -#define _UAPI_LINUX_SW_SYNC_H - -#include - -struct sw_sync_create_fence_data { - __u32 value; - charname[32]; - __s32 fence; /* fd of new fence */ -}; - -#define SW_SYNC_IOC_MAGIC 'W' - -#define SW_SYNC_IOC_CREATE_FENCE _IOWR(SW_SYNC_IOC_MAGIC, 0,\ - struct sw_sync_create_fence_data) -#define SW_SYNC_IOC_INC_IOW(SW_SYNC_IOC_MAGIC, 1, __u32) - -#endif /* _UAPI_LINUX_SW_SYNC_H */ -- 2.5.5
[PATCH 15/18] staging/android: remove sync_timeline_destroy()
From: Gustavo Padovan This function was just used by the file release function, so we just fold its content there and remove sync_timeline_destroy(). Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index 1f956b9..cf4de27 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -98,21 +98,6 @@ static void sync_timeline_put(struct sync_timeline *obj) } /** - * sync_timeline_destroy() - destroys a sync object - * @obj: sync_timeline to destroy - * - * A sync implementation should call this when the @obj is going away - * (i.e. module unload.) @obj won't actually be freed until all its children - * fences are freed. - */ -static void sync_timeline_destroy(struct sync_timeline *obj) -{ - smp_wmb(); - - sync_timeline_put(obj); -} - -/** * sync_timeline_signal() - signal a status change on a sync_timeline * @obj: sync_timeline to signal * @inc: num to increment on timeline->value @@ -275,7 +260,9 @@ static int sw_sync_debugfs_release(struct inode *inode, struct file *file) { struct sync_timeline *obj = file->private_data; - sync_timeline_destroy(obj); + smp_wmb(); + + sync_timeline_put(obj); return 0; } -- 2.5.5
[PATCH 17/18] staging/android: rename sync.h to sync_debug.h
From: Gustavo Padovan This header file only contains information for debugging and SW_SYNC, so rename it to sync_debug.h instead of having a more generic name. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c| 2 +- drivers/staging/android/sync_debug.c | 2 +- drivers/staging/android/{sync.h => sync_debug.h} | 0 drivers/staging/android/trace/sync.h | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename drivers/staging/android/{sync.h => sync_debug.h} (100%) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index ae56ece..115c917 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -20,7 +20,7 @@ #include #include -#include "sync.h" +#include "sync_debug.h" #define CREATE_TRACE_POINTS #include "trace/sync.h" diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index b2697a1..b760226 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -15,7 +15,7 @@ */ #include -#include "sync.h" +#include "sync_debug.h" #ifdef CONFIG_DEBUG_FS diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync_debug.h similarity index 100% rename from drivers/staging/android/sync.h rename to drivers/staging/android/sync_debug.h diff --git a/drivers/staging/android/trace/sync.h b/drivers/staging/android/trace/sync.h index d7f6457f..6b5ce96 100644 --- a/drivers/staging/android/trace/sync.h +++ b/drivers/staging/android/trace/sync.h @@ -5,7 +5,7 @@ #if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_SYNC_H -#include "../sync.h" +#include "../sync_debug.h" #include TRACE_EVENT(sync_timeline, -- 2.5.5
[PATCH 16/18] staging/android: remove drv_name from sync_timeline
From: Gustavo Padovan As it is internal to sw_sync now this value will always be "sw_sync". Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c| 11 +++ drivers/staging/android/sync.h | 2 -- drivers/staging/android/sync_debug.c | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index cf4de27..ae56ece 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -48,14 +48,12 @@ static inline struct sync_pt *fence_to_sync_pt(struct fence *fence) /** * sync_timeline_create() - creates a sync object - * @drv_name: sync_timeline driver name * @name: sync_timeline name * * Creates a new sync_timeline. Returns the sync_timeline object or NULL in * case of error. */ -struct sync_timeline *sync_timeline_create(const char *drv_name, - const char *name) +struct sync_timeline *sync_timeline_create(const char *name) { struct sync_timeline *obj; @@ -66,7 +64,6 @@ struct sync_timeline *sync_timeline_create(const char *drv_name, kref_init(&obj->kref); obj->context = fence_context_alloc(1); strlcpy(obj->name, name, sizeof(obj->name)); - strlcpy(obj->drv_name, drv_name, sizeof(obj->drv_name)); INIT_LIST_HEAD(&obj->child_list_head); INIT_LIST_HEAD(&obj->active_list_head); @@ -161,9 +158,7 @@ static struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size, static const char *timeline_fence_get_driver_name(struct fence *fence) { - struct sync_timeline *parent = fence_parent(fence); - - return parent->drv_name; + return "sw_sync"; } static const char *timeline_fence_get_timeline_name(struct fence *fence) @@ -247,7 +242,7 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) get_task_comm(task_comm, current); - obj = sync_timeline_create("sw_sync", task_comm); + obj = sync_timeline_create(task_comm); if (!obj) return -ENOMEM; diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 3c551f5..48e2d1c 100644 --- a/drivers/staging/android/sync.h +++ b/drivers/staging/android/sync.h @@ -23,7 +23,6 @@ /** * struct sync_timeline - sync object * @kref: reference count on fence. - * @drv_name: drv_name of the driver using the sync_timeline * @name: name of the sync_timeline. Useful for debugging * @child_list_head: list of children sync_pts for this sync_timeline * @child_list_lock: lock protecting @child_list_head and fence.status @@ -32,7 +31,6 @@ */ struct sync_timeline { struct kref kref; - chardrv_name[32]; charname[32]; /* protected by child_list_lock */ diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index 77386d2..b2697a1 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -120,7 +120,7 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj) struct list_head *pos; unsigned long flags; - seq_printf(s, "%s %s: %d\n", obj->name, obj->drv_name, obj->value); + seq_printf(s, "%s: %d\n", obj->name, obj->value); spin_lock_irqsave(&obj->child_list_lock, flags); list_for_each(pos, &obj->child_list_head) { -- 2.5.5
[Bug 96296] clpeak causes a GPU hang
https://bugs.freedesktop.org/show_bug.cgi?id=96296 Bug ID: 96296 Summary: clpeak causes a GPU hang 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: notasas at gmail.com QA Contact: dri-devel at lists.freedesktop.org AMD JUNIPER (DRM 2.43.0 / 4.6.0) Mesa 12.1.0-devel (git-3581812) llvm-3.8 1:3.8-2ubuntu3 clpeak - https://github.com/krrishnarraj/clpeak.git As soon as it starts it's float8 test (earlier ones run fine), the machine locks up and does not recover. Perhaps it attempts to execute some fp64 instructions that are missing on Juniper? -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160531/0e310200/attachment.html>
[PATCH 1/6] drm/doc: Update kerneldoc for drm_crtc.h
Apparently not everyone has been super dutiful with updating this stuff. I still decided to leave out the documentation for all the *_property pointers we have in drm_mode_config. Signed-off-by: Daniel Vetter --- include/drm/drm_crtc.h | 80 ++ 1 file changed, 67 insertions(+), 13 deletions(-) diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index c0edd87fa0ee..aa3f7ea41b1b 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -315,6 +315,7 @@ struct drm_plane_helper_funcs; * update to ensure framebuffer cleanup isn't done too early * @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings * @mode: current mode timings + * @mode_blob: &drm_property_blob for @mode * @degamma_lut: Lookup table for converting framebuffer pixel data * before apply the conversion matrix * @ctm: Transformation matrix @@ -709,6 +710,7 @@ struct drm_crtc_funcs { * @dev: parent DRM device * @port: OF node used by drm_of_find_possible_crtcs() * @head: list management + * @name: human readable name, can be set by the driver * @mutex: per-CRTC locking * @base: base KMS object for ID tracking etc. * @primary: primary plane for this CRTC @@ -736,12 +738,13 @@ struct drm_crtc { char *name; - /* -* crtc mutex + /** +* @mutex: * * This provides a read lock for the overall crtc state (mode, dpms * state, ...) and a write lock for everything which can be update -* without a full modeset (fb, cursor data, ...) +* without a full modeset (fb, cursor data, crtc properties ...). Full +* modeset also need to grab dev->mode_config.connection_mutex. */ struct drm_modeset_lock mutex; @@ -1149,6 +1152,7 @@ struct drm_encoder { * @head: list management * @base: base KMS object * @name: connector name + * @connector_id: compacted connector id useful indexing arrays * @connector_type: one of the %DRM_MODE_CONNECTOR_ types from drm_mode.h * @connector_type_id: index into connector type enum * @interlace_allowed: can this connector handle interlaced modes? @@ -1161,7 +1165,6 @@ struct drm_encoder { * @funcs: connector control functions * @edid_blob_ptr: DRM property containing EDID if present * @properties: property tracking for this connector - * @path_blob_ptr: DRM blob property data for the DP MST path property * @polled: a %DRM_CONNECTOR_POLL_ value for core driven polling * @dpms: current dpms state * @helper_private: mid-layer private data @@ -1224,8 +1227,23 @@ struct drm_connector { struct drm_property_blob *edid_blob_ptr; struct drm_object_properties properties; + /** +* @path_blob_ptr: +* +* DRM blob property data for the DP MST path property. +*/ struct drm_property_blob *path_blob_ptr; + /** +* @tile_blob_ptr: +* +* DRM blob property data for the tile property (used mostly by DP MST). +* This is meant for screens which are driven through separate display +* pipelines represented by &drm_crtc, which might not be in running +* with genlocked clocks. For tiled panels which are genlocked, like +* dual-link LVDS or dual-link DSI, the driver should try to not expose +* the tiling and virtual both &drm_crtc and &drm_plane if needed. +*/ struct drm_property_blob *tile_blob_ptr; uint8_t polled; /* DRM_CONNECTOR_POLL_* */ @@ -1287,6 +1305,7 @@ struct drm_connector { * plane (in 16.16) * @src_w: width of visible portion of plane (in 16.16) * @src_h: height of visible portion of plane (in 16.16) + * @rotation: rotation of the plane * @state: backpointer to global drm_atomic_state */ struct drm_plane_state { @@ -1527,6 +1546,7 @@ enum drm_plane_type { * struct drm_plane - central DRM plane control structure * @dev: DRM device this plane belongs to * @head: for list management + * @name: human readable name, can be set by the driver * @base: base mode object * @possible_crtcs: pipes this plane can be bound to * @format_types: array of formats supported by this plane @@ -1540,6 +1560,7 @@ enum drm_plane_type { * @properties: property tracking for this plane * @type: type of plane (overlay, primary, cursor) * @state: current atomic state for this plane + * @helper_private: mid-layer private data */ struct drm_plane { struct drm_device *dev; @@ -1547,6 +1568,13 @@ struct drm_plane { char *name; + /** +* @mutex: +* +* Protects modeset plane state, together with the mutex of &drm_crtc +* this plane is linked to (when active, getting actived or getting +* disabled). +*/ struct drm_modeset_lock mutex; struct drm_mode_object base; @@ -1719,6 +1747,10 @@ struct drm_bridge { /** * struct drm_crtc_commit - track modeset comm
[PATCH 2/6] drm/atomic-helper: Fixup kerneldoc for drm_atomic_helper_legacy_gamma_set
kernel-doc is unhappy, appease it. Cc: Lionel Landwerlin Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_atomic_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 290318d6f5b5..68627babb31b 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -3315,7 +3315,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state); * @red: red correction table * @green: green correction table * @blue: green correction table - * @start: + * @start: first entry, must always be 0 * @size: size of the tables * * Implements support for legacy gamma correction table for drivers -- 2.8.1
[PATCH 3/6] drm/doc: Improve kernel-doc for drm_fb_cma_helper.c
kernel-doc was unhappy, appease it. Cc: Noralf Trønnes Cc: laurent.pinchart at ideasonboard.com Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_fb_cma_helper.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index 172cafe11c71..9cd23283c3a0 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -162,6 +162,10 @@ static struct drm_fb_cma *drm_fb_cma_alloc(struct drm_device *dev, * drm_fb_cma_create_with_funcs() - helper function for the * &drm_mode_config_funcs ->fb_create * callback function + * @dev: DRM device + * @file_priv: drm file for the ioctl call + * @mode_cmd: metadat for the framebuffer that should be created + * @funcs: vtable to be used for the new framebuffer object * * This can be used to set &drm_framebuffer_funcs for drivers that need the * dirty() callback. Use drm_fb_cma_create() if you don't need to change @@ -223,6 +227,10 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_create_with_funcs); /** * drm_fb_cma_create() - &drm_mode_config_funcs ->fb_create callback function + * @dev: DRM device + * @file_priv: drm file for the ioctl call + * @mode_cmd: metadat for the framebuffer that should be created + * * * If your hardware has special alignment or pitch requirements these should be * checked before calling this function. Use drm_fb_cma_create_with_funcs() if @@ -246,7 +254,7 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_create); * This function will usually be called from the CRTC callback functions. */ struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, - unsigned int plane) + unsigned int plane) { struct drm_fb_cma *fb_cma = to_fb_cma(fb); @@ -258,10 +266,6 @@ struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_obj); #ifdef CONFIG_DEBUG_FS -/* - * drm_fb_cma_describe() - Helper to dump information about a single - * CMA framebuffer object - */ static void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m) { struct drm_fb_cma *fb_cma = to_fb_cma(fb); @@ -279,7 +283,9 @@ static void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m) /** * drm_fb_cma_debugfs_show() - Helper to list CMA framebuffer objects - * in debugfs. + *in debugfs. + * @m: output file + * @arg: private data for the callback */ int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg) { -- 2.8.1
[PATCH 4/6] drm/gpu.tmpl: Don't forget to rename the include directives, too
We need to get folks to run $ make htmldocs more often and actually check the output. With the fancy new sphinx stuff there's hopefully no more excuses. Fixes: 286dbb8d5d80 ("drm/atomic: Rename async parameter to nonblocking.") Cc: Maarten Lankhorst Signed-off-by: Daniel Vetter --- Documentation/DocBook/gpu.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/DocBook/gpu.tmpl b/Documentation/DocBook/gpu.tmpl index cb130514cedf..053cc1f46af9 100644 --- a/Documentation/DocBook/gpu.tmpl +++ b/Documentation/DocBook/gpu.tmpl @@ -1570,7 +1570,7 @@ void intel_crt_init(struct drm_device *dev) Implementing Asynchronous Atomic Commit -!Pdrivers/gpu/drm/drm_atomic_helper.c implementing async commit +!Pdrivers/gpu/drm/drm_atomic_helper.c implementing nonblocking commit Atomic State Reset and Initialization -- 2.8.1
[PATCH 5/6] drm/doc: Drop kerneldoc for static functions in drm_irq.c
At least in drm core we only document the driver interfaces using kerneldoc. For internals an unstructured comment is good enough. Fixes a warning from kernel-doc, too. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_irq.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 49d02b4f969f..032d2fa7b744 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -89,11 +89,7 @@ static void store_vblank(struct drm_device *dev, unsigned int pipe, write_sequnlock(&vblank->seqlock); } -/** - * drm_reset_vblank_timestamp - reset the last timestamp to the last vblank - * @dev: DRM device - * @pipe: index of CRTC for which to reset the timestamp - * +/* * Reset the stored timestamp for the current vblank count to correspond * to the last vblank occurred. * @@ -137,11 +133,7 @@ static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe spin_unlock(&dev->vblank_time_lock); } -/** - * drm_update_vblank_count - update the master vblank counter - * @dev: DRM device - * @pipe: counter to update - * +/* * Call back into the driver to update the appropriate vblank counter * (specified by @pipe). Deal with wraparound, if it occurred, and * update the last read value so we can deal with wraparound on the next -- 2.8.1