Re: [PATCH 3/4] dt-bindings: drm/bridge: anx7625: Change bus-type to 7 (DPI)

2022-04-17 Thread Chen-Yu Tsai
Hi, On Thu, Apr 14, 2022 at 10:27 AM Xin Ji wrote: > > On Wed, Apr 13, 2022 at 04:28:51PM +0200, Robert Foss wrote: > > On Sat, 9 Apr 2022 at 06:47, Xin Ji wrote: > > > > > > On Mon, Apr 04, 2022 at 12:52:14PM -0500, Rob Herring wrote: > > > > On Mon, Mar 28, 2022 at 08:09:54PM +0800, Xin Ji wro

Re: [PATCH v6 2/2] arm64: dts: mt8192: Add node for the Mali GPU

2022-04-17 Thread Fei Shao
On Thu, Apr 14, 2022 at 10:53 AM Nick Fan wrote: > > Add a basic GPU node for mt8192. > > Signed-off-by: Nick Fan Reviewed-by: Fei Shao

[PATCH v4 10/15] drm/shmem-helper: Take reservation lock instead of drm_gem_shmem locks

2022-04-17 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, but it doesn't make any difference for the current GEM SHMEM users. Only Panfrost and

[PATCH v4 11/15] drm/shmem-helper: Add generic memory shrinker

2022-04-17 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 coup

[PATCH v4 14/15] drm/shmem-helper: Make drm_gem_shmem_get_pages() private

2022-04-17 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 - 2

[PATCH v4 08/15] drm/virtio: Use dev_is_pci()

2022-04-17 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 b/drivers/gpu/

[PATCH v4 13/15] drm/panfrost: Switch to generic memory shrinker

2022-04-17 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 v4 15/15] drm/shmem-helper: Remove drm_gem_shmem_purge()

2022-04-17 Thread Dmitry Osipenko
The drm_gem_shmem_purge() was added back in 2019 and never had a user since then. GEM's purging is now managed by the generic shrinker and only the "locked" variant of the function is wanted. Remove the obsoleted function. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c

[PATCH v4 07/15] drm/virtio: Improve DMA API usage for shmem BOs

2022-04-17 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 dev

[PATCH v4 12/15] drm/virtio: Support memory shrinking

2022-04-17 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 v4 09/15] drm/shmem-helper: Correct doc-comment of drm_gem_shmem_get_sg_table()

2022-04-17 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. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gp

[PATCH v4 06/15] drm/virtio: Simplify error handling of virtio_gpu_object_create()

2022-04-17 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 becau

[PATCH v4 04/15] drm/virtio: Unlock reservations on dma_resv_reserve_fences() error

2022-04-17 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 a/d

[PATCH v4 03/15] drm/virtio: Unlock GEM reservations on virtio_gpu_object_shmem_init() error

2022-04-17 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(&obj->lock) when GEM is released with the held lock. Cc: sta...@vger.kernel.org Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/virti

[PATCH v4 05/15] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb()

2022-04-17 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 Osipenk

[PATCH v4 02/15] drm/virtio: Check whether transferred 2D BO is shmem

2022-04-17 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 deleti

[PATCH v4 01/15] drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling

2022-04-17 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 deleti

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

2022-04-17 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 mar

Re: [PATCH v2] drm: mxsfb: Obtain bus flags from bridge state

2022-04-17 Thread Lucas Stach
Am Sonntag, dem 17.04.2022 um 04:10 +0200 schrieb Marek Vasut: > In case the MXSFB is connected to a bridge, attempt to obtain bus flags > from that bridge state too. The bus flags may specify e.g. the DE signal > polarity. > > Acked-by: Alexander Stein > Signed-off-by: Marek Vasut > Cc: Alexand

Re: [PATCH] drm/bridge: fix anx6345 power up sequence

2022-04-17 Thread Vasily Khoruzhick
On Sun, Apr 17, 2022 at 9:15 AM Torsten Duwe wrote: > > Align the power-up sequence with the known-good procedure documented in [1]: > un-swap dvdd12 and dvdd25, and allow a little extra time for them to settle > before de-asserting reset. Hi Torsten, Interesting find! I tried to fix the issue s

Re: [PATCH 2/2] MAINTAINERS: add docs entry to AMDGPU

2022-04-17 Thread Bagas Sanjaya
On 4/16/22 02:50, Tales Lelo da Aparecida wrote: > To make sure maintainers of amdgpu drivers are aware of any changes > in their documentation, add its entry to MAINTAINERS. > Did you mean the Documentation/gpu/amdgpu/ is maintained by dri-devel? -- An old man doll... just what I always wante

[PATCH] drm/malidp: convert sysfs snprintf to sysfs_emit

2022-04-17 Thread Xuezhi Zhang
Fix the following coccicheck warning: drivers/gpu/drm/arm/malidp_drv.c:658:8-16: WARNING: use scnprintf or sprintf Signed-off-by: Xuezhi Zhang --- drivers/gpu/drm/arm/malidp_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/d

[PATCH] drm/bridge: fix anx6345 power up sequence

2022-04-17 Thread Torsten Duwe
Align the power-up sequence with the known-good procedure documented in [1]: un-swap dvdd12 and dvdd25, and allow a little extra time for them to settle before de-asserting reset. Fixes: 6aa192698089b ("drm/bridge: Add Analogix anx6345 support") [1] https://github.com/OLIMEX/DIY-LAPTOP/blob/master

[PATCH v2] drm/doc: Add in introduction sections about tiny drivers and external refs

2022-04-17 Thread Javier Martinez Canillas
Learning about the DRM subsystem could be quite overwhelming for newcomers but there are lots of useful talks, slides and articles available that can help to understand the needed concepts and ease the learning curve. There are also simple DRM drivers that can be used as example about how a DRM dr