summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2021-02-17drm/ast: Store each HW cursor offset after pinning the rsp BOThomas Zimmermann
As HW cursor BOs never move, we can store the offset in VRAM in the cursor-plane's HWC state. This removes the last possible source of runtime errors from atomic_update. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-10-tzimmermann@suse.de
2021-02-17drm/ast: Map HW cursor BOs permanentlyThomas Zimmermann
The BOs of the hardware cursor are now mapped permanently while the cursor plane is being used. This reduces the CPU overhead of the cursor plane's atomic_update function. The change also resolves a problem with the vmap call in the commit tail. The vmap implementation could acquire the DMA reservation lock on the BO, which is not allowed that late in the atomic update. Removing the vmap call from atomic_update fixes the issue. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-9-tzimmermann@suse.de
2021-02-17drm/ast: Store cursor BOs in cursor planeThomas Zimmermann
The cursor uses two BOs in video RAM to implement double buffering. Store both in struct ast_cursor_plane. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-8-tzimmermann@suse.de
2021-02-17drm/ast: Add cursor-plane data structureThomas Zimmermann
Cursor state is currently located throughout struct ast_private. Having struct ast_cursor_plane as dedicated data structure for cursors helps to organize the modesetting code. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-7-tzimmermann@suse.de
2021-02-17drm/ast: Inline ast cursor-update functions into modesetting codeThomas Zimmermann
The logic for cursor updates is now located in the cursor plane's modesetting code. A number of helper functions remain to modify the rsp registers and image. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-6-tzimmermann@suse.de
2021-02-17drm/ast: Allocate HW cursor BOs during cursor-plane initializationThomas Zimmermann
The BOs are eventually released by the cursor plane's destroy callback. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-5-tzimmermann@suse.de
2021-02-17drm/ast: Initialize planes in helper functionsThomas Zimmermann
This change will help with inlining cursor functions into modesetting code. The primary plane's field used to be cleared with memset(). This has been dropped as the memory is always allocated with kzalloc(). Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-4-tzimmermann@suse.de
2021-02-17drm/ast: Fix invalid usage of AST_MAX_HWC_WIDTH in cursor atomic_checkThomas Zimmermann
Use AST_MAX_HWC_HEIGHT for setting offset_y in the cursor plane's atomic_check. The code used AST_MAX_HWC_WIDTH instead. This worked because both constants has the same value. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-3-tzimmermann@suse.de
2021-02-17drm/ast: Add constants for VGACRCB register bitsThomas Zimmermann
Set the bits in VGACRCB with constants. Alo move the rsp code into a helper function. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-2-tzimmermann@suse.de
2021-02-15drm/stm: Fix bus_flags handlingMarek Vasut
The drm_display_mode_to_videomode() does not populate DISPLAY_FLAGS_DE_LOW or DISPLAY_FLAGS_PIXDATA_NEGEDGE flags in struct videomode. Therefore, no matter what polarity the next bridge or display might require, these flags are never set, and thus the LTDC GCR_DEPOL and GCR_PCPOL bits are never set and the LTDC behaves as if both DISPLAY_FLAGS_PIXDATA_POSEDGE and DISPLAY_FLAGS_DE_HIGH were always set. The fix for this problem is taken almost verbatim from MXSFB driver. In case there is a bridge attached to the LTDC, the bridge might have extra polarity requirements, so extract bus_flags from the bridge and use them for LTDC configuration. Otherwise, extract bus_flags from the connector, which is the display. Fixes: b759012c5fa7 ("drm/stm: Add STM32 LTDC driver") Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Yannick Fertre <yannick.fertre@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Antonio Borneo <antonio.borneo@st.com> Cc: Benjamin Gaignard <benjamin.gaignard@st.com> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Philippe Cornu <philippe.cornu@st.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Yannick Fertre <yannick.fertre@st.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com To: dri-devel@lists.freedesktop.org Tested-by: Yannick Fertre <yannick.fertre@foss.st.com> Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210127110756.125570-1-marex@denx.de
2021-02-15drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQsBoris Brezillon
Doing a hw-irq -> threaded-irq round-trip is counter-productive, stay in the threaded irq handler as long as we can. v2: * Rework the loop to avoid a goto Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210205111757.585248-4-boris.brezillon@collabora.com
2021-02-15drm/panfrost: Don't try to map pages that are already mappedBoris Brezillon
We allocate 2MB chunks at a time, so it might appear that a page fault has already been handled by a previous page fault when we reach panfrost_mmu_map_fault_addr(). Bail out in that case to avoid mapping the same area twice. Cc: <stable@vger.kernel.org> Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210205111757.585248-3-boris.brezillon@collabora.com
2021-02-15drm/panfrost: Clear MMU irqs before handling the faultBoris Brezillon
When a fault is handled it will unblock the GPU which will continue executing its shader and might fault almost immediately on a different page. If we clear interrupts after handling the fault we might miss new faults, so clear them before. Cc: <stable@vger.kernel.org> Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210205111757.585248-2-boris.brezillon@collabora.com
2021-02-12drm/vram-helper: cleanup drm_gem_vram_bo_driver_move_notifyChristian König
Swapping bo->mem was completely unecessary. Cleanup the function which is just a leftover from a TTM cleanup. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210211131659.276275-1-christian.koenig@amd.com
2021-02-10drm/vmwgfx: Remove pointless codeZack Rusin
There's no need to check for the presence of the hotplug property just to return because this is the end of the function so we're returning either way. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209161700.335611-2-zackr@vmware.com
2021-02-10drm/vmwgfx: Correctly set the name of the preferred modeZack Rusin
Our sysfs "modes" entries were broken because our preffered mode never had its name set correctly. This resulted in the first entry simply being called "preferred" followed by a list of other resolutions. Lets fix it by actually setting the name of mode (which is its resolution). This allows one to quickly validate the modes set by the open-vm-tools. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209161700.335611-1-zackr@vmware.com
2021-02-10drm/vmwgfx: add some 16:9 / 16:10 default resolutionsRoland Scheidegger
The default list was old and in particular lacking all common 16:9 resolutions, as well as some newer 16:10 ones. This makes them selectable in resolution change lists, which can be quite useful (for instance in case auto-fit isn't enabled). Signed-off-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Zack Rusin <zackr@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210205010446.26559-1-sroland@vmware.com
2021-02-10drm: use getter/setter functionsJulia Lawall
Use getter and setter functions, for platform_device structures and a mipi_dsi_device structure. Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210209211304.1261740-1-Julia.Lawall@inria.fr
2021-02-10drm/vblank: Document drm_crtc_vblank_restore constraintsDaniel Vetter
I got real badly confused when trying to review a fix from Ville for this. Let's try to document better what's required for this, and check the minimal settings at runtime - we can't check ofc that there's indeed no races in the driver callback. Also noticed that the drm_vblank_restore version is unused, so lets unexport that while at it. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209101523.2954281-1-daniel.vetter@ffwll.ch
2021-02-10drm/sun4i: Add alpha property for sun8i and sun50i VI layerRoman Stratiienko
DE3.0 VI layers supports plane-global alpha channel. DE2.0 FCC block have GLOBAL_ALPHA register that can be used as alpha source for blender. Add alpha property to the DRM plane and connect it to the corresponding registers in the mixer. Do not add alpha property for V3s SOC that have DE2.0 and 2 VI planes. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20210128113940.347013-3-r.stratiienko@gmail.com
2021-02-10drm/sun4i: Add alpha property for sun8i UI layerRoman Stratiienko
DE2.0 and DE3.0 UI layers supports plane-global alpha channel. Add alpha property to the DRM plane and connect it to the corresponding registers in mixer. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20210128113940.347013-2-r.stratiienko@gmail.com
2021-02-10drm/aspeed: Use dt matching for default register valuesJoel Stanley
There are minor differences in the values for the threshold value and the scan line size between families of ASPEED SoC. Additionally the SCU registers for the output control and scratch registers differ between families. This adds device tree matching to parameterise these values, allowing us to add support for the AST2400 now, and in the future the AST2600. Reviewed-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Joel Stanley <joel@jms.id.au> Link: https://patchwork.freedesktop.org/patch/msgid/20210209123734.130483-3-joel@jms.id.au
2021-02-10drm/aspeed: Look up syscon by phandleJoel Stanley
This scales better to multiple families of SoC. The lookup by compatible can be removed in a future change. The fallback path is for the ast2500 platform only. Other platforms will be added with the new style, so they won't need fallback paths. Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Link: https://patchwork.freedesktop.org/patch/msgid/20210209123734.130483-2-joel@jms.id.au
2021-02-10drm/tilcdc: send vblank event when disabling crtcQuanyang Wang
When run xrandr to change resolution on Beaglebone Black board, it will print the error information: root@beaglebone:~# xrandr -display :0 --output HDMI-1 --mode 720x400 [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:tilcdc crtc] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:HDMI-A-1] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] commit wait timed out tilcdc 4830e000.lcdc: already pending page flip! This is because there is operation sequence as below: drm_atomic_connector_commit_dpms(mode is DRM_MODE_DPMS_OFF): ... drm_atomic_helper_setup_commit <- init_completion(commit_A->flip_done) drm_atomic_helper_commit_tail tilcdc_crtc_atomic_disable tilcdc_plane_atomic_update <- drm_crtc_send_vblank_event in tilcdc_crtc_irq is skipped since tilcdc_crtc->enabled is 0 tilcdc_crtc_atomic_flush <- drm_crtc_send_vblank_event is skipped since crtc->state->event is set to be NULL in tilcdc_plane_atomic_update drm_mode_setcrtc: ... drm_atomic_helper_setup_commit <- init_completion(commit_B->flip_done) drm_atomic_helper_wait_for_dependencies drm_crtc_commit_wait <- wait for commit_A->flip_done completing Just as shown above, the steps which could complete commit_A->flip_done are all skipped and commit_A->flip_done will never be completed. This will result a time-out ERROR when drm_crtc_commit_wait check the commit_A->flip_done. So add drm_crtc_send_vblank_event in tilcdc_crtc_atomic_disable to complete commit_A->flip_done. Fixes: cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit") Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com> Reviewed-by: Jyri Sarha <jyri.sarha@iki.fi> Tested-by: Jyri Sarha <jyri.sarha@iki.fi> Signed-off-by: Jyri Sarha <jyri.sarha@iki.fi> Link: https://patchwork.freedesktop.org/patch/msgid/20210209082415.382602-1-quanyang.wang@windriver.com
2021-02-09drm/ttm: drop sysfs directoryChristian König
Not used any more. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210208133226.36955-3-christian.koenig@amd.com
2021-02-09drm/ttm: move memory accounting into vmwgfx v4Christian König
This is just another feature which is only used by VMWGFX, so move it into the driver instead. I've tried to add the accounting sysfs file to the kobject of the drm minor, but I'm not 100% sure if this works as expected. v2: fix typo in KFD and avoid 64bit divide v3: fix init order in VMWGFX v4: use pdev sysfs reference instead of drm Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Zack Rusin <zackr@vmware.com> (v3) Tested-by: Nirmoy Das <nirmoy.das@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210208133226.36955-2-christian.koenig@amd.com
2021-02-09drm/ttm: rework ttm_tt page limit v4Christian König
TTM implements a rather extensive accounting of allocated memory. There are two reasons for this: 1. It tries to block userspace allocating a huge number of very small BOs without accounting for the kmalloced memory. 2. Make sure we don't over allocate and run into an OOM situation during swapout while trying to handle the memory shortage. This is only partially a good idea. First of all it is perfectly valid for an application to use all of system memory, limiting it to 50% is not really acceptable. What we need to take care of is that the application is held accountable for the memory it allocated. This is what control mechanisms like memcg and the normal Linux page accounting already do. Making sure that we don't run into an OOM situation while trying to cope with a memory shortage is still a good idea, but this is also not very well implemented since it means another opportunity of recursion from the driver back into TTM. So start to rework all of this by implementing a shrinker callback which allows for TT object to be swapped out if necessary. v2: Switch from limit to shrinker callback. v3: fix gfp mask handling, use atomic for swapable_pages, add debugfs v4: drop the extra gfp_mask checks Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210208133226.36955-1-christian.koenig@amd.com
2021-02-09drm/ttm: fix removal of bo_count sysfs fileChristian König
Only a zombie leftover from rebasing. Signed-off-by: Christian König <christian.koenig@amd.com> Fixes: 3763d635deaa ("drm/ttm: add debugfs directory v2") Reported-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210209131756.24650-1-christian.koenig@amd.com
2021-02-09drm/vboxvideo: Implement cursor plane with struct drm_shadow_plane_stateThomas Zimmermann
Functions in the atomic commit tail are not allowed to acquire the dmabuf's reservation lock. So we cannot legally call the GEM object's vmap functionality in atomic_update. Instead use struct drm_shadow_plane_state and friends. It vmaps the framebuffer BOs in prepare_fb and vunmaps them in cleanup_fb. The cursor plane state stores the mapping's address. The pinning of the BO is implicitly done by vmap. As an extra benefit, there's no source of runtime errors left in atomic_update. v2: * rebase patch onto struct drm_shadow_plane_state Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209121042.24098-3-tzimmermann@suse.de
2021-02-09drm/gem: Export helpers for shadow-buffered planesThomas Zimmermann
Export the helpers for shadow-buffered planes. These will be used by several drivers. v3: * fix documentation typos and formatting (Daniel) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Tested-by: Hans de Goede <hdegoede@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209121042.24098-2-tzimmermann@suse.de
2021-02-09drm/gma500: Never wait for blitsPatrik Jakobsson
Blits cannot happen anymore since we removed the 2d accel code. Stop checking for a busy blitter and remove the remaining blitter code. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210201132617.1233-6-patrik.r.jakobsson@gmail.com
2021-02-09drm/gma500: psb_spank() doesn't need it's own filePatrik Jakobsson
Since everything else in accel_2d.c got removed we can move psb_spank() into psb_drv.c where it is used. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210201132617.1233-5-patrik.r.jakobsson@gmail.com
2021-02-09drm/gma500: Unify crtc helpersPatrik Jakobsson
CDV crtc helpers are identical to other chips so use gma_ prefix for the crtc helper struct and remove the CDV copy. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210201132617.1233-4-patrik.r.jakobsson@gmail.com
2021-02-09drm/gma500/cdv: Remove unused tv out pathsPatrik Jakobsson
Afaik tv out is not available on Cedarview and the code isn't doing anything so remove it. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210201132617.1233-3-patrik.r.jakobsson@gmail.com
2021-02-09drm/gma500: Remove unused DPST supportPatrik Jakobsson
DPST never got enabled so remove it. We keep the reg save/restore code just for safety. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210201132617.1233-2-patrik.r.jakobsson@gmail.com
2021-02-09drm/gma500/cdv: Remove unused code for crt initPatrik Jakobsson
Clearly never been used so just remove it. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210201132617.1233-1-patrik.r.jakobsson@gmail.com
2021-02-09drm/gma500: Drop DRM_GMA600 config optionThomas Zimmermann
With support for the MID-only Medfield chips removed, simply build the complete driver if DRM_GMA500 has been selected. Anyone who wants to enable one of the chips would probably also want the rest. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 837f23bb4b60 ("drm/gma500: Drop DRM_GMA3600 config option") Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209112721.3421-1-tzimmermann@suse.de
2021-02-09drm/gma500: Remove in_atomic() usage.Sebastian Andrzej Siewior
The driver is using msleep() if it is safe to use based on in_atomic(). This is not needed this macro is only used from i2c_algorithm::master_xfer() which is always invoked from preemptible context. Remove in_atomic() because it is superfluous. Remove wait_for_atomic() because it has no users. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210208233119.391103-2-bigeasy@linutronix.de
2021-02-08drm/udl: Move vmap out of commit tailThomas Zimmermann
Vmap operations may acquire the dmabuf reservation lock, which is not allowed within atomic commit-tail functions. Therefore move vmap and vunmap from the damage handler into prepare_fb and cleanup_fb callbacks. The mapping is provided as GEM shadow-buffered plane. The functions in the commit tail use the pre-established mapping for damage handling. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210208115538.6430-8-tzimmermann@suse.de
2021-02-08drm/gm12u320: Move vmap out of commit tailThomas Zimmermann
Vmap operations may acquire the dmabuf reservation lock, which is not allowed within atomic commit-tail functions. Therefore move vmap and vunmap from the damage handler into prepare_fb and cleanup_fb callbacks. The mapping is provided as GEM shadow-buffered plane. The functions in the commit tail use the pre-established mapping for damage handling. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210208115538.6430-7-tzimmermann@suse.de
2021-02-08drm/cirrus: Move vmap out of commit tailThomas Zimmermann
Vmap operations may acquire the dmabuf reservation lock, which is not allowed within atomic commit-tail functions. Therefore move vmap and vunmap from the damage handler into prepare_fb and cleanup_fb callbacks. The mapping is provided as GEM shadow-buffered plane. The functions in the commit tail use the pre-established mapping for damage handling. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210208115538.6430-6-tzimmermann@suse.de
2021-02-08drm/mgag200: Move vmap out of commit tailThomas Zimmermann
Vmap operations may acquire the dmabuf reservation lock, which is not allowed within atomic commit-tail functions. Therefore move vmap and vunmap from the damage handler into prepare_fb and cleanup_fb callbacks. The mapping is provided as GEM shadow-buffered plane. The functions in the commit tail use the pre-established mapping for damage handling. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210208115538.6430-5-tzimmermann@suse.de
2021-02-08drm: Add additional atomic helpers for shadow-buffered planesThomas Zimmermann
Several drivers use GEM buffer objects as shadow buffers for the actual framebuffer memory. Right now, drivers do these vmap operations in their commit tail, which is actually not allowed by the locking rules for the dma-buf reservation lock. The involved BO has to be vmapped in the plane's prepare_fb callback and vunmapped in cleanup_fb. This patch introduces atomic helpers for such shadow planes. Plane functions manage the plane state for shadow planes. The provided implementations for prepare_fb and cleanup_fb vmap and vunmap all BOs of struct drm_plane_state.fb. The mappings are afterwards available in the plane's commit-tail functions. For now, all rsp drivers use the simple KMS helpers, so we add the plane callbacks and wrappers for simple KMS. The internal plane functions can later be exported as needed. v3: * documentation fixes v2: * make duplicate_state interface compatible with struct drm_plane_funcs Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210208115538.6430-4-tzimmermann@suse.de
2021-02-08drm/gem: Export drm_gem_vmap() and drm_gem_vunmap()Thomas Zimmermann
The symbols will be required by the upcoming helpers for shadow-buffered planes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210208115538.6430-3-tzimmermann@suse.de
2021-02-08drm/simple-kms: Add plane-state helpersThomas Zimmermann
Just like regular plane-state helpers, drivers can use these new callbacks to create and destroy private plane state. v2: * make duplicate_state interface compatible with struct drm_plane_funcs Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210208115538.6430-2-tzimmermann@suse.de
2021-02-07drm/lima: add governor data with pre-defined thresholdsChristian Hewitt
This patch adapts the panfrost pre-defined thresholds change [0] to the lima driver to improve real-world performance. The upthreshold value has been set to ramp GPU frequency to max freq faster (compared to panfrost) to compensate for the lower overall performance of utgard devices. [0] https://patchwork.kernel.org/project/dri-devel/patch/20210121170445.19761-1-lukasz.luba@arm.com/ Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210127194047.21462-1-christianshewitt@gmail.com
2021-02-07drm/lima: Use delayed timer as default in devfreq profileLukasz Luba
Devfreq framework supports 2 modes for monitoring devices. Use delayed timer as default instead of deferrable timer in order to monitor the GPU status regardless of CPU idle. Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210127105121.20345-1-lukasz.luba@arm.com
2021-02-05drm/mgag200: make a const array static, makes object smallerColin Ian King
Don't populate the const array m_div_val on the stack but instead make it static. Makes the object code smaller by 29 bytes: Before: text data bss dec hex filename 34736 4552 0 39288 9978 drivers/gpu/drm/mgag200/mgag200_mode.o After: text data bss dec hex filename 34625 4616 0 39241 9949 drivers/gpu/drm/mgag200/mgag200_mode.o (gcc version 10.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210204191156.110778-1-colin.king@canonical.com
2021-02-05drm/scheduler: provide scheduler score externallyChristian König
Allow multiple schedulers to share the load balancing score. This is useful when one engine has different hw rings. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210204144405.2737-1-christian.koenig@amd.com
2021-02-05drm/qxl: allocate dumb buffers in ramGerd Hoffmann
dumb buffers are shadowed anyway, so there is no need to store them in device memory. Use QXL_GEM_DOMAIN_CPU (TTM_PL_SYSTEM) instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Link: http://patchwork.freedesktop.org/patch/msgid/20210204145712.1531203-11-kraxel@redhat.com