aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-12-07drm: panel: add Khadas TS050 panel driverNeil Armstrong3-0/+882
This add support for the Khadas TS050 1080x1920 5" LCD DSI panel designed to work with the Khadas Edge-V, Captain, VIM3 and VIM3L Single Board Computers. It provides a MIPI DSI interface to the host, a built-in LED backlight and touch controller. The init values was taken from the vendor source tree, comments were added to the know values but most of the init table is undocumented. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> [narmstrong: call drm_panel_remove if mipi_dsi_attach fails] Link: https://patchwork.freedesktop.org/patch/msgid/20201204081949.38418-3-narmstrong@baylibre.com
2020-12-07drm/vc4: dsi: Add configuration for BCM2711 DSI1Dave Stevenson1-2/+10
BCM2711 DSI1 doesn't have the issue with the ARM not being able to write to the registers, therefore remove the DMA workaround for that compatible string. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20201203132543.861591-8-maxime@cerno.tech
2020-12-07drm/vc4: dsi: Add support for DSI0Dave Stevenson1-0/+8
DSI0 was partially supported, but didn't register with the main driver, and the code was inconsistent as to whether it checked port == 0 or port == 1. Add compatible string and other support to make it consistent. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20201203132543.861591-6-maxime@cerno.tech
2020-12-07drm/vc4: dsi: Introduce a variant structureMaxime Ripard1-26/+37
Most of the differences between DSI0 and DSI1 are handled through the ID. However, the BCM2711 DSI is going to introduce one more variable to the mix and will break some expectations of the earlier, simpler, test. Let's add a variant structure that will address most of the differences between those three controllers. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20201203132543.861591-5-maxime@cerno.tech
2020-12-07drm/vc4: dsi: Use snprintf for the PHY clocks instead of an arrayMaxime Ripard1-8/+9
The DSI clocks setup function has been using an array to store the clock name of either the DSI0 or DSI1 blocks, using the port ID to choose the proper one. Let's switch to an snprintf call to do the same thing and simplify the array a bit. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20201203132543.861591-4-maxime@cerno.tech
2020-12-07drm/vc4: dsi: Correct DSI register definitionDave Stevenson1-2/+2
The DSI1_PHY_AFEC0_PD_DLANE1 and DSI1_PHY_AFEC0_PD_DLANE3 register definitions were swapped, so trying to use more than a single data lane failed as lane 1 would get powered down. (In theory a 4 lane device would work as all lanes would remain powered). Correct the definitions. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20201203132543.861591-3-maxime@cerno.tech
2020-12-07drm/vc4: drv: Remove the DSI pointer in vc4_drvMaxime Ripard2-10/+0
That pointer isn't used anywhere, so there's no point in keeping it. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20201203132543.861591-2-maxime@cerno.tech
2020-12-07drm/vc4: hdmi: Don't poll for the infoframes status on setupMaxime Ripard1-3/+7
The infoframes are sent at a regular interval as a data island packet, so we don't need to wait for them to be sent when we're setting them up. However, we do need to poll when we're enabling since the we can't update the packet RAM until it has been sent. Let's add a boolean flag to tell whether we want to poll or not to support both cases. Suggested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201203074624.721559-1-maxime@cerno.tech
2020-12-06drm/panel: s6e63m0: Fix init sequence againLinus Walleij1-10/+32
The DSI version of the panel behaved instable and close scrutiny of the vendor driver from the Samsung GT-S8190 shows a different initialization sequence for the DSI mode panel than the DPI mode panel. Make the initialization depend on whether we are in DSI or DPI mode and handle the differences. After this the panel on the GT-I8190 becomes much more stable. Also spell out some more custom DCS commands found in the vendor source code to cut down a bit on magic where we can. Fixes: f0aee45ffc8b ("drm/panel: s6e63m0: Fix init sequence") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Cc: Stephan Gerhold <stephan@gerhold.net> Link: https://patchwork.freedesktop.org/patch/msgid/20201205122229.1952980-1-linus.walleij@linaro.org
2020-12-05drm/kmb: fix array bounds warningArnd Bergmann1-0/+3
gcc warns about an out-of-bounds access when the using nonzero values for 'plane_id' on kmb->plane_status: drivers/gpu/drm/kmb/kmb_plane.c: In function 'kmb_plane_atomic_disable': drivers/gpu/drm/kmb/kmb_plane.c:128:20: warning: array subscript 3 is above array bounds of 'struct layer_status[1]' [-Warray-bounds] 128 | kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE; | ~~~~~~~~~~~~~~~~~^~~~~~~~~~ drivers/gpu/drm/kmb/kmb_plane.c:125:20: warning: array subscript 2 is above array bounds of 'struct layer_status[1]' [-Warray-bounds] 125 | kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE; | ~~~~~~~~~~~~~~~~~^~~~~~~~~~ drivers/gpu/drm/kmb/kmb_plane.c:122:20: warning: array subscript 1 is above array bounds of 'struct layer_status[1]' [-Warray-bounds] 122 | kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE; Having the array truncated to one entry seems intentional, so add a range check before indexing it to make it clearer what is going on and shut up the warning. I received the warning from the kernel test robot after a private patch that turns on Warray-bounds unconditionally. Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201129200927.1854104-1-arnd@kernel.org
2020-12-05drm: panel: add flags to BOE NV110WTM-N61Douglas Anderson1-0/+2
I forgot to add these when posting up the support for BOE NV110WTM-N61. Add them now. Fixes: a96ee0f6b58d ("drm: panel: simple: Add BOE NV110WTM-N61") Signed-off-by: Douglas Anderson <dianders@chromium.org> Cc: Douglas Anderson <dianders@chromium.org> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201201125554.v2.1.I8a7bfc0966e803ab91001c9e6d01a736950c4981@changeid
2020-12-05drm: panel: Fully transition panel_desc kerneldoc to inline styleDouglas Anderson1-16/+27
In commit 131f909ad55f ("drm: panel: simple: Fixup the struct panel_desc kernel doc") I transitioned the more deeply nested kerneldoc comments into the inline style. Apparently it is desirable to continue the job and move _everything_ in this struct to inline. Let's do it. While doing this, we also add a short summary for the whole struct to fix a warning when we run with extra warnings, AKA: scripts/kernel-doc -v -rst drivers/gpu/drm/panel/panel-simple.c The warning was: drivers/gpu/drm/panel/panel-simple.c:42: warning: missing initial short description on line: * struct panel_desc Suggested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Cc: Douglas Anderson <dianders@chromium.org> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201201125822.1.I3c4191336014bd57364309439e56f600c94bb12b@changeid
2020-12-04drm/hisilicon: Delete the entire file hibmc_ttm.cTian Tao4-57/+20
Delete the entire file hibmc_ttm.c. drmm_vram_helper_init() can be called directly from hibmc_load(). hibmc_dumb_create() and hibmc_mode_funcs can go to hibmc_drm_drv.c v2: change Deletted to Delete Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/1607044999-47666-13-git-send-email-tiantao6@hisilicon.com
2020-12-04drm/hisilicon: Use managed VRAM-helper initializationTian Tao3-18/+3
updated to use drmm_vram_helper_init() Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/1606964953-24309-1-git-send-email-tiantao6@hisilicon.com
2020-12-04drm/ingenic: depend on COMMON_CLK to fix compile testsKrzysztof Kozlowski1-0/+1
The Ingenic DRM uses Common Clock Framework thus it cannot be built on platforms without it (e.g. compile test on MIPS with RALINK and SOC_RT305X): /usr/bin/mips-linux-gnu-ld: drivers/gpu/drm/ingenic/ingenic-drm-drv.o: in function `ingenic_drm_bind.isra.0': ingenic-drm-drv.c:(.text+0x1600): undefined reference to `clk_get_parent' /usr/bin/mips-linux-gnu-ld: ingenic-drm-drv.c:(.text+0x16b0): undefined reference to `clk_get_parent' Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://patchwork.freedesktop.org/patch/msgid/20201116175301.402787-2-krzk@kernel.org
2020-12-03drm/fb-helper: Add missed unlocks in setcmap_legacy()Chuhong Yuan1-5/+10
setcmap_legacy() does not call drm_modeset_unlock_all() in some exits, add the missed unlocks with goto to fix it. Fixes: 964c60063bff ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths") Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20201203144248.418281-1-hslester96@gmail.com
2020-12-03gma500: clean up error handling in initDan Carpenter1-9/+13
The main problem with this error handling was that it didn't clean up if i2c_add_numbered_adapter() failed. This code is pretty old, and doesn't match with today's checkpatch.pl standards so I took the opportunity to tidy it up a bit. I changed the NULL comparison, and removed the WARNING message if kzalloc() fails and updated the label names. Fixes: 1b082ccf5901 ("gma500: Add Oaktrail support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/X8ikkAqZfnDO2lu6@mwanda
2020-12-03drm/hisilicon: Use the new api devm_drm_irq_installTian Tao1-4/+1
Use devm_drm_irq_install to register interrupts so that drm_irq_uninstall is not called when hibmc is removed. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/1606901212-8214-4-git-send-email-tiantao6@hisilicon.com
2020-12-03drm/irq: Add the new api to install irqTian Tao1-0/+32
Add new api devm_drm_irq_install() to register interrupts, no need to call drm_irq_uninstall() when the drm module is removed. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/1606901212-8214-3-git-send-email-tiantao6@hisilicon.com
2020-12-03drm/hisilicon: Code refactoring for hibmc_drm_drvTian Tao5-32/+30
Use the devm_drm_dev_alloc provided by the drm framework to alloc a structure hibmc_drm_private. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/1606901212-8214-2-git-send-email-tiantao6@hisilicon.com
2020-12-02drm/virtio: consider dma-fence context when signalingGurchetan Singh2-9/+31
This an incremental refactor towards multiple dma-fence contexts in virtio-gpu. Since all fences are still allocated using &virtio_gpu_fence_driver.context, nothing should break and every processed fence will be signaled. The overall idea is every 3D context can allocate a number of dma-fence contexts. Each dma-fence context refers to it's own timeline. For example, consider the following case where virgl submits commands to the GPU (fence ids 1, 3) and does a metadata query with the CPU (fence id 5). In a different process, gfxstream submits commands to the GPU (fence ids 2, 4). fence_id (&dma_fence.seqno) | 1 2 3 4 5 ----------------------------------|----------- fence_ctx 0 (virgl gpu) | 1 3 fence_ctx 1 (virgl metadata query)| 5 fence_ctx 2 (gfxstream gpu) | 2 4 With multiple fence contexts, we can wait for the metadata query to finish without waiting for the virgl gpu to finish. virgl gpu does not have to wait for gfxstream gpu. The fence id still is the monotonically increasing sequence number, but it's only revelant to the specific dma-fence context. To fully enable this feature, we'll need to: - have each 3d context allocate a number of fence contexts. Not too hard with explicit context initialization on the horizon. - have guest userspace specify fence context when performing ioctls. - tag each fence emitted to the host with the fence context information. virtio_gpu_ctrl_hdr has padding + flags available, so that should be easy. This change goes in the direction specified above, by: - looking up the virtgpu_fence given a fence_id - signalling all prior fences in a given context - signalling current fence v2: fix grammar in comment v3: add r-b tags Reviewed-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com> Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/20201201021623.619-3-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-12-02drm/virtio: rework virtio_fence_signaledGurchetan Singh1-8/+4
virtio_gpu_fence_event_process sets the last_fence_id and subsequently calls dma_fence_signal_locked(..). dma_fence_signal_locked(..) sets DMA_FENCE_FLAG_SIGNALED_BIT, which is actually checked before &dma_fence_ops.(*signaled) is called. The check for last_fence_id is therefore a bit redundant, and it will not be sufficient to check the last_fence_id for multiple synchronization timelines. Remove it. v3: add r-b tags Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com> Link: http://patchwork.freedesktop.org/patch/msgid/20201201021623.619-2-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-12-02drm/virtio: virtio_{blah} --> virtio_gpu_{blah}Gurchetan Singh2-26/+30
virtio_gpu typically uses the prefix virtio_gpu, but there are a few places where the virtio prefix is used. Modify this for consistency. v3: add r-b tags Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com> Link: http://patchwork.freedesktop.org/patch/msgid/20201201021623.619-1-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-12-01drm/ttm: stop destroying pinned ghost objectChristian König1-1/+3
Daniel added a warning for this, but we were abusing that behavior here. Signed-off-by: Christian König <christian.koenig@amd.com> Fixes: 57fcd550eb15 ("drm/ttm: Warn on pinning without holding a reference") Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/series/84456/
2020-12-01drm/nouveau: Drop mutex_lock_nested for atomicDaniel Vetter1-1/+4
Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh. This annotation was originally added in commit 060810d7abaabcab282e062c595871d661561400 Author: Ben Skeggs <bskeggs@redhat.com> Date: Mon Jul 8 14:15:51 2013 +1000 drm/nouveau: fix locking issues in page flipping paths due to commit b580c9e2b7ba5030a795aa2fb73b796523d65a78 Author: Maarten Lankhorst <m.b.lankhorst@gmail.com> Date: Thu Jun 27 13:48:18 2013 +0200 drm/nouveau: make flipping lockdep safe Acked-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Maarten Lankhorst <m.b.lankhorst@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Dave Airlie <airlied@gmail.com> Cc: nouveau@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20201127163528.2221671-1-daniel.vetter@ffwll.ch
2020-12-01drm/gma500: Fix error return code in psb_driver_load()Jialin Zhang1-0/+2
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 5c49fd3aa0ab ("gma500: Add the core DRM files and headers") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20201130020216.1906141-1-zhangjialin11@huawei.com
2020-12-01drm/ttm/drivers: remove unecessary ttm_module.h include v2Christian König19-18/+46
ttm_module.h deals with internals of TTM and should never be include outside of it. v2: also move the file around Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/404885/
2020-11-30drm/prime: split array import functions v4Christian König10-48/+56
Mapping the imported pages of a DMA-buf into an userspace process doesn't work as expected. But we have reoccurring requests on this approach, so split the functions for this and document that dma_buf_mmap() needs to be used instead. v2: split it into two functions v3: rebased on latest changes v4: update commit message a bit Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/403838/
2020-11-30drm/ttm: nuke ttm_dma_tt_initChristian König1-13/+0
Not used any more. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/403837/
2020-11-30drm/qxl: switch to ttm_sg_tt_initChristian König1-1/+1
The function qxl_gem_prime_import_sg_table is not fully implemented. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/403833/
2020-11-30drm/vmwgfx: switch to ttm_sg_tt_initChristian König1-2/+2
According to Daniel VMWGFX doesn't support DMA-buf anyway. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/403834/
2020-11-30drm/nouveau: stop using pages with drm_prime_sg_to_page_addr_arrays v2Christian König2-4/+4
This is deprecated, also drop the comment about faults. v2: also use ttm_sg_tt_init to avoid allocating the page array. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/403835/
2020-11-30drm/amdgpu: stop using pages with drm_prime_sg_to_page_addr_arraysChristian König1-3/+3
This is deprecated. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/403836/
2020-11-30drm/radeon: stop using pages with drm_prime_sg_to_page_addr_arrays v2Christian König1-5/+6
This is deprecated. v2: also use ttm_sg_tt_init to avoid allocating the page array. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/403832/
2020-11-30drm/cma-helper: Implement mmap as GEM CMA object functionsThomas Zimmermann4-87/+41
The new GEM object function drm_gem_cma_mmap() sets the VMA flags and offset as in the old implementation and immediately maps in the buffer's memory pages. Changing CMA helpers to use the GEM object function allows for the removal of the special implementations for mmap and gem_prime_mmap callbacks. The regular functions drm_gem_mmap() and drm_gem_prime_mmap() are now used. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201123115646.11004-3-tzimmermann@suse.de
2020-11-30drm/cma-helper: Remove prime infix from GEM object functionsThomas Zimmermann2-12/+12
These functions are not directly related to PRIME interfaces any longer, but are now GEM object functions. Rename them accordingly and fix the docs. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201123115646.11004-2-tzimmermann@suse.de
2020-11-29drm: panel: simple: Add BOE NV110WTM-N61Douglas Anderson1-0/+46
Add support for the BOE NV110WTM-N61 panel. The EDID lists two modes (one for 60 Hz refresh rate and one for 40 Hz), so we'll list both of them here. Note that the panel datasheet requires 80 ms between HPD asserting and the backlight power being turned on. We'll use the new timing constraints structure to do this cleanly. This assumes that the backlight will be enabled _after_ the panel enable finishes. This is how it works today and seems a sane assumption. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201109170018.v4.4.I71b2118dfc00fd7b43b02d28e7b890081c2acfa2@changeid
2020-11-29drm: panel: simple: Allow specifying the delay from prepare to enableDouglas Anderson1-6/+38
On the panel I'm looking at, there's an 80 ms minimum time between HPD being asserted by the panel and setting the backlight enable GPIO. While we could just add an 80 ms "enable" delay, this is not ideal. Link training is allowed to happen in parallel with this delay so the fixed 80 ms delay over-delays. We'll support this by logging the time at the end of prepare and then delaying in enable if enough time hasn't passed. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201109170018.v4.3.Ib9ce3c6482f464bf594161581521ced46bbd54ed@changeid
2020-11-29drm: panel: simple: Defer unprepare delay till next prepare to shorten itDouglas Anderson1-3/+24
It is believed that all of the current users of the "unprepare" delay don't actually need to wait the amount of time specified directly in the unprepare phase. The purpose of the delay that's specified is to allow the panel to fully power off so that we don't try to power it back on before it's managed to full power down. Let's use this observation to avoid the fixed delay that we currently have. Instead of delaying, we'll note the current time when the unprepare happens. If someone then tries to prepare the panel later and not enough time has passed, we'll do the delay before starting the prepare phase. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201109170018.v4.2.I06a95d83e7fa1bd919c8edd63dacacb5436e495a@changeid
2020-11-29drm: panel: simple: Fixup the struct panel_desc kernel docDouglas Anderson1-17/+42
When I run: scripts/kernel-doc -rst drivers/gpu/drm/panel/panel-simple.c I see that several of the kernel-doc entries aren't showing up because they don't specify the full path down the hierarchy. Let's fix that and also move to inline kernel docs. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201109170018.v4.1.Icaa86f0a4ca45a9a7184da4bc63386b29792d613@changeid
2020-11-29drm/kmb: Remove an unnecessary NULL checkDan Carpenter1-1/+1
The NULL checking isn't done consistently in this function and it leads to a static checker warning: drivers/gpu/drm/kmb/kmb_drv.c:561 kmb_pm_suspend() error: we previously assumed 'drm' could be null (see line 559) Fortunately "drm" cannot be NULL at this point so the check can just be removed. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201117072137.GB1111239@mwanda
2020-11-29drm/rockchip: fix typo in Kconfig 's/HDMI/dsi/'Dafna Hirschfeld1-1/+1
In the help of ROCKCHIP_DW_MIPI_DSI it said it is a HDMI driver instead of a dsi driver. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20201116141609.26719-1-dafna.hirschfeld@collabora.com
2020-11-29drm/rockchip: for error print, use the correct device pointerDafna Hirschfeld1-1/+1
There is a use of DRM_DEV_ERROR(dsi->dev,..) which should be replaced with DRM_DEV_ERROR(dev, ..) since dsi->dev is set later Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20201116141609.26719-2-dafna.hirschfeld@collabora.com
2020-11-29drm/rockchip: dw_hdmi: fix incorrect clock in vpll clock error messageJonathan Liu1-1/+1
Error message incorrectly refers to grf clock instead of vpll clock. Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20201024035321.4898-1-net147@gmail.com
2020-11-28drm/ingenic: Add basic PM supportPaul Cercueil1-0/+18
Call drm_mode_config_helper_suspend() and drm_mode_config_helper_resume() on suspend and resume, respectively. This makes sure that the display stack is properly disabled when the hardware is put to sleep. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201128171606.132830-1-paul@crapouillou.net
2020-11-27drm/ttm: Warn on pinning without holding a referenceDaniel Vetter1-1/+1
Not technically a problem for ttm, but very likely a driver bug and pretty big time confusing for reviewing code. So warn about it, both at cleanup time (so we catch these for sure) and at pin/unpin time (so we know who's the culprit). Reviewed-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Christian Koenig <christian.koenig@amd.com> Cc: Huang Rui <ray.huang@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201028113120.3641237-1-daniel.vetter@ffwll.ch
2020-11-27via/via_irq: use __func__ to replace string function nameBernard Zhao1-1/+1
This change also fix checkpatch.pl warning: WARNING: Prefer using '"%s...", __func__' to using 'via_driver_irq_postinstall', this function's name, in a string + DRM_DEBUG("via_driver_irq_postinstall\n"); Signed-off-by: Bernard Zhao <bernard@vivo.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20201119072957.108941-1-bernard@vivo.com
2020-11-27drm/radeon: fix check order in radeon_bo_moveChristian König1-30/+24
Reorder the code to fix checking if blitting is available. Signed-off-by: Christian König <christian.koenig@amd.com> Fixes: 28a68f828266 ("drm/radeon/ttm: use multihop") Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/403847/
2020-11-26drm/imx/dcss: allow using nearest neighbor interpolation scalingLaurentiu Palcu3-10/+50
This patch adds support for using NN interpolation scaling by setting the SCALING_FILTER plane property to 1. Otherwise, the default method is used. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/20201105145018.27255-1-laurentiu.palcu@oss.nxp.com
2020-11-26drm/imx/dcss: fix coccinelle warningLaurentiu Palcu1-2/+1
This small patch fixes a warning that I got while running coccinelle: CHECK drivers/gpu/drm/imx/dcss/dcss-plane.c drivers/gpu/drm/imx/dcss/dcss-plane.c:107:21-23: WARNING !A || A && B is equivalent to !A || B Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ") Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/20201105140127.25249-3-laurentiu.palcu@oss.nxp.com