Heiko Stuebner
d922d58fed
drm/panel: kd35t133: allow using non-continuous dsi clock
...
The panel is able to work when dsi clock is non-continuous, thus
the system power consumption can be reduced using such feature.
Add MIPI_DSI_CLOCK_NON_CONTINUOUS to panel's mode_flags.
Also the flag actually becomes necessary after
commit c6d94e37bd ("drm/bridge/synopsys: dsi: add support for non-continuous HS clock")
and without it the panel only emits stripes instead of output.
Fixes: c6d94e37bd ("drm/bridge/synopsys: dsi: add support for non-continuous HS clock")
Cc: stable@vger.kernel.org # 5.10+
Signed-off-by: Heiko Stuebner <heiko@sntech.de >
Tested-by: Ezequiel Garcia <ezequiel@collabora.com >
Reviewed-by: Christopher Morgan <macromorgan@hotmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210206135020.1991820-1-heiko@sntech.de
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-25 10:18:45 +01:00
Alyssa Rosenzweig
5f94e35714
drm/rockchip: Require the YTR modifier for AFBC
...
The AFBC decoder used in the Rockchip VOP assumes the use of the
YUV-like colourspace transform (YTR). YTR is lossless for RGB(A)
buffers, which covers the RGBA8 and RGB565 formats supported in
vop_convert_afbc_format. Use of YTR is signaled with the
AFBC_FORMAT_MOD_YTR modifier, which prior to this commit was missing. As
such, a producer would have to generate buffers that do not use YTR,
which the VOP would erroneously decode as YTR, leading to severe visual
corruption.
The upstream AFBC support was developed against a captured frame, which
failed to exercise modifier support. Prior to bring-up of AFBC in Mesa
(in the Panfrost driver), no open userspace respected modifier
reporting. As such, this change is not expected to affect broken
userspaces.
Tested on RK3399 with Panfrost and Weston.
Fixes: 7707f7227f ("drm/rockchip: Add support for afbc")
Cc: stable@vger.kernel.org
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Acked-by: Daniel Stone <daniels@collabora.com >
Signed-off-by: Heiko Stuebner <heiko@sntech.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20200811202631.3603-1-alyssa.rosenzweig@collabora.com
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-25 10:18:45 +01:00
xinhui pan
7a8a4b0729
drm/ttm: Fix a memory leak
...
Free the memory on failure.
Also no need to re-alloc memory on retry.
Signed-off-by: xinhui pan <xinhui.pan@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210219042547.44855-1-xinhui.pan@amd.com
Reviewed-by: Christian König <christian.koenig@amd.com >
CC: stable@vger.kernel.org # 5.11
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-25 10:18:45 +01:00
Veera Sundaram Sankaran
583065c7aa
drm/drm_vblank: set the dma-fence timestamp during send_vblank_event
...
The explicit out-fences in crtc are signaled as part of vblank event,
indicating all framebuffers present on the Atomic Commit request are
scanned out on the screen. Though the fence signal and the vblank event
notification happens at the same time, triggered by the same hardware
vsync event, the timestamp set in both are different. With drivers
supporting precise vblank timestamp the difference between the two
timestamps would be even higher. This might have an impact on use-mode
frameworks using these fence timestamps for purposes other than simple
buffer usage. For instance, the Android framework [1] uses the
retire-fences as an alternative to vblank when frame-updates are in
progress. Set the fence timestamp during send vblank event using a new
drm_send_event_timestamp_locked variant to avoid discrepancies.
[1] https://android.googlesource.com/platform/frameworks/native/+/master/
services/surfaceflinger/Scheduler/Scheduler.cpp#397
Changes in v2:
- Use drm_send_event_timestamp_locked to update fence timestamp
- add more information to commit text
Changes in v3:
- use same backend helper function for variants of drm_send_event to
avoid code duplications
Changes in v4:
- remove WARN_ON from drm_send_event_timestamp_locked
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org >
Reviewed-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org >
[sumits: minor parenthesis alignment correction]
Link: https://patchwork.freedesktop.org/patch/msgid/1610757107-11892-2-git-send-email-veeras@codeaurora.org
(cherry picked from commit a78e7a51d2 )
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org >
2021-02-24 21:05:54 +05:30
Veera Sundaram Sankaran
f588f0c69e
dma-fence: allow signaling drivers to set fence timestamp
...
Some drivers have hardware capability to get the precise HW timestamp
of certain events based on which the fences are triggered. The delta
between the event HW timestamp & current HW reference timestamp can
be used to calculate the timestamp in kernel's CLOCK_MONOTONIC time
domain. This allows it to set accurate timestamp factoring out any
software and IRQ latencies. Add a timestamp variant of fence signal
function, dma_fence_signal_timestamp to allow drivers to update the
precise timestamp for fences.
Changes in v2:
- Add a new fence signal variant instead of modifying fence struct
Changes in v3:
- Add timestamp domain information to commit-text and
dma_fence_signal_timestamp documentation
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org >
Reviewed-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org >
[sumits: minor parenthesis alignment]
Link: https://patchwork.freedesktop.org/patch/msgid/1610757107-11892-1-git-send-email-veeras@codeaurora.org
(cherry picked from commit 5a164ac4db )
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org >
2021-02-24 21:05:28 +05:30
John Stultz
abf4451b34
dma-buf: heaps: Rework heap allocation hooks to return struct dma_buf instead of fd
...
Every heap needs to create a dmabuf and then export it to a fd
via dma_buf_fd(), so to consolidate things a bit, have the heaps
just return a struct dmabuf * and let the top level
dma_heap_buffer_alloc() call handle creating the fd via
dma_buf_fd().
Cc: Sumit Semwal <sumit.semwal@linaro.org >
Cc: Liam Mark <lmark@codeaurora.org >
Cc: Laura Abbott <labbott@kernel.org >
Cc: Brian Starkey <Brian.Starkey@arm.com >
Cc: Hridya Valsaraju <hridya@google.com >
Cc: Suren Baghdasaryan <surenb@google.com >
Cc: Sandeep Patil <sspatil@google.com >
Cc: Daniel Mentz <danielmentz@google.com >
Cc: Chris Goldsworthy <cgoldswo@codeaurora.org >
Cc: Ørjan Eide <orjan.eide@arm.com >
Cc: Robin Murphy <robin.murphy@arm.com >
Cc: Ezequiel Garcia <ezequiel@collabora.com >
Cc: Simon Ser <contact@emersion.fr >
Cc: James Jones <jajones@nvidia.com >
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org >
[sumits: minor reword of commit message]
Link: https://patchwork.freedesktop.org/patch/msgid/20210119204508.9256-3-john.stultz@linaro.org
(cherry picked from commit c7f59e3dd6 )
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org >
2021-02-24 21:04:54 +05:30
John Stultz
cc84a8e65d
dma-buf: system_heap: Make sure to return an error if we abort
...
If we abort from the allocation due to a fatal_signal_pending(),
be sure we report an error so any return code paths don't trip
over the fact that the allocation didn't succeed.
Cc: Sumit Semwal <sumit.semwal@linaro.org >
Cc: Liam Mark <lmark@codeaurora.org >
Cc: Laura Abbott <labbott@kernel.org >
Cc: Brian Starkey <Brian.Starkey@arm.com >
Cc: Hridya Valsaraju <hridya@google.com >
Cc: Suren Baghdasaryan <surenb@google.com >
Cc: Sandeep Patil <sspatil@google.com >
Cc: Daniel Mentz <danielmentz@google.com >
Cc: Chris Goldsworthy <cgoldswo@codeaurora.org >
Cc: Ørjan Eide <orjan.eide@arm.com >
Cc: Robin Murphy <robin.murphy@arm.com >
Cc: Ezequiel Garcia <ezequiel@collabora.com >
Cc: Simon Ser <contact@emersion.fr >
Cc: James Jones <jajones@nvidia.com >
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Suggested-by: Suren Baghdasaryan <surenb@google.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20210119204508.9256-1-john.stultz@linaro.org
(cherry picked from commit 14a117252f )
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org >
2021-02-24 21:04:25 +05:30
Randy Dunlap
bfa5782b9c
fbdev: atyfb: add stubs for aty_{ld,st}_lcd()
...
Fix build errors when these functions are not defined.
../drivers/video/fbdev/aty/atyfb_base.c: In function 'aty_power_mgmt':
../drivers/video/fbdev/aty/atyfb_base.c:2002:7: error: implicit declaration of function 'aty_ld_lcd'; did you mean 'aty_ld_8'? [-Werror=implicit-function-declaration]
2002 | pm = aty_ld_lcd(POWER_MANAGEMENT, par);
../drivers/video/fbdev/aty/atyfb_base.c:2004:2: error: implicit declaration of function 'aty_st_lcd'; did you mean 'aty_st_8'? [-Werror=implicit-function-declaration]
2004 | aty_st_lcd(POWER_MANAGEMENT, pm, par);
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Reported-by: kernel test robot <lkp@intel.com >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: David Airlie <airlied@linux.ie >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20210222032853.21483-1-rdunlap@infradead.org
2021-02-22 17:25:40 +01:00
Bjorn Andersson
b1b805f3cb
dt-bindings: dp-connector: Drop maxItems from -supply
...
The meta-schema recently gained a definition for the common -supply$
property, which denotes that maxItems is not a valid property. Drop this
to clear up the binding validation error.
Fixes: a46c112512 ("dt-bindings: dp-connector: add binding for DisplayPort connector")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Signed-off-by: Rob Herring <robh@kernel.org >
(cherry picked from commit ca230ab187 )
Link: https://patchwork.freedesktop.org/patch/msgid/20210120175922.1579835-1-bjorn.andersson@linaro.org
2021-02-18 09:10:30 -06:00
Maarten Lankhorst
e2183fb135
Revert "drm/scheduler: Job timeout handler returns status (v3)"
...
This reverts commit c10983e14e .
This commit is not meant for drm-misc-next-fixes, and was accidentally
cherry picked over.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-10 15:26:00 +01:00
Imre Deak
4b8878eefa
drm/dp_mst: Don't cache EDIDs for physical ports
...
Caching EDIDs for physical ports prevents updating the EDID if a port
gets reconnected via a Connection Status Notification message, fix this.
Fixes: db1a079569 ("drm/dp_mst: Handle SST-only branch device case")
Cc: Wayne Lin <Wayne.Lin@amd.com >
Cc: Lyude Paul <lyude@redhat.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210201120145.350258-2-imre.deak@intel.com
(cherry picked from commit 468091531c )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:16:57 +01:00
Dan Carpenter
8d0cb8860a
drm/virtio: fix an error code in virtio_gpu_init()
...
If devm_request_mem_region() fails this code currently returns success
but it should return -EBUSY.
Fixes: 6076a9711d ("drm/virtio: implement blob resources: probe for host visible region")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Link: http://patchwork.freedesktop.org/patch/msgid/YBpy0GS7GfmafMfe@mwanda
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
(cherry picked from commit eb988a2ee5 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:16:57 +01:00
Daniel Vetter
e2e2e008f9
drm/todo: Add entry for moving to dma_resv_lock
...
Requested by Thomas. I think it justifies a new level, since I tried
to make some forward progress on this last summer, and gave up (for
now). This is very tricky.
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Maxime Ripard <mripard@kernel.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Sumit Semwal <sumit.semwal@linaro.org >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Link: https://patchwork.freedesktop.org/patch/msgid/20210122133624.1751802-1-daniel.vetter@ffwll.ch
(cherry picked from commit 5823cca39d )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:16:57 +01:00
Ye Bin
b9377df121
drm/nouveau: remove set but not used variable ‘pdev’ in nouveau_bios_init
...
Fix follow warning:
drivers/gpu/drm/nouveau/nouveau_bios.c:2086:18: warning: variable ‘pdev’ set but not used [-Wunused-but-set-variable]
struct pci_dev *pdev;
^~~~
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Ye Bin <yebin10@huawei.com >
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20210123013014.3815870-1-yebin10@huawei.com
(cherry picked from commit 09b20988ff )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:16:57 +01:00
Zack Rusin
bb0ea19639
drm/vmwgfx: Fix some memory leaks on errors
...
Dan noticed some issues with pci_release_region, this builds upon
that and fixes some other lingering issues. As part of this we
also can stop trying to manually free our managed device;
there's no need for it, it will be cleaned up automatically for us.
Fixes: 8772c0bb58 ("drm/vmwgfx: Cleanup pci resource allocation")
Signed-off-by: Zack Rusin <zackr@vmware.com >
Reviewed-by: Martin Krastev <krastevm@vmware.com >
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Reported-by: kernel test robot <lkp@intel.com >
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210128173756.121525-1-zackr@vmware.com
(cherry picked from commit 75ec69c79e )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:16:57 +01:00
Bernard Zhao
439dde0a96
drm/vc4: remove unneeded variable: "ret"
...
remove unneeded variable: "ret".
Signed-off-by: Bernard Zhao <bernard@vivo.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Link: https://patchwork.freedesktop.org/patch/msgid/20210202122338.15351-1-bernard@vivo.com
(cherry picked from commit f0c5a89e53 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:16:57 +01:00
Joseph Schulte
57037094fe
drm: replace drm_modeset_lock_all() in drm_client_modeset_dpms_legacy()
...
This patch helps complete Use DRM_MODESET_LOCK_ALL* helpers instead of
boilerplate todo in Documentation/gpu/todo.rst
Signed-off-by: Joseph Schulte <joeschulte.js@gmail.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20210125144815.8389-1-joeschulte.js@gmail.com
(cherry picked from commit 482f3ef0b0 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:16:57 +01:00
Thomas Zimmermann
0b365a207e
drm/gma500: Remove dependency on TTM
...
The gma500 driver does not use TTM.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210129095604.32423-6-tzimmermann@suse.de
(cherry picked from commit 8180cc3752 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:12 +01:00
Thomas Zimmermann
ac798eb13c
drm/gma500: Remove CONFIG_X86 conditionals from source files
...
Remove the CONFIG_X86 conditionals from the source code. The driver
already depends on X86 in the Kconfig file. Also, no one has been
trying to build it on a non-x86 platform recently, or they would have
noticed that drm_ttm_cache_flush() doesn't exist.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210129095604.32423-5-tzimmermann@suse.de
(cherry picked from commit 6455af65e9 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Thomas Zimmermann
26499e0518
drm/gma500: Drop DRM_GMA3600 config option
...
With support for the MID-related chips removed, only support for
desktop chips is left in the driver. So just build the complete
driver if DRM_GMA500 has been selected. Anyone who wants to enable
the Poulsbo code would probably also want the Cedarview code.
[Patrik: Fixed conflict due to Oaktrail not being dropped]
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210129095604.32423-4-tzimmermann@suse.de
(cherry picked from commit 837f23bb4b )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Thomas Zimmermann
e1da811218
drm/gma500: Remove Medfield support
...
Medfield is an outdated mobile platform with apparently no users left.
Remove it from gma500.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210129095604.32423-2-tzimmermann@suse.de
(cherry picked from commit b51035c200 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Joe Perches
46d4a938fe
dma-buf: Avoid comma separated statements
...
Use semicolons and braces.
Signed-off-by: Joe Perches <joe@perches.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/990bf6f33ccaf73ad56eb4bea8bd2c0db5e90a31.1598331148.git.joe@perches.com
Signed-off-by: Christian König <christian.koenig@amd.com >
(cherry picked from commit e4abd7ad2b )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Qinglang Miao
de4248b744
drm/lima: fix reference leak in lima_pm_busy
...
pm_runtime_get_sync will increment pm usage counter even it
failed. Forgetting to putting operation will result in a
reference leak here.
A new function pm_runtime_resume_and_get is introduced in
[0] to keep usage counter balanced. So We fix the reference
leak by replacing it with new function.
[0] commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
Fixes: 50de2e9ebb ("drm/lima: enable runtime pm")
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com >
Signed-off-by: Qiang Yu <yuq825@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20201127094438.121003-1-miaoqinglang@huawei.com
(cherry picked from commit de499781c9 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Luben Tuikov
c10983e14e
drm/scheduler: Job timeout handler returns status (v3)
...
This patch does not change current behaviour.
The driver's job timeout handler now returns
status indicating back to the DRM layer whether
the device (GPU) is no longer available, such as
after it's been unplugged, or whether all is
normal, i.e. current behaviour.
All drivers which make use of the
drm_sched_backend_ops' .timedout_job() callback
have been accordingly renamed and return the
would've-been default value of
DRM_GPU_SCHED_STAT_NOMINAL to restart the task's
timeout timer--this is the old behaviour, and is
preserved by this patch.
v2: Use enum as the status of a driver's job
timeout callback method.
v3: Return scheduler/device information, rather
than task information.
Cc: Alexander Deucher <Alexander.Deucher@amd.com >
Cc: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Russell King <linux+etnaviv@armlinux.org.uk >
Cc: Christian Gmeiner <christian.gmeiner@gmail.com >
Cc: Qiang Yu <yuq825@gmail.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Cc: Steven Price <steven.price@arm.com >
Cc: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Cc: Eric Anholt <eric@anholt.net >
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com >
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Acked-by: Christian König <christian.koenig@amd.com >
Acked-by: Steven Price <steven.price@arm.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/415095/
(cherry picked from commit a6a1f036c7 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Dan Carpenter
78e4ba40f1
drm/vmwgfx/vmwgfx_drv: Fix an error path in vmw_setup_pci_resources()
...
The devm_memremap() function never returns NULL, it returns error
pointers so the test needs to be fixed. Also we need to call
pci_release_regions() to avoid a memory leak.
Fixes: be4f77ac68 ("drm/vmwgfx: Cleanup fifo mmio handling")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Zack Rusin <zackr@vmware.com >
Link: https://patchwork.freedesktop.org/patch/msgid/YA6FMboLhnE3uSvb@mwanda
(cherry picked from commit f3ebd4e6b6 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Maxime Ripard
6ff92deff7
dt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts
...
The CEC and hotplug interrupts were missing when that binding was
introduced, let's add them in now that we've figured out how it works.
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-14-maxime@cerno.tech
(cherry picked from commit e7cbc68a28 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Maxime Ripard
ae442bf6d6
drm/vc4: hdmi: Don't register the CEC adapter if there's no interrupts
...
We introduced the BCM2711 support to the vc4 HDMI controller with 5.10,
but this was lacking any of the interrupts of the CEC controller so we
have to deal with the backward compatibility.
Do so by simply ignoring the CEC setup if the DT doesn't have the
interrupts property.
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-13-maxime@cerno.tech
(cherry picked from commit 4d03ed7ad7 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Dom Cobley
1e5e4bbdfd
drm/vc4: hdmi: Remove cec_available flag
...
Now that our HDMI controller supports CEC for the BCM2711, let's remove
that flag.
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Signed-off-by: Dom Cobley <popcornmix@gmail.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-12-maxime@cerno.tech
(cherry picked from commit f551863af9 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Maxime Ripard
185e98b3bd
drm/vc4: hdmi: Support BCM2711 CEC interrupt setup
...
The HDMI controller found in the BCM2711 has an external interrupt
controller for the CEC and hotplug interrupt shared between the two
instances.
Let's add a variant flag to register a single interrupt handler and
deals with the interrupt handler setup, or two interrupt handlers
relying on an external irqchip.
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-11-maxime@cerno.tech
(cherry picked from commit ad6380e9aa )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Maxime Ripard
ed4a6bbd63
drm/vc4: hdmi: Split the interrupt handlers
...
The BCM2711 has two different interrupt sources to transmit and receive
CEC messages, provided through an external interrupt chip shared between
the two HDMI interrupt controllers.
The rest of the CEC controller is identical though so we need to change
a bit the code organisation to share the code as much as possible, yet
still allowing to register independent handlers.
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-10-maxime@cerno.tech
(cherry picked from commit 0c38490a03 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Maxime Ripard
23b7eb5c12
drm/vc4: hdmi: Introduce a CEC clock
...
While the BCM2835 had the CEC clock derived from the HSM clock, the
BCM2711 has a dedicated parent clock for it.
Let's introduce a separate clock for it so that we can handle both
cases.
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-9-maxime@cerno.tech
(cherry picked from commit cd7f016c93 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Maxime Ripard
47fa9a8027
drm/vc4: hdmi: Update the CEC clock divider on HSM rate change
...
As part of the enable sequence we might change the HSM clock rate if the
pixel rate is different than the one we were already dealing with.
On the BCM2835 however, the CEC clock derives from the HSM clock so any
rate change will need to be reflected in the CEC clock divider to output
40kHz.
Fixes: cd4cb49dc5 ("drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-8-maxime@cerno.tech
(cherry picked from commit a9dd0b9a5c )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:11 +01:00
Maxime Ripard
163a3ef681
drm/vc4: hdmi: Compute the CEC clock divider from the clock rate
...
The CEC clock divider needs to output a frequency of 40kHz from the HSM
rate on the BCM2835. The driver used to have a fixed frequency for it,
but that changed for the BCM2711 and we now need to compute it
dynamically to maintain the proper rate.
Fixes: cd4cb49dc5 ("drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-7-maxime@cerno.tech
(cherry picked from commit f1ceb9d100 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:10 +01:00
Dom Cobley
4d8602b8ec
drm/vc4: hdmi: Restore cec physical address on reconnect
...
Currently we call cec_phys_addr_invalidate on a hotplug deassert.
That may be due to a TV power cycling, or an AVR being switched
on (and switching edid).
This makes CEC unusable since our controller wouldn't have a physical
address anymore.
Set it back up again on the hotplug assert.
Fixes: 15b4511a4a ("drm/vc4: add HDMI CEC support")
Signed-off-by: Dom Cobley <popcornmix@gmail.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-6-maxime@cerno.tech
(cherry picked from commit b06eecb515 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:10 +01:00
Dom Cobley
5a32bfd563
drm/vc4: hdmi: Fix up CEC registers
...
The commit 311e305fdb ("drm/vc4: hdmi: Implement a register layout
abstraction") forgot one CEC register, and made a copy and paste mistake
for another one. Fix those mistakes.
Fixes: 311e305fdb ("drm/vc4: hdmi: Implement a register layout abstraction")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Signed-off-by: Dom Cobley <popcornmix@gmail.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-5-maxime@cerno.tech
(cherry picked from commit 303085bc11 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:10 +01:00
Dom Cobley
4a59ed546c
drm/vc4: hdmi: Fix register offset with longer CEC messages
...
The code prior to 311e305fdb ("drm/vc4: hdmi: Implement a register
layout abstraction") was relying on the fact that the register offset
was incremented by 4 for each readl call. That worked since the register
width is 4 bytes.
However, since that commit the HDMI_READ macro is now taking an enum,
and the offset doesn't increment by 4 but 1 now. Divide the index by 4
to fix this.
Fixes: 311e305fdb ("drm/vc4: hdmi: Implement a register layout abstraction")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Signed-off-by: Dom Cobley <popcornmix@gmail.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-4-maxime@cerno.tech
(cherry picked from commit e9c9481f37 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:10 +01:00
Dom Cobley
902dc5c19a
drm/vc4: hdmi: Move hdmi reset to bind
...
The hdmi reset got moved to a later point in the commit 9045e91a47
("drm/vc4: hdmi: Add reset callback").
However, the reset now occurs after vc4_hdmi_cec_init and so tramples
the setup of registers like HDMI_CEC_CNTRL_1
This only affects pi0-3 as on pi4 the cec registers are in a separate
block
Fixes: 9045e91a47 ("drm/vc4: hdmi: Add reset callback")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Signed-off-by: Dom Cobley <popcornmix@gmail.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl >
Link: https://patchwork.freedesktop.org/patch/msgid/20210111142309.193441-3-maxime@cerno.tech
(cherry picked from commit 7155334f15 )
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-02-09 17:14:10 +01:00
Arnd Bergmann
4c3a329273
drm/amd/display: fix unused variable warning
...
After all users of the 'dm' warnings got hidden in an #ifdef,
the compiler started warning about it being unused:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5380:33: error: unused variable 'dm' [-Werror,-Wunused-variable]
Add another such #ifdef.
Fixes: 98ab5f3513 ("drm/amd/display: Fix deadlock during gpu reset v3")
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210125124849.102037-1-arnd@kernel.org
2021-02-05 09:49:44 +10:00
Dave Airlie
c5cb0db5fc
Merge tag 'amd-drm-next-5.12-2021-02-03' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
...
amd-drm-next-5.12-2021-02-03:
amdgpu:
- Display fixes and cleanups
- Vangogh fixes
- Fix possible race when there are timeouts on two rings
- SR-IOV fixes
- Add missing license
- DCE 10/12 bpc fixes
- Display MALL fixes
- Fix SMU user preference settings persistence
- Fix retry in gem allocate
- Add new PCI DID
- Fix for manual fan speed control on cards where it was problematic
- Fix regression in pinning GTT
- Misc display fixes
- Misc code cleanups
amdkfd:
- Fix config handling
- Fix regression in buffer free
From: Alex Deucher <alexdeucher@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210204045717.3823-1-alexander.deucher@amd.com
Signed-off-by: Dave Airlie <airlied@redhat.com >
2021-02-05 09:38:23 +10:00
Dave Airlie
54c820d05e
Merge tag 'mediatek-drm-next-5.12' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next
...
Mediatek DRM Next for Linux 5.12
1. Decouple Mediatek DRM sub driver
2. Share mtk mutex driver for both DRM and MDP
3. Add support for SoC MT8183
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Chun-Kuang Hu <chunkuang.hu@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20210204151750.7550-1-chunkuang.hu@kernel.org
2021-02-05 09:25:26 +10:00
Yongqiang Niu
738ed4156f
drm/mediatek: Add matrix_bits private data for ccorr
...
Add matrix_bits and coeffs_precision to ccorr private data:
- matrix bits of mt8183 is 10
- matrix bits of mt8192 is 11
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com >
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
Yongqiang Niu
dff1668172
drm/mediatek: Fix ccorr size config
...
Fix setting to follow hardware datasheet. The original error setting
affects mt8192 display.
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com >
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
Yongqiang Niu
072a4cb512
drm/mediatek: Separate ccorr module
...
ccorr ctm matrix bits will be different in mt8192.
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com >
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
Yongqiang Niu
49629304b9
drm/mediatek: Enable dither function
...
Enable dither function to improve the display quality.
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com >
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
Yongqiang Niu
d41ff4dcf0
drm/mediatek: Enable OVL_LAYER_SMI_ID_EN for multi-layer usecase
...
Enable OVL_LAYER_SMI_ID_EN for multi-layer usecase, without this patch,
ovl will hang up when more than 1 layer enabled.
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com >
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
Yongqiang Niu
641ef9e7be
drm/mediatek: Add support for SoC MT8183
...
1. Add ovl private data
2. Add rdma private data
3. Add gamma privte data
4. Add main and external path module for crtc create
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com >
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
Yongqiang Niu
4a15d1ac37
drm/mediatek: Add has_dither private data for gamma
...
Not all SoC has dither function in gamma module.
Add private data to control this function setting.
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com >
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
Yongqiang Niu
69a4237ab1
drm/mediatek: Separate gamma module
...
mt8183 gamma module will different with mt8173,
so separate gamma for adding private data.
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com >
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
Hsin-Yi Wang
a6b7c98afd
drm/mediatek: Add mtk_dither_set_common() function
...
Current implementation of mtk_dither_set() cast dev data to
struct mtk_ddp_comp_dev. But other devices with different dev data
would also call this function.
Separate necessary parameters out so other device components (dither,
gamma) can call this function.
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2021-02-04 22:55:46 +08:00
CK Hu
e1e4f7fea3
soc / drm: mediatek: Move mtk mutex driver to soc folder
...
mtk mutex is used by DRM and MDP driver, and its function is SoC-specific,
so move it to soc folder.
Signed-off-by: CK Hu <ck.hu@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
Acked-by: Matthias Brugger <matthias.bgg@gmail.com >
2021-02-04 22:55:46 +08:00