Daniel Vetter
64cfaa5092
drm/vkms: Dont flush crc worker when we change crc status
...
The crc core code can cope with some late crc, the race is kinda
unavoidable. So no need to flush pending workers, they'll complete in
time.
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Cc: Haneen Mohammed <hamohammed.sa@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Tested-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-8-daniel.vetter@ffwll.ch
2019-06-26 23:13:10 -03:00
Daniel Vetter
5ef8100a39
drm/vkms: flush crc workers earlier in commit flow
...
Currently, we flush pending CRC workers very late in the commit flow,
when we destroy all the old crtc states. Unfortunately, at that point,
the framebuffers are already unpinned (and our vaddr possible gone), so
this isn't good. Also, the plane_states we need might also already be
cleaned up, since cleanup order of state structures isn't well defined.
Fix this by waiting for all CRC workers of the old state to complete
before we start any of the cleanup work. For correct ordering and
avoiding races, we can only flush_work after
drm_atomic_helper_wait_for_vblanks() since we know that all subsequent
queue_work will be for the new state. Only once that's done is
flush_work() useful, before that we might flush the work, and then right
after the hrtimer that simulates vblank queues it again. Every time you
have a flush_work before cleaning up the work structure, the following
sequence must be obeyed, or it can go wrong:
1. Make sure no one else can re-queue the work anymore (in our case
that's done by a combination of first updating output->crc_state and
then waiting for the vblank to pass to make sure the hrtimer has noticed
that change).
2. flush_work()
3. Actually clean up stuff (which isn't done here).
Doing the flush_work before we even completed the output->state update,
much less waited for the vblank to make sure that's happened, missed the
point.
Note that this is not yet race-free because of the hrtimer and crc
worker look at the wrong state pointers, but that will be fixed in
subsequent patches.
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Cc: Haneen Mohammed <hamohammed.sa@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Tested-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-7-daniel.vetter@ffwll.ch
2019-06-26 23:10:35 -03:00
Daniel Vetter
3d08eb7ddb
drm/vkms: Add our own commit_tail
...
Just prep work, more will be done here in following patches.
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Cc: Haneen Mohammed <hamohammed.sa@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Tested-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-6-daniel.vetter@ffwll.ch
2019-06-26 23:01:37 -03:00
Daniel Vetter
fb4155fa4c
drm/vkms: Rename vkms_output.state_lock to crc_lock
...
Plus add a comment about what it actually protects. It's very little.
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Cc: Haneen Mohammed <hamohammed.sa@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Tested-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-4-daniel.vetter@ffwll.ch
2019-06-26 23:00:55 -03:00
Daniel Vetter
a0e4e5754c
drm/vkms: Use spin_lock_irq in process context
...
The worker is always in process context, no need for the _irqsafe
version. Same for the set_source callback, that's only called from the
debugfs handler in a syscall.
Cc: Shayenne Moura <shayenneluzmoura@gmail.com >
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Cc: Haneen Mohammed <hamohammed.sa@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Tested-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-3-daniel.vetter@ffwll.ch
2019-06-26 22:56:40 -03:00
Daniel Vetter
18d0952a83
drm/vkms: Fix crc worker races
...
The issue we have is that the crc worker might fall behind. We've
tried to handle this by tracking both the earliest frame for which it
still needs to compute a crc, and the last one. Plus when the
crtc_state changes, we have a new work item, which are all run in
order due to the ordered workqueue we allocate for each vkms crtc.
Trouble is there's been a few small issues in the current code:
- we need to capture frame_end in the vblank hrtimer, not in the
worker. The worker might run much later, and then we generate a lot
of crc for which there's already a different worker queued up.
- frame number might be 0, so create a new crc_pending boolean to
track this without confusion.
- we need to atomically grab frame_start/end and clear it, so do that
all in one go. This is not going to create a new race, because if we
race with the hrtimer then our work will be re-run.
- only race that can happen is the following:
1. worker starts
2. hrtimer runs and updates frame_end
3. worker grabs frame_start/end, already reading the new frame_end,
and clears crc_pending
4. hrtimer calls queue_work()
5. worker completes
6. worker gets re-run, crc_pending is false
Explain this case a bit better by rewording the comment.
v2: Demote warning level output to debug when we fail to requeue, this
is expected under high load when the crc worker can't quite keep up.
Cc: Shayenne Moura <shayenneluzmoura@gmail.com >
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Cc: Haneen Mohammed <hamohammed.sa@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Tested-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-2-daniel.vetter@ffwll.ch
2019-06-26 22:52:47 -03:00
Chris Wilson
c1a495a558
drm: Allow range of 0 for drm_mm_insert_node_in_range()
...
We gracefully handle the caller specifying a zero range, so don't force
them to special case that condition if it naturally falls out of their
setup. What we don't check is if the end < start, so keep that as an
assert for an illegal call.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190626094330.3556-1-chris@chris-wilson.co.uk
2019-06-26 21:13:12 +01:00
Emil Velikov
848ed7d542
drm/virtio: drop DRM_AUTH usage from the driver
...
The authentication can be circumvented, by design, by using the render
node.
From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: virtualization@lists.linux-foundation.org
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Gerd Hoffmann <kraxel@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-12-emil.l.velikov@gmail.com
2019-06-26 15:00:41 +01:00
Emil Velikov
e4eee93d25
drm/vgem: drop DRM_AUTH usage from the driver
...
The authentication can be circumvented, by design, by using the render
node.
From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-11-emil.l.velikov@gmail.com
2019-06-26 15:00:40 +01:00
Emil Velikov
7042a33deb
drm/omap: drop DRM_AUTH from DRM_RENDER_ALLOW ioctls
...
The authentication can be circumvented, by design, by using the render
node.
From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.
Note: the outstanding DRM_AUTH instance is:
- (badly coped) legacy DRI1 ioctl, which is a noop
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-9-emil.l.velikov@gmail.com
2019-06-26 15:00:40 +01:00
Emil Velikov
a305f6c5c8
drm/nouveau: drop DRM_AUTH from DRM_RENDER_ALLOW ioctls
...
The authentication can be circumvented, by design, by using the render
node.
From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.
Note: the outstanding DRM_AUTH instance is:
- legacy DRI1 ioctl, which is already neutered
Cc: Ben Skeggs <bskeggs@redhat.com >
Cc: nouveau@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-8-emil.l.velikov@gmail.com
2019-06-26 15:00:40 +01:00
Emil Velikov
88209d2c50
drm/msm: drop DRM_AUTH usage from the driver
...
The authentication can be circumvented, by design, by using the render
node.
From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.
Cc: Rob Clark <robdclark@gmail.com >
Cc: Sean Paul <sean@poorly.run >
Cc: freedreno@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-7-emil.l.velikov@gmail.com
2019-06-26 15:00:39 +01:00
Emil Velikov
921d573236
drm/lima: drop DRM_AUTH usage from the driver
...
The authentication can be circumvented, by design, by using the render
node.
From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.
Cc: Qiang Yu <yuq825@gmail.com >
Cc: lima@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Qiang Yu <yuq825@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-6-emil.l.velikov@gmail.com
2019-06-26 15:00:39 +01:00
Emil Velikov
951ecc022c
drm/exynos: drop DRM_AUTH from DRM_RENDER_ALLOW ioctls
...
The authentication can be circumvented, by design, by using the render
node.
From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.
Cc: Inki Dae <inki.dae@samsung.com >
Cc: Joonyoung Shim <jy0922.shim@samsung.com >
Cc: Seung-Woo Kim <sw0312.kim@samsung.com >
Cc: Kyungmin Park <kyungmin.park@samsung.com >
Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Inki Dae <inki.dae@samsung.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-4-emil.l.velikov@gmail.com
2019-06-26 15:00:39 +01:00
Emil Velikov
b8602f9a65
drm/etnaviv: drop DRM_AUTH usage from the driver
...
The authentication can be circumvented, by design, by using the render
node.
From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Christian Gmeiner <christian.gmeiner@gmail.com >
Cc: etnaviv@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-3-emil.l.velikov@gmail.com
2019-06-26 15:00:39 +01:00
Emil Velikov
cbfbe47fc5
drm/vmwgfx: use core drm to extend/check vmw_execbuf_ioctl
...
Currently vmw_execbuf_ioctl() open-codes the permission checking, size
extending and copying that is already done in core drm.
Kill all the duplication, adding a few comments for clarity.
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com >
Cc: Thomas Hellstrom <thellstrom@vmware.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Tested-by: Thomas Hellstrom <thellstrom@vmware.com >
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190522164119.24139-3-emil.l.velikov@gmail.com
2019-06-26 15:00:38 +01:00
Emil Velikov
bcde7d345c
drm/vmgfx: kill off unused init_mutex
...
According to the docs - prevents firstopen/lastclose races. Yet never
used in practise.
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com >
Cc: Thomas Hellstrom <thellstrom@vmware.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190522164119.24139-2-emil.l.velikov@gmail.com
2019-06-26 15:00:38 +01:00
Emil Velikov
3cd74023ea
vmwgfx: drop empty lastclose stub
...
Core DRM is safe when the callback is NULL.
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com >
Cc: Thomas Hellstrom <thellstrom@vmware.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190522164119.24139-1-emil.l.velikov@gmail.com
2019-06-26 15:00:38 +01:00
Emil Velikov
ccdae42575
drm/nouveau: remove open-coded drm_invalid_op()
...
Cc: Ben Skeggs <bskeggs@redhat.com >
Cc: nouveau@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190522150219.13913-2-emil.l.velikov@gmail.com
2019-06-26 15:00:38 +01:00
Emil Velikov
b402375699
drm/i915: remove irrelevant DRM_UNLOCKED flag
...
DRM_UNLOCKED doesn't do anything for non-legacy drivers. Remove it.
Cc: intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20190522154702.16269-3-emil.l.velikov@gmail.com
2019-06-26 15:00:37 +01:00
Emil Velikov
d6891db2ad
drm/tegra: remove irrelevant DRM_UNLOCKED flag
...
DRM_UNLOCKED doesn't do anything for non-legacy drivers. Remove it.
Cc: Thierry Reding <treding@nvidia.com >
Cc: linux-tegra@vger.kernel.org
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Thierry Reding <treding@nvidia.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190522154702.16269-1-emil.l.velikov@gmail.com
2019-06-26 15:00:37 +01:00
Guido Günther
1a14e0c256
drm/panel: jh057n00900: Add regulator support
...
Allow to specify regulators for vcc and iovcc. According to the data
sheet the panel wants vcc (2.8V) and iovcc (1.8V) and there's no startup
dependency between the two.
Signed-off-by: Guido Günther <agx@sigxcpu.org >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/f78611fb26329e50ec1533810fbb76562f2f4e48.1561542477.git.agx@sigxcpu.org
2019-06-26 14:39:25 +02:00
Guido Günther
428733c72d
drm/panel: jh057n00900: Don't use magic constant
...
0xBF isn't in any ST7703 data sheet so mark it as unknown. This avoids
confusion on whether there is a missing command in that
dsi_generic_write_seq() call.
Signed-off-by: Guido Günther <agx@sigxcpu.org >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/7f50fa6de2ae029111f158f8ea7fd69a0903eb97.1561542477.git.agx@sigxcpu.org
2019-06-26 14:37:23 +02:00
Robert Chiras
f63df31d2d
drm/panel: Add support for Raydium RM67191 panel driver
...
This patch adds Raydium RM67191 TFT LCD panel driver (MIPI-DSI
protocol).
Signed-off-by: Robert Chiras <robert.chiras@nxp.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Reviewed-by: Fabio Estevam <festevam@gmail.com >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/1561550907-9733-3-git-send-email-robert.chiras@nxp.com
2019-06-26 14:34:54 +02:00
Paul Cercueil
f1bd37f300
drm/panel: simple: Add Sharp LS020B1DD01D panel support
...
The Sharp LS020B1DD01D is a simple 2.0" 240x160 16-bit TFT panel.
Signed-off-by: Paul Cercueil <paul@crapouillou.net >
Tested-by: Artur Rojek <contact@artur-rojek.eu >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190603153120.23947-3-paul@crapouillou.net
2019-06-26 13:38:16 +02:00
Paul Cercueil
ecdcbbb7ce
drm/panel: Add Novatek NT39016 panel support
...
Add support for display panels built around the Novatek NT39016 display
controller, as found on e.g. the King Display KD035G6-54NT 24-bit
320x240 3.5" LCD panel which equips the GCW Zero open-source handheld
gaming console.
Signed-off-by: Paul Cercueil <paul@crapouillou.net >
Signed-off-by: Maarten ter Huurne <maarten@treewalker.org >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190603152555.23527-2-paul@crapouillou.net
2019-06-26 13:36:02 +02:00
H. Nikolaus Schaller
9c31dcb6dd
drm/panel: simple: Add Ortustech COM37H3M panel support
...
The change adds support for the Ortustech COM37H3M05DTC/99DTC 3.7" TFT LCD panel.
Tested on Letux3704.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/43b47034b618cff26cea0484591c6deafb7f0685.1559905870.git.hns@goldelico.com
2019-06-26 08:36:08 +02:00
H. Nikolaus Schaller
dda0e4bdbe
drm/panel: simple: Add Sharp LQ070Y3DG3B panel support
...
The change adds support for the Sharp LQ070Y3DG3B 7.0" TFT LCD panel.
Tested on Letux7004.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/d16aaa1ac93e4f15c13cd7d621de95836257676a.1559905870.git.hns@goldelico.com
2019-06-26 08:35:53 +02:00
Paul Cercueil
2c6574a9ed
drm/panel: simple: Add GiantPlus GPM940B0 panel support
...
The GiantPlus GPM940B0 is a simple 3.0" 320x240 24-bit TFT panel.
Signed-off-by: Paul Cercueil <paul@crapouillou.net >
Tested-by: Artur Rojek <contact@artur-rojek.eu >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190605222247.25657-3-paul@crapouillou.net
2019-06-25 22:16:38 +02:00
Daniel Vetter
5ebeb02c86
drm/msm: Drop robj from msm_gem_new_impl
...
Only user was the prime import, and drm_prime.c takes care of that
now.
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Rob Clark <robdclark@gmail.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Sean Paul <sean@poorly.run >
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-46-daniel.vetter@ffwll.ch
2019-06-25 19:01:35 +02:00
Daniel Vetter
c6be808618
drm/etnaviv: Drop resv argument from etnaviv_gem_new_impl
...
Only user was the prime import, and drm_prime.c takes care of that
now.
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Russell King <linux+etnaviv@armlinux.org.uk >
Cc: Christian Gmeiner <christian.gmeiner@gmail.com >
Cc: etnaviv@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-43-daniel.vetter@ffwll.ch
2019-06-25 19:01:11 +02:00
Daniel Vetter
3886666a25
drm/vc4: Don set gem_obj->resv in prime import anymore
...
This is done in drm_prime.c now.
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Eric Anholt <eric@anholt.net >
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-48-daniel.vetter@ffwll.ch
2019-06-25 18:12:57 +02:00
Daniel Vetter
0ecaea1484
drm/panfrost: don't set gem_obj->resv for prime import anymore
...
This is now done in drm_prime.c
Acked-by: Rob Herring <robh@kernel.org >
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-47-daniel.vetter@ffwll.ch
2019-06-25 18:12:57 +02:00
Daniel Vetter
2a11d88125
drm/mediatek: Use drm_atomic_helper_wait_for_fences
...
If we use the gem fb helper as the prepare_fb hook, plus the
drm_prime.c import helpers now automatically setting obj->resv, we can
use the shared helpers to wait for fences instead of rolling our own.
Note that this relies on mtk setting drm_fb->obj, which is already
done in mtk_drm_framebuffer_init().
Aside: Probably can use the default commit_tail with this again, but I
didn't check for that.
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: CK Hu <ck.hu@mediatek.com >
Cc: Philipp Zabel <p.zabel@pengutronix.de >
Cc: Matthias Brugger <matthias.bgg@gmail.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-45-daniel.vetter@ffwll.ch
2019-06-25 18:12:57 +02:00
Daniel Vetter
0fbbd27e5a
drm/lima: Drop resv argument from lima_bo_create_struct
...
It was only used for prime import, which is now handled by
drm_prime.c.
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Qiang Yu <yuq825@gmail.com >
Cc: lima@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-44-daniel.vetter@ffwll.ch
2019-06-25 18:12:57 +02:00
Linus Walleij
ca5be902a8
drm/mcde: Fix uninitialized variable
...
We need to handle the case when of_drm_find_bridge() returns
NULL.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Acked-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Linus Walleij <linus.walleij@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190618115245.13915-1-linus.walleij@linaro.org
2019-06-25 00:10:24 +02:00
Ville Syrjälä
1e612a0f62
drm/sun4i: Eliminate pointless on stack copy of drm_display_info
...
Just use a pointer to the display_info rather than make a copy
on stack.
Cc: Maxime Ripard <maxime.ripard@bootlin.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326173810.11979-1-ville.syrjala@linux.intel.com
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2019-06-24 18:34:21 +03:00
Ville Syrjälä
9f396ab4de
drm: WARN on illegal aspect ratio when converting a mode to umode
...
WARN if the incoming drm_display_mode has an illegal aspect ratio
when converting it to a user mode. This should never happen unless
the driver made a mistake and put an invalid value into the aspect
ratio.
Cc: Ilia Mirkin <imirkin@alum.mit.edu >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190620142639.17518-4-ville.syrjala@linux.intel.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2019-06-24 18:08:55 +03:00
Ville Syrjälä
993a80671e
drm: Do not accept garbage mode aspect ratio flags
...
Don't let userspace feed us any old garbage in the mode aspect ratio
flags.
Cc: Ilia Mirkin <imirkin@alum.mit.edu >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190620142639.17518-3-ville.syrjala@linux.intel.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2019-06-24 18:08:55 +03:00
Ville Syrjälä
700710e977
drm: Do not use bitwise OR to set picure_aspect_ratio
...
enum hdmi_picture_aspect is not a bitmask, so don't use bitwise OR
to populate it.
Cc: Ilia Mirkin <imirkin@alum.mit.edu >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190620142639.17518-2-ville.syrjala@linux.intel.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2019-06-24 18:08:55 +03:00
Maxime Ripard
50b0946de4
drm/connector: Fix warning in debug message
...
The commit 3aeeb13d89 ("drm/modes: Support modes names on the command
line") added name support to the DRM modes, and added that name to the
debug message.
However, that code tests for whether or not the name variable is NULL and
only prints it if it's not. Except that that variable is an array, so it
will never be NULL.
The original intent was to print it only when the name has been specified.
Just printing the array directly will achieve the same thing since the
drm_cmdline_mode structure that holds it is itself contained in
drm_connector, that is allocated with its whole content zero'd.
That means that if the name is not declared, the array will be all zeros,
which will not print anything.
Cc: Nick Desaulniers <ndesaulniers@google.com >
Reported-by: kbuild test robot <lkp@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Fixes: 3aeeb13d89 ("drm/modes: Support modes names on the command line")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190624084016.12937-1-maxime.ripard@bootlin.com
2019-06-24 15:41:02 +02:00
Matt Redfearn
1effe5a3bb
drm/bridge/synopsys: dsi: Allow VPG to be enabled via debugfs
...
The Synopsys MIPI DSI IP contains a video test pattern generator which
is helpful in debugging video timing with connected displays.
Add a debugfs directory containing files which allow the VPG to be
enabled and disabled, and its orientation to be changed.
Signed-off-by: Matt Redfearn <matt.redfearn@thinci.com >
Tested-by: Yannick Fertré <yannick.fertre@st.com >
Reviewed-by: Philippe Cornu <philippe.cornu@st.com >
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190430081646.23845-1-matt.redfearn@thinci.com
2019-06-24 13:41:07 +02:00
Krzysztof Kozlowski
0e343b086b
drm/lima: Reduce the amount of logs on deferred probe of clocks and reset controller
...
There is no point to print deferred probe messages as errors. Adjust
the printks for error paths of obtaining clocks and reset controller.
This removes the error message of lima_clk_init() call in favor or
specific failure messages inside.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Signed-off-by: Qiang Yu <yuq825@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190621162117.22533-4-krzk@kernel.org
2019-06-23 11:24:05 +08:00
Krzysztof Kozlowski
7b4e467d2f
drm/lima: Reduce number of PTR_ERR() calls
...
Store the PTR_ERR() result in local variable in clock init error path.
This makes the code consistent with similar section in regulator init
code.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Signed-off-by: Qiang Yu <yuq825@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190621162117.22533-3-krzk@kernel.org
2019-06-23 11:23:18 +08:00
Krzysztof Kozlowski
34e88f9e2f
drm/lima: Reduce the amount of logs on deferred probe
...
There is no point to print deferred probe (and its failures to get
resources) as an error. For example getting a regulator causes three
unneeded error messages:
lima 13000000.gpu: failed to get regulator: -517
lima 13000000.gpu: regulator init fail -517
lima 13000000.gpu: Fatal error during GPU init
Also do not print clock rates before the initialization finishes
because they will be duplicated after deferral. Each probe step already
prints error so remove the final error message "Fatal error during GPU
init".
In case of multiple probe tries this would pollute the dmesg.
Fixes: a1d2a63399 ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Signed-off-by: Qiang Yu <yuq825@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190621162117.22533-2-krzk@kernel.org
2019-06-23 11:23:02 +08:00
Krzysztof Kozlowski
adbb48bcf4
drm/lima: Mark 64-bit number as ULL
...
Mark long numbers with ULL to silence the Smatch warning:
drivers/gpu/drm/lima/lima_device.c:314:32: warning: constant 0x100000000 is so big it is long long
Fixes: a1d2a63399 ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Signed-off-by: Qiang Yu <yuq825@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190621162117.22533-1-krzk@kernel.org
2019-06-23 11:22:12 +08:00
Daniel Vetter
7b0cdf3e56
drm/vgem: Ditch attach trickery in the fence ioctl
...
It looks like this was done purely to get a consistent place to look
up the reservation object pointer. With the drm_prime.c helper code
now also setting gem_object->resv for imported objects we can just use
that pointer directly, instead of first ensuring a dma-buf exists.
v2: Note that I screwed up the patch ordering, hence why this needed
a Fixes: tag - CI spotted the broken intermediate state.
Fixes: 5eab998741 ("drm/vgem: Drop drm_gem_prime_export")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-49-daniel.vetter@ffwll.ch
2019-06-21 22:20:20 +02:00
Daniel Vetter
5f6ed9879a
drm/prime: automatically set gem_obj->resv on import
...
It's really the only reasonable thing to do, and it won't hurt drivers
which don't (yet) use drm_gem_object->resv.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Eric Anholt <eric@anholt.net >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Maxime Ripard <maxime.ripard@bootlin.com >
Cc: Sean Paul <sean@poorly.run >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-42-daniel.vetter@ffwll.ch
2019-06-21 22:14:55 +02:00
Daniel Vetter
42169858d7
drm/zte: Drop drm_gem_prime_export/import
...
They're the default.
Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Shawn Guo <shawnguo@kernel.org >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Shawn Guo <shawnguo@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-40-daniel.vetter@ffwll.ch
2019-06-21 20:12:25 +02:00
Daniel Vetter
f30dec2f82
drm/xen: Drop drm_gem_prime_export/import
...
They're the default.
Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com >
Cc: xen-devel@lists.xenproject.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-39-daniel.vetter@ffwll.ch
2019-06-21 20:12:05 +02:00