Re: [PATCH v4 03/20] drm: allow real encoder to be passed for drm_writeback_connector

2022-04-24 Thread Laurent Pinchart
Hi Abhinav, Thank you for the patch. On Fri, Apr 22, 2022 at 04:06:38PM -0700, Abhinav Kumar wrote: > For some vendor driver implementations, display hardware can > be shared between the encoder used for writeback and the physical > display. > > In addition resources such as clocks and

[PATCH] drm/kmb: Fix unsigned function returning negative constant

2022-04-24 Thread Haowen Bai
The function check_pixel_format has an unsigned return type, but returns a negative constant to indicate an error condition. So we change unsigned to int. Signed-off-by: Haowen Bai --- drivers/gpu/drm/kmb/kmb_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] drm/amd/display: fix if == else warning

2022-04-24 Thread Guo Zhengkui
Fix the following coccicheck warning: drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c:98:8-10: WARNING: possible condition with no effect (if == else) Signed-off-by: Guo Zhengkui --- drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c | 2 -- 1 file changed, 2 deletions(-) diff --git

Re: [PATCH] drm: rcar-du: Add setting to PnALPHAR register on Gen3

2022-04-24 Thread Laurent Pinchart
Hi Biju, Thank you for the patch. On Sat, Apr 23, 2022 at 08:37:28AM +0100, Biju Das wrote: > From: LUU HOAI > > In Gen3, when Alpha blend is enabled in the PnMR register, > depending on the initial value of the PnALPHAR register, > either channel of DU might be black screen. > Therefore, this

Re: [PATCH v4 01/20] drm: allow passing possible_crtcs to drm_writeback_connector_init()

2022-04-24 Thread Laurent Pinchart
Hi Abhinav, Thank you for the patch. On Fri, Apr 22, 2022 at 04:06:36PM -0700, Abhinav Kumar wrote: > Clients of drm_writeback_connector_init() initialize the > possible_crtcs and then invoke the call to this API. > > To simplify things, allow passing possible_crtcs as a parameter > to

Re: [PATCH v4 02/20] drm: introduce drm_writeback_connector_init_with_encoder() API

2022-04-24 Thread Laurent Pinchart
Hi Abhinav, Thank you for the patch. On Fri, Apr 22, 2022 at 04:06:37PM -0700, Abhinav Kumar wrote: > For vendors drivers which pass an already allocated and > initialized encoder especially for cases where the encoder > hardware is shared OR the writeback encoder shares the resources > with the

Re: [PATCH v2 00/48] ARM: PXA multiplatform support

2022-04-24 Thread Arnd Bergmann
On Sun, Apr 24, 2022 at 4:09 AM Guenter Roeck wrote: > On 4/23/22 12:55, Arnd Bergmann wrote: > > On Sat, Apr 23, 2022 at 1:41 AM Guenter Roeck wrote: > >> On Sat, Apr 23, 2022 at 12:04:31AM +0200, Arnd Bergmann wrote: > > > > Odd, I can't reproduce this at all. Do you get any console output at

Re: [PATCH v2 00/48] ARM: PXA multiplatform support

2022-04-24 Thread Guenter Roeck
On 4/24/22 01:52, Arnd Bergmann wrote: On Sun, Apr 24, 2022 at 4:09 AM Guenter Roeck wrote: On 4/23/22 12:55, Arnd Bergmann wrote: On Sat, Apr 23, 2022 at 1:41 AM Guenter Roeck wrote: On Sat, Apr 23, 2022 at 12:04:31AM +0200, Arnd Bergmann wrote: Odd, I can't reproduce this at all. Do you

[PATCH v3 00/14] drm/sun4i: Allwinner D1 Display Engine 2.0 Support

2022-04-24 Thread Samuel Holland
This series adds binding and driver support for Display Engine 2.0 variant found in the Allwinner D1. So far it has only been tested with HDMI. I will be sending the HDMI support series separately, because the hardware comes with a brand new custom HDMI PHY, which requires some refactoring to

[PATCH v3 02/14] dt-bindings: display: Add D1 display engine compatibles

2022-04-24 Thread Samuel Holland
Allwinner D1 contains a display engine 2.0. It features two mixers, a TCON TOP (with DSI and HDMI), one TCON LCD, and one TCON TV. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Samuel Holland --- Changes in v3: - Drop redundant minItems and maxItems

[PATCH v2 2/2] drm: bridge: adv7511: use non-legacy mode for CEC RX

2022-04-24 Thread Alvin Šipraga
From: Alvin Šipraga The ADV7511 family of bridges supports two modes for CEC RX: legacy and non-legacy mode. The only difference is whether the chip uses a single CEC RX buffer, or uses all three available RX buffers. Currently the adv7511 driver uses legacy mode. While debugging a stall in CEC

[PATCH v2 1/2] drm: bridge: adv7511: enable CEC support for ADV7535

2022-04-24 Thread Alvin Šipraga
From: Alvin Šipraga Like the ADV7533, the ADV7535 has an offset for the CEC register map, and it is the same value (ADV7533_REG_CEC_OFFSET = 0x70). Rather than testing for numerous chip types in the offset calculations throughout the driver, just compute it during driver probe and put it in the

[PATCH v2 0/2] drm: bridge: adv7511: CEC support for ADV7535

2022-04-24 Thread Alvin Šipraga
From: Alvin Šipraga Changes: v1->v2: - add Robert's r-b - fix up 'case XXX...YYY+14' statements to read nicer in the 2nd patch We have an ADV7535 which is nominally supported by this driver. These two patches fix up the driver to get CEC working too. The first adds the basic support by

Re: [PATCH 5.10.y] drm/cirrus: fix a NULL vs IS_ERR() checks

2022-04-24 Thread Shile Zhang
Hi David and Daniel, Sorry but could you please help to check this issue? Due to the function 'drm_gem_shmem_vmap' could return ERROR pointers which will cause the kernel crash due to 'cirrus_fb_blit_rect' only check the pointer. Since the related code has been refactoring in mainline, so

Re: [PATCH v2 00/48] ARM: PXA multiplatform support

2022-04-24 Thread Arnd Bergmann
On Sun, Apr 24, 2022 at 5:28 PM Guenter Roeck wrote: > On 4/24/22 01:52, Arnd Bergmann wrote: > > On Sun, Apr 24, 2022 at 4:09 AM Guenter Roeck wrote: > > into the defconfig file, otherwise the multiplatform target defaults to > > an ARMv7 instead of ARMv5 build. For an OMAP15xx as in the SX1, >

Re: [Freedreno] [PATCH v4 03/20] drm: allow real encoder to be passed for drm_writeback_connector

2022-04-24 Thread Laurent Pinchart
Hi Abhinav, On Sun, Apr 24, 2022 at 11:23:20AM -0700, Abhinav Kumar wrote: > On 4/24/2022 11:12 AM, Abhinav Kumar wrote: > > On 4/24/2022 7:50 AM, Laurent Pinchart wrote: > >> On Fri, Apr 22, 2022 at 04:06:38PM -0700, Abhinav Kumar wrote: > >>> For some vendor driver implementations, display

Re: [PATCH v3 04/14] drm/sun4i: hdmi: Use more portable I/O helpers

2022-04-24 Thread Jernej Škrabec
Dne nedelja, 24. april 2022 ob 18:26:22 CEST je Samuel Holland napisal(a): > readsb/writesb are unavailable on some architectures. In preparation for > removing the Kconfig architecture dependency, switch to the equivalent > but more portable ioread/write8_rep helpers. > > Reported-by: kernel

Re: [PATCH v3 12/14] drm/sun4i: Add support for D1 TCON TOP

2022-04-24 Thread Jernej Škrabec
Dne nedelja, 24. april 2022 ob 18:26:30 CEST je Samuel Holland napisal(a): > D1 has a TCON TOP with TCON TV0 and DSI, but no TCON TV1. This puts the > DSI clock name at index 1 in clock-output-names. Support this by only > incrementing the index for clocks that are actually supported. > >

RE: [PATCH] drm/amd/display: fix if == else warning

2022-04-24 Thread Liu, Zhan
[AMD Official Use Only - General] > -Original Message- > From: Guo Zhengkui > Sent: 2022/April/24, Sunday 5:06 AM > To: Wentland, Harry ; Li, Sun peng (Leo) > ; Siqueira, Rodrigo ; > Deucher, Alexander ; Koenig, Christian > ; Pan, Xinhui ; David Airlie > ; Daniel Vetter ; Liu, Charlene >

RE: [PATCH] drm: rcar-du: Add setting to PnALPHAR register on Gen3

2022-04-24 Thread Biju Das
Hi Laurent, Thanks for the feedback. > Subject: Re: [PATCH] drm: rcar-du: Add setting to PnALPHAR register on > Gen3 > > Hi Biju, > > Thank you for the patch. > > On Sat, Apr 23, 2022 at 08:37:28AM +0100, Biju Das wrote: > > From: LUU HOAI > > > > In Gen3, when Alpha blend is enabled in the

[PATCH v3 13/14] drm/sun4i: Add support for D1 TCONs

2022-04-24 Thread Samuel Holland
D1 has a TCON TOP, so its quirks are similar to those for the R40 TCONs. While there are some register changes, the part of the TCON TV supported by the driver matches the R40 quirks, so that quirks structure can be reused. D1 has the first supported TCON LCD with a TCON TOP, so the TCON LCD needs

[PATCH v3 14/14] drm/sun4i: Add compatible for D1 display engine

2022-04-24 Thread Samuel Holland
Now that the various blocks in the D1 display engine pipeline are supported, we can enable the overall engine. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland --- (no changes since v1) drivers/gpu/drm/sun4i/sun4i_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v3 06/14] sun4i/drm: engine: Add mode_set callback

2022-04-24 Thread Samuel Holland
From: Jernej Skrabec This optional callback is useful for setting properties which depends only on current mode. Such properties are width, height and interlaced output. These properties are currently set in update layer callback for primary plane which is less than ideal. More about that in

[PATCH v3 04/14] drm/sun4i: hdmi: Use more portable I/O helpers

2022-04-24 Thread Samuel Holland
readsb/writesb are unavailable on some architectures. In preparation for removing the Kconfig architecture dependency, switch to the equivalent but more portable ioread/write8_rep helpers. Reported-by: kernel test robot Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: -

[PATCH v3 08/14] sun4i/drm: sun8i: use mode_set engine callback

2022-04-24 Thread Samuel Holland
From: Jernej Skrabec Newly introduced mode_set callback in engine structure is a much better place for setting mixer output size and interlace mode for the following reasons: 1. Aforementioned properties change only when mode changes, so it's enough to be set only once per mode set. Currently

[PATCH v3 05/14] drm/sun4i: Allow building the driver on RISC-V

2022-04-24 Thread Samuel Holland
Allwinner D1 is a RISC-V SoC which contains a DE 2.0 engine. Let's remove the dependency on a specific CPU architecture, so the driver can be built wherever ARCH_SUNXI is selected. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland --- (no changes since v1) drivers/gpu/drm/sun4i/Kconfig

[PATCH v3 07/14] sun4i/drm: backend: use mode_set engine callback

2022-04-24 Thread Samuel Holland
From: Jernej Skrabec Newly introduced mode_set callback in engine structure is a much better place for setting backend output size and interlace mode for following reasons: 1. Aforementioned properties change only when mode changes, so it's enough to be set only once per mode set. Currently

[PATCH v3 12/14] drm/sun4i: Add support for D1 TCON TOP

2022-04-24 Thread Samuel Holland
D1 has a TCON TOP with TCON TV0 and DSI, but no TCON TV1. This puts the DSI clock name at index 1 in clock-output-names. Support this by only incrementing the index for clocks that are actually supported. Signed-off-by: Samuel Holland --- (no changes since v1)

[PATCH v3 10/14] drm/sun4i: csc: Add support for the new MMIO layout

2022-04-24 Thread Samuel Holland
D1 changes the MMIO offsets for the CSC blocks in the first mixer. The mixers' ccsc property is used as an index into the ccsc_base array. Use an enumeration to describe this index, and add the new set of offsets. Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Use an

[PATCH v3 11/14] drm/sun4i: Add support for D1 mixers

2022-04-24 Thread Samuel Holland
D1 has a display engine with the usual pair of mixers, albeit with relatively few layers. In fact, D1 appears to be the first SoC to have a mixer without any UI layers. Add support for these new variants. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland --- (no changes since v1)

[PATCH v3 03/14] drm/sun4i: Remove obsolete references to PHYS_OFFSET

2022-04-24 Thread Samuel Holland
commit b4bdc4fbf8d0 ("soc: sunxi: Deal with the MBUS DMA offsets in a central place") added a platform device notifier that sets the DMA offset for all of the display engine frontend and backend devices. The code applying the offset to DMA buffer physical addresses was then removed from the

[PATCH v3 01/14] dt-bindings: display: Separate clock item lists by compatible

2022-04-24 Thread Samuel Holland
So far, the binding and driver have relied on the fact that the H6 clocks are both a prefix and a subset of the R40 clocks. This allows them to share the clocks/clock-names items and the clock-output-names order between the hardware variants. However, the D1 hardware has TCON TV0 and DSI, but no

[PATCH v3 09/14] drm/sun4i: Allow VI layers to be primary planes

2022-04-24 Thread Samuel Holland
D1's mixer 1 has no UI layers, only a single VI layer. That means the mixer can only be used if the primary plane comes from this VI layer. Add the code to handle this case. Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Use Jernej's patches for mixer mode setting.

Re: [PATCH v3 10/14] drm/sun4i: csc: Add support for the new MMIO layout

2022-04-24 Thread Jernej Škrabec
Dne nedelja, 24. april 2022 ob 18:26:28 CEST je Samuel Holland napisal(a): > D1 changes the MMIO offsets for the CSC blocks in the first mixer. The > mixers' ccsc property is used as an index into the ccsc_base array. Use > an enumeration to describe this index, and add the new set of offsets. >

Re: [PATCH v3 09/14] drm/sun4i: Allow VI layers to be primary planes

2022-04-24 Thread Jernej Škrabec
Dne nedelja, 24. april 2022 ob 18:26:27 CEST je Samuel Holland napisal(a): > D1's mixer 1 has no UI layers, only a single VI layer. That means the > mixer can only be used if the primary plane comes from this VI layer. > Add the code to handle this case. > > Signed-off-by: Samuel Holland

Re: [Freedreno] [PATCH v4 03/20] drm: allow real encoder to be passed for drm_writeback_connector

2022-04-24 Thread Abhinav Kumar
On 4/24/2022 11:12 AM, Abhinav Kumar wrote: Hi Laurent On 4/24/2022 7:50 AM, Laurent Pinchart wrote: Hi Abhinav, Thank you for the patch. On Fri, Apr 22, 2022 at 04:06:38PM -0700, Abhinav Kumar wrote: For some vendor driver implementations, display hardware can be shared between the

[PATCH] drm/v3d: Fix null pointer dereference of pointer perfmon

2022-04-24 Thread Colin Ian King
In the unlikely event that pointer perfmon is null the WARN_ON return path occurs after the pointer has already been deferenced. Fix this by only dereferencing perfmon after it has been null checked. Fixes: 26a4dc29b74a ("drm/v3d: Expose performance counters to userspace") Signed-off-by: Colin

Re: [PATCH v3 13/14] drm/sun4i: Add support for D1 TCONs

2022-04-24 Thread Jernej Škrabec
Dne nedelja, 24. april 2022 ob 18:26:31 CEST je Samuel Holland napisal(a): > D1 has a TCON TOP, so its quirks are similar to those for the R40 TCONs. > While there are some register changes, the part of the TCON TV supported > by the driver matches the R40 quirks, so that quirks structure can be >

[PATCH] drm: rcar-du: Drop file name from comment header blocks

2022-04-24 Thread Laurent Pinchart
The comment blocks at the beginning of each file have a one-line summary description of the file that includes the file name. While the description is useful, the file name only creates opportunities for mistakes (as seen in rcar_du_vsp.c) without any added value. Drop it. Reported-by: Biju Das

Re: [PATCH v3 2/4] drm: rcar-du: Fix typo

2022-04-24 Thread Laurent Pinchart
Hello, On Fri, Apr 22, 2022 at 09:38:00AM +, Biju Das wrote: > > Subject: Re: [PATCH v3 2/4] drm: rcar-du: Fix typo > > On Thu, Apr 21, 2022 at 6:31 PM Biju Das wrote: > > > Fix typo rcar_du_vsp.h->rcar_du_vsp.c > > > > > > Signed-off-by: Biju Das > > > > Thanks for your patch! > > > > >

RE: [PATCH v3 2/4] drm: rcar-du: Fix typo

2022-04-24 Thread Biju Das
Hi Laurent, > Subject: Re: [PATCH v3 2/4] drm: rcar-du: Fix typo > > Hello, > > On Fri, Apr 22, 2022 at 09:38:00AM +, Biju Das wrote: > > > Subject: Re: [PATCH v3 2/4] drm: rcar-du: Fix typo On Thu, Apr 21, > > > 2022 at 6:31 PM Biju Das wrote: > > > > Fix typo rcar_du_vsp.h->rcar_du_vsp.c

Re: [PATCH v4 03/20] drm: allow real encoder to be passed for drm_writeback_connector

2022-04-24 Thread Abhinav Kumar
Hi Laurent On 4/24/2022 7:50 AM, Laurent Pinchart wrote: Hi Abhinav, Thank you for the patch. On Fri, Apr 22, 2022 at 04:06:38PM -0700, Abhinav Kumar wrote: For some vendor driver implementations, display hardware can be shared between the encoder used for writeback and the physical display.

[PATCH v5 14/17] drm/panfrost: Switch to generic memory shrinker

2022-04-24 Thread Dmitry Osipenko
Replace Panfrost's memory shrinker with a generic DRM SHMEM memory shrinker. Tested-by: Steven Price Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/panfrost/Makefile | 1 - drivers/gpu/drm/panfrost/panfrost_device.h| 4 - drivers/gpu/drm/panfrost/panfrost_drv.c |

[PATCH v5 13/17] drm/virtio: Support memory shrinking

2022-04-24 Thread Dmitry Osipenko
Support generic DRM SHMEM memory shrinker and add new madvise IOCTL to the VirtIO-GPU driver. Userspace (BO cache manager of Mesa driver) will mark BOs as "don't need" using the new IOCTL to let shrinker purge the marked BOs on OOM, the shrinker will also evict unpurgeable shmem BOs from memory if

[PATCH v5 17/17] drm/shmem-helper: Remove drm_gem_shmem_purge_locked()

2022-04-24 Thread Dmitry Osipenko
Panfrost driver was the only user of the drm_gem_shmem_purge_locked() helper. Panfrost driver was converted to use new generic memory shrinker and the helper doesn't have users anymore, remove it. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c | 30

[PATCH v5 15/17] drm/shmem-helper: Make drm_gem_shmem_get_pages() private

2022-04-24 Thread Dmitry Osipenko
VirtIO-GPU driver was the only user of drm_gem_shmem_get_pages() and it now uses drm_gem_shmem_get_pages_sgt(). Make the get_pages() private to drm_gem_shmem_helper. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c | 3 +-- include/drm/drm_gem_shmem_helper.h | 1 -

[PATCH v5 12/17] drm/shmem-helper: Add generic memory shrinker

2022-04-24 Thread Dmitry Osipenko
Introduce a common DRM SHMEM shrinker. It allows to reduce code duplication among DRM drivers that implement theirs own shrinkers. This is initial version of the shrinker that covers basic needs of GPU drivers, both purging and eviction of shmem objects are supported. This patch is based on a

[PATCH v5 16/17] drm/shmem-helper: Make drm_gem_shmem_is_purgeable() private

2022-04-24 Thread Dmitry Osipenko
Panfrost driver was the only user of the drm_gem_shmem_is_purgeable() helper. Panfrost driver was converted to use new generic memory shrinker and the helper doesn't have external users anymore, hence make it private to the drm_gem_shmem_helper.c to keep the code clean. Signed-off-by: Dmitry

[PATCH v5 05/17] drm/virtio: Unlock reservations on dma_resv_reserve_fences() error

2022-04-24 Thread Dmitry Osipenko
Unlock reservations on dma_resv_reserve_fences() error to fix recursive locking of the reservations when this error happens. Cc: sta...@vger.kernel.org Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v5 08/17] drm/virtio: Improve DMA API usage for shmem BOs

2022-04-24 Thread Dmitry Osipenko
DRM API requires the DRM's driver to be backed with the device that can be used for generic DMA operations. The VirtIO-GPU device can't perform DMA operations if it uses PCI transport because PCI device driver creates a virtual VirtIO-GPU device that isn't associated with the PCI. Use PCI's GPU

[PATCH v5 10/17] drm/shmem-helper: Correct doc-comment of drm_gem_shmem_get_sg_table()

2022-04-24 Thread Dmitry Osipenko
drm_gem_shmem_get_sg_table() never returns NULL on error, but a ERR_PTR. Correct the doc comment which says that it returns NULL on error. Acked-by: Thomas Zimmermann Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH v5 07/17] drm/virtio: Simplify error handling of virtio_gpu_object_create()

2022-04-24 Thread Dmitry Osipenko
Change the order of SHMEM initialization and reservation locking to make code cleaner a tad and to prepare to transitioning of the common GEM SHMEM code to use the GEM's reservation lock instead of the shmem.page_lock. There is no need to lock reservation during allocation of the SHMEM pages

[PATCH v5 11/17] drm/shmem-helper: Take reservation lock instead of drm_gem_shmem locks

2022-04-24 Thread Dmitry Osipenko
Replace drm_gem_shmem locks with the reservation lock to make GEM lockings more consistent. Previously drm_gem_shmem_vmap() and drm_gem_shmem_get_pages() were protected by separate locks, now it's the same lock for non-imported GEMs. For imported GEMs with still use a separate lock in

[PATCH v5 00/17] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

2022-04-24 Thread Dmitry Osipenko
Hello, This patchset introduces memory shrinker for the VirtIO-GPU DRM driver. During OOM, the shrinker will release BOs that are marked as "not needed" by userspace using the new madvise IOCTL, it will also evict idling BOs to SWAP. The userspace in this case is the Mesa VirGL driver, it will

[PATCH v5 02/17] drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling

2022-04-24 Thread Dmitry Osipenko
drm_gem_shmem_get_sg_table() never ever returned NULL on error. Correct the error handling to avoid crash on OOM. Cc: sta...@vger.kernel.org Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_object.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH v5 09/17] drm/virtio: Use dev_is_pci()

2022-04-24 Thread Dmitry Osipenko
Use common dev_is_pci() helper to replace the strcmp("pci") used by driver. Suggested-by: Robin Murphy Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c

[PATCH v5 06/17] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb()

2022-04-24 Thread Dmitry Osipenko
Make virtio_gpu_plane_cleanup_fb() to clean the state which DRM core wants to clean up and not the current plane's state. Normally the older atomic state is cleaned up, but the newer state could also be cleaned up in case of aborted commits. Cc: sta...@vger.kernel.org Signed-off-by: Dmitry

[PATCH v5 04/17] drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error

2022-04-24 Thread Dmitry Osipenko
Unlock reservations in the error code path of virtio_gpu_object_create() to silence debug warning splat produced by ww_mutex_destroy(>lock) when GEM is released with the held lock. Cc: sta...@vger.kernel.org Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko ---

[PATCH v5 01/17] drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error

2022-04-24 Thread Dmitry Osipenko
When panfrost_mmu_map_fault_addr() fails, the BO's mapping should be unreferenced and not the shmem object that backs that mapping. Cc: sta...@vger.kernel.org Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v5 03/17] drm/virtio: Check whether transferred 2D BO is shmem

2022-04-24 Thread Dmitry Osipenko
Transferred 2D BO always must be a shmem BO. Add check for that to prevent NULL dereference if userspace passes a VRAM BO. Cc: sta...@vger.kernel.org Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [Freedreno] [PATCH v4 03/20] drm: allow real encoder to be passed for drm_writeback_connector

2022-04-24 Thread Abhinav Kumar
Hi Laurent On 4/24/2022 12:59 PM, Laurent Pinchart wrote: Hi Abhinav, On Sun, Apr 24, 2022 at 11:23:20AM -0700, Abhinav Kumar wrote: On 4/24/2022 11:12 AM, Abhinav Kumar wrote: On 4/24/2022 7:50 AM, Laurent Pinchart wrote: On Fri, Apr 22, 2022 at 04:06:38PM -0700, Abhinav Kumar wrote: For

[PATCH v5 02/19] drm: introduce drm_writeback_connector_init_with_encoder() API

2022-04-24 Thread Abhinav Kumar
For vendors drivers which pass an already allocated and initialized encoder especially for cases where the encoder hardware is shared OR the writeback encoder shares the resources with the rest of the display pipeline introduce a new API, drm_writeback_connector_init_with_encoder() which expects

[PATCH v5 01/19] drm: allow passing possible_crtcs to drm_writeback_connector_init()

2022-04-24 Thread Abhinav Kumar
Clients of drm_writeback_connector_init() initialize the possible_crtcs and then invoke the call to this API. To simplify things, allow passing possible_crtcs as a parameter to drm_writeback_connector_init() and make changes to the other drm drivers to make them compatible with this change.

[PATCH v5 00/19] Add writeback block support for DPU

2022-04-24 Thread Abhinav Kumar
This series adds support for writeback block on DPU. Writeback block is extremely useful to validate boards having no physical displays in addition to many other use-cases where we want to get the output of the display pipeline to examine whether issue is with the display pipeline or with the

RE: [PATCH v9 2/4] drm/msm/dp: Support only IRQ_HPD and REPLUG interrupts for eDP

2022-04-24 Thread Sankeerth Billakanti (QUIC)
Hi Stephen, >Quoting Sankeerth Billakanti (2022-04-22 02:11:04) >> The panel-edp enables the eDP panel power during probe, get_modes and >> pre-enable. The eDP connect and disconnect interrupts for the eDP/DP >> controller are directly dependent on panel power. As eDP display can >> be assumed as

Re: [PATCH] drm: rcar-du: Add setting to PnALPHAR register on Gen3

2022-04-24 Thread Laurent Pinchart
Hi Biju, On Sun, Apr 24, 2022 at 04:12:08PM +, Biju Das wrote: > > Subject: Re: [PATCH] drm: rcar-du: Add setting to PnALPHAR register on Gen3 > > On Sat, Apr 23, 2022 at 08:37:28AM +0100, Biju Das wrote: > > > From: LUU HOAI > > > > > > In Gen3, when Alpha blend is enabled in the PnMR

[PATCH v5 03/19] drm/msm/dpu: add writeback blocks to the sm8250 DPU catalog

2022-04-24 Thread Abhinav Kumar
Add writeback blocks to the sm8250 DPU hardware catalog. Other chipsets support writeback too but add it to sm8250 to prototype the feature so that it can be easily extended to other chipsets. changes in v4: - fix the copyright year order Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry

[PATCH v5 10/19] drm/msm/dpu: make changes to dpu_encoder to support virtual encoder

2022-04-24 Thread Abhinav Kumar
Make changes to dpu_encoder to support virtual encoder needed to support writeback for dpu. changes in v4: - squash dpu_encoder pieces from [1] [1] https://patchwork.freedesktop.org/patch/483099/?series=102964=2 Signed-off-by: Abhinav Kumar ---

[PATCH v5 14/19] drm/msm/dpu: add the writeback connector layer

2022-04-24 Thread Abhinav Kumar
Introduce the dpu_writeback module which serves as the interface between dpu operations and the drm_writeback. This module manages the connector related operations for dpu writeback. changes in v2: - start using drm_writeback_connector_init_with_encoder() - drop unnecessary

[PATCH v5 13/19] drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback

2022-04-24 Thread Abhinav Kumar
Introduce the dpu_encoder_phys_* for the writeback interface to handle writeback specific hardware programming. changes in v4: - squash the encoder_phys_wb bits from [1] - since its a trivial change of a previously acked change preserving the ack [1]

[PATCH v5 11/19] drm/msm/dpu: add encoder operations to prepare/cleanup wb job

2022-04-24 Thread Abhinav Kumar
add dpu encoder APIs to prepare and cleanup writeback job for the writeback encoder. These shall be invoked from the prepare_wb_job/cleanup_wb_job hooks of the drm_writeback framework. changes in v3: - none Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov ---

[PATCH v5 04/19] drm/msm/dpu: add reset_intf_cfg operation for dpu_hw_ctl

2022-04-24 Thread Abhinav Kumar
Add a reset_intf_cfg operation for dpu_hw_ctl to reset the entire CTL path by disabling each component namely layer mixer, 3d-merge and interface blocks. changes in v3: - none Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c |

[PATCH v5 08/19] drm/msm/dpu: add changes to support writeback in hw_ctl

2022-04-24 Thread Abhinav Kumar
Add changes to support writeback module in the dpu_hw_ctl interface. changes in v4: - fix the copyright year order Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 52 --

[PATCH v5 07/19] drm/msm/dpu: add writeback blocks to DPU RM

2022-04-24 Thread Abhinav Kumar
Add writeback blocks to DPU resource manager so that the encoders can directly request them through RM. changes in v4: - absorb dpu_rm.h header change from [1] - since its a trivial change absorbed from an approved patch, preserving the previous ack on this [1]

[PATCH v5 16/19] drm/msm/dpu: gracefully handle null fb commits for writeback

2022-04-24 Thread Abhinav Kumar
kms_writeback test cases also verify with a null fb for the writeback connector job. In addition there are also other commit paths which can result in kickoffs without a valid framebuffer like while closing the fb which results in the callback to drm_atomic_helper_dirtyfb() which internally

[PATCH v5 15/19] drm/msm/dpu: initialize dpu encoder and connector for writeback

2022-04-24 Thread Abhinav Kumar
Initialize dpu encoder and connector for writeback if the target supports it in the catalog. changes in v2: - start initialing the encoder for writeback since we have migrated to using drm_writeback_connector_init_with_encoder() - instead of checking for WB_2 inside

[PATCH v5 06/19] drm/msm/dpu: add dpu_hw_wb abstraction for writeback blocks

2022-04-24 Thread Abhinav Kumar
Add the dpu_hw_wb abstraction to program registers related to the writeback block. These will be invoked once all the configuration is set and ready to be programmed to the registers. changes in v3: - start using the common struct dpu_hw_cdp_cfg - leave a comment about DPU

[PATCH v5 12/19] drm/msm/dpu: move _dpu_plane_get_qos_lut to dpu_hw_util file

2022-04-24 Thread Abhinav Kumar
_dpu_plane_get_qos_lut() is not specific to just dpu_plane. It can take any fill level and return the LUT matching it. This can be used even for other modules like dpu_writeback. Move _dpu_plane_get_qos_lut() to the common dpu_hw_util file and rename it to _dpu_hw_get_qos_lut(). Signed-off-by:

[PATCH v5 05/19] drm/msm/dpu: rename dpu_hw_pipe_cdp_cfg to dpu_hw_cdp_cfg

2022-04-24 Thread Abhinav Kumar
Rename dpu_hw_pipe_cdp_cfg to dpu_hw_cdp_cfg and move it to dpu_hw_utils file so that other modules in addition to SSPP such as writeback can use it as all the fields can be used by writeback as well. Suggested-by: Dmitry Baryshkov Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov ---

[PATCH v5 18/19] drm/msm/dpu: add wb_idx to existing DRM prints in dpu_encoder

2022-04-24 Thread Abhinav Kumar
Add wb_idx to existing DRM prints in dpu_encoder and also print the intf_mode so that its clear that for any INTF_CMD/VID there will be a valid intf_idx and any INTF_WB_* there will be a valid wb_idx. Update the debugfs to add the same information. Here is a sample output with this change:

[PATCH v5 09/19] drm/msm/dpu: add an API to reset the encoder related hw blocks

2022-04-24 Thread Abhinav Kumar
Add an API to reset the encoder related hw blocks to ensure a proper teardown of the pipeline. At the moment this is being used only for the writeback encoder but eventually we can start using this for all interfaces. changes in v4: - none Signed-off-by: Abhinav Kumar Reviewed-by:

[PATCH v5 19/19] drm/msm/dpu: add wb_idx to DRM traces in dpu_encoder

2022-04-24 Thread Abhinav Kumar
Change the DRM traces to include both the intf_mode and wb_idx similar to the DRM prints in the previous change. Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 13 - drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h | 26

[PATCH v5 17/19] drm/msm/dpu: add writeback blocks to the display snapshot

2022-04-24 Thread Abhinav Kumar
Add writeback block information while capturing the display snapshot. Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

Re: [Freedreno] [PATCH v4 03/20] drm: allow real encoder to be passed for drm_writeback_connector

2022-04-24 Thread Abhinav Kumar
Hi Laurent On 4/24/2022 2:12 PM, Abhinav Kumar wrote: Hi Laurent On 4/24/2022 12:59 PM, Laurent Pinchart wrote: Hi Abhinav, On Sun, Apr 24, 2022 at 11:23:20AM -0700, Abhinav Kumar wrote: On 4/24/2022 11:12 AM, Abhinav Kumar wrote: On 4/24/2022 7:50 AM, Laurent Pinchart wrote: On Fri, Apr

[PATCH] drm/msm/disp/dpu1: set vbif hw config to NULL to avoid use after memory free during pm runtime resume

2022-04-24 Thread Vinod Polimera
BUG: Unable to handle kernel paging request at virtual address 006b6b6b6b6b6be3 Call trace: dpu_vbif_init_memtypes+0x40/0xb8 dpu_runtime_resume+0xcc/0x1c0 pm_generic_runtime_resume+0x30/0x44 __genpd_runtime_resume+0x68/0x7c genpd_runtime_resume+0x134/0x258 __rpm_callback+0x98/0x138

RE: [PATCH] WIP: drm/dp_mst: Add support for dumping topology ref histories from debugfs

2022-04-24 Thread Lin, Wayne
[AMD Official Use Only - General] Thank you Lyude! I just have a tentative patch set to deal with this. Would like to give a test on some platforms first. If the result is positive, will send out for review immediately. Thanks for tracking on this : ) Regards, Wayne Lin > -Original