Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-14 Thread Thomas Zimmermann
Hi Am 13.07.23 um 17:14 schrieb Tvrtko Ursulin: On 13/07/2023 16:09, Thomas Zimmermann wrote: Hi Am 13.07.23 um 16:41 schrieb Sean Paul: On Thu, Jul 13, 2023 at 9:04 AM Uwe Kleine-König wrote: hello Sean, On Wed, Jul 12, 2023 at 02:31:02PM -0400, Sean Paul wrote: I'd really prefer

Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-13 Thread Thomas Zimmermann
ank you! Sean Thanks for your input, best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ | -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH

Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-13 Thread Thomas Zimmermann
| 8 +- include/drm/drm_atomic_helper.h | 2 +- include/drm/drm_crtc.h| 4 +- 194 files changed, 1296 insertions(+), 1264 deletions(-) base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solut

Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-13 Thread Thomas Zimmermann
Sean If folks insist on following through with this anyway, I'm firmly in the camp the name should be "drm" and nothing else. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenst

Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-13 Thread Thomas Zimmermann
"ddev" for the drm_device (see for example amdgpu_device_get_pcie_replay_count()). If folks insist on following through with this anyway, I'm firmly in the camp the name should be "drm" and nothing else. Up to now positive feedback is in the majority. Best regards Uwe -

Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-12 Thread Thomas Zimmermann
| 4 +- 194 files changed, 1296 insertions(+), 1264 deletions(-) base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB

Re: drm/virtgpu: Replace dev_private by helper function

2023-06-21 Thread Thomas Zimmermann
Am 21.06.23 um 11:12 schrieb Sui Jingfeng: Hi, On 2023/6/20 18:33, Thomas Zimmermann wrote: Dereference struct drm_device.dev_private in the helper function do_virtio_gpu_device(). Is the word "Dereference" accurate enough ? It's not really the correct word, you'r

Re: [PATCH] drm/virtgpu: Replace dev_private by helper function

2023-06-21 Thread Thomas Zimmermann
Am 20.06.23 um 12:33 schrieb Thomas Zimmermann: Dereference struct drm_device.dev_private in the helper function do_virtio_gpu_device(). The dev_private field is deprecated and drivers are advised not ot use it. Encapsulating it in a helper function will help with a later removal. No

[PATCH] drm/virtgpu: Replace dev_private by helper function

2023-06-20 Thread Thomas Zimmermann
Dereference struct drm_device.dev_private in the helper function do_virtio_gpu_device(). The dev_private field is deprecated and drivers are advised not ot use it. Encapsulating it in a helper function will help with a later removal. No functional changes. Signed-off-by: Thomas Zimmermann

Re: [PATCH v5 09/44] drm: handle HAS_IOPORT dependencies

2023-05-22 Thread Thomas Zimmermann
rrus_crtc_helper_atomic_enable(struct drm_crtc *crtc, cirrus_mode_set(cirrus, &crtc_state->mode); +#ifdef CONFIG_HAS_IOPORT /* Unblank (needed on S3 resume, vgabios doesn't do it then) */ outb(VGA_AR_ENABLE_DISPLAY, VGA_ATT_W); +#endif drm_dev_exit(i

Re: [PATCH v4 07/41] drm: handle HAS_IOPORT dependencies

2023-05-16 Thread Thomas Zimmermann
/* Unblank (needed on S3 resume, vgabios doesn't do it then) */ outb(VGA_AR_ENABLE_DISPLAY, VGA_ATT_W); +#endif drm_dev_exit(idx); } -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Ger

Re: [v2,1/8] drm/fbdev-generic: Always use shadow buffering

2023-03-21 Thread Thomas Zimmermann
Hi, thanks for testing the patchset. Am 21.03.23 um 16:23 schrieb Sui jingfeng: On 2023/3/20 23:07, Thomas Zimmermann wrote: Remove all codepaths that implement fbdev output directly on GEM buffers. Always allocate a shadow buffer in system memory and set up deferred I/O for mmap. The fbdev

[PATCH v2 3/8] drm/fb-helper: Export drm_fb_helper_release_info()

2023-03-20 Thread Thomas Zimmermann
Export the fb_info release code as drm_fb_helper_release_info(). Will help with cleaning up failed fbdev probing. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Zack Rusin --- drivers/gpu/drm/drm_fb_helper.c | 33 - include/drm

[PATCH v2 6/8] drm/fbdev-generic: Clean up after failed probing

2023-03-20 Thread Thomas Zimmermann
Clean up fbdev and client state if the probe function fails. It used to leak allocated resources. Also reorder the individual steps to simplify cleanup. v2: * move screen_size update into separate patches Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by

[PATCH v2 1/8] drm/fbdev-generic: Always use shadow buffering

2023-03-20 Thread Thomas Zimmermann
fbdev-generic and simplify the code. Using a shadow buffer with deferred I/O is probably the best case for most remaining callers. Some of the TTM-based drivers might benefit from a dedicated fbdev emulation that operates directly on the driver's video memory. Signed-off-by: Thomas Zimme

[PATCH v2 5/8] drm/fbdev-generic: Set screen size to size of GEM buffer

2023-03-20 Thread Thomas Zimmermann
The size of the screen memory should be equivalent to the size of the screen's GEM buffer. Don't recalculate the value. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drive

[PATCH v2 2/8] drm/fbdev-generic: Remove unused prefer_shadow_fbdev flag

2023-03-20 Thread Thomas Zimmermann
Remove the flag prefer_shadow_fbdev from struct drm_mode_config. Drivers set this flag to enable shadow buffering in the generic fbdev emulation. Such shadow buffering is now mandatory, so the flag is unused. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by

[PATCH v2 8/8] drm/fbdev-generic: Rename symbols

2023-03-20 Thread Thomas Zimmermann
Rename symbols to match the style of other fbdev-emulation source code. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Zack Rusin --- drivers/gpu/drm/drm_fbdev_generic.c | 66 ++--- 1 file changed, 33 insertions

[PATCH v2 7/8] drm/fb-helper: Consolidate CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM

2023-03-20 Thread Thomas Zimmermann
option and setting the module parameter. Also update the comment. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Zack Rusin --- drivers/gpu/drm/drm_fb_helper.c | 22 -- drivers/gpu/drm/drm_fbdev_dma.c | 9 + include/drm/drm_fb_helper.h

[PATCH v2 4/8] drm/fb-helper: Support smem_len in deferred I/O

2023-03-20 Thread Thomas Zimmermann
The size of the framebuffer can either be stored in screen_info or smem_len. Take both into account in the deferred I/O code. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 0/8] drm/fbdev-generic: Mandatory shadow buffering

2023-03-20 Thread Thomas Zimmermann
llow other fbdev emulation. v2: * handle screen_size in separate patches (Javier) Thomas Zimmermann (8): drm/fbdev-generic: Always use shadow buffering drm/fbdev-generic: Remove unused prefer_shadow_fbdev flag drm/fb-helper: Export drm_fb_helper_release_info() drm/fb-helper: Suppor

Re: [PATCH 4/6] drm/fbdev-generic: Clean up after failed probing

2023-03-20 Thread Thomas Zimmermann
Hi Javier Am 17.03.23 um 13:24 schrieb Javier Martinez Canillas: Thomas Zimmermann writes: [...] @@ -91,36 +93,52 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper, fb_helper->buffer = buffer; fb_helper->fb = buffer->fb; - fb = b

Re: [PATCH 5/6] drm/fb-helper: Consolidate CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM

2023-03-17 Thread Thomas Zimmermann
Hi Am 17.03.23 um 16:11 schrieb Maxime Ripard: On Fri, Mar 17, 2023 at 01:51:42PM +0100, Thomas Zimmermann wrote: Hi Am 17.03.23 um 13:39 schrieb Javier Martinez Canillas: Thomas Zimmermann writes: Consolidate all handling of CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM by making the module parameter

Re: [PATCH 5/6] drm/fb-helper: Consolidate CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM

2023-03-17 Thread Thomas Zimmermann
Hi Am 17.03.23 um 13:39 schrieb Javier Martinez Canillas: Thomas Zimmermann writes: Consolidate all handling of CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM by making the module parameter optional in drm_fb_helper.c. Without the config option, modules can set smem_start in struct fb_info for internal

Re: [PATCH 1/6] drm/fbdev-generic: Always use shadow buffering

2023-03-17 Thread Thomas Zimmermann
Hi Javier Am 17.03.23 um 12:47 schrieb Javier Martinez Canillas: Thomas Zimmermann writes: Hello Thomas, Remove all codepaths that implement fbdev output directly on GEM buffers. Always allocate a shadow buffer in system memory and set up deferred I/O for mmap. The fbdev code that operated

Re: [PATCH 2/6] drm/fbdev-generic: Remove unused prefer_shadow_fbdev flag

2023-03-16 Thread Thomas Zimmermann
Hi Am 16.03.23 um 03:16 schrieb Zack Rusin: On Wed, 2023-03-15 at 17:14 +0100, Thomas Zimmermann wrote: Remove the flag prefer_shadow_fbdev from struct drm_mode_config. Drivers set this flag to enable shadow buffering in the generic fbdev emulation. Such shadow buffering is now mandatory, so

[PATCH 6/6] drm/fbdev-generic: Rename symbols

2023-03-15 Thread Thomas Zimmermann
Rename symbols to match the style of other fbdev-emulation source code. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 66 ++--- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 4/6] drm/fbdev-generic: Clean up after failed probing

2023-03-15 Thread Thomas Zimmermann
Clean up fbdev and client state if the probe function fails. It used to leak allocated resources. Also reorder the individual steps to simplify cleanup. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 46 - 1 file changed, 32 insertions

[PATCH 1/6] drm/fbdev-generic: Always use shadow buffering

2023-03-15 Thread Thomas Zimmermann
fbdev-generic and simplify the code. Using a shadow buffer with deferred I/O is probably the best case for most remaining callers. Some of the TTM-based drivers might benefit from a dedicated fbdev emulation that operates directly on the driver's video memory. Signed-off-by: Thomas Zimme

[PATCH 0/6] drm/fbdev-generic: Mandatory shadow buffering

2023-03-15 Thread Thomas Zimmermann
llow other fbdev emulation. Thomas Zimmermann (6): drm/fbdev-generic: Always use shadow buffering drm/fbdev-generic: Remove unused prefer_shadow_fbdev flag drm/fb-helper: Export drm_fb_helper_release_info() drm/fbdev-generic: Clean up after failed probing drm/fb-helper: C

[PATCH 5/6] drm/fb-helper: Consolidate CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM

2023-03-15 Thread Thomas Zimmermann
option and setting the module parameter. Also update the comment. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c | 22 -- drivers/gpu/drm/drm_fbdev_dma.c | 9 + include/drm/drm_fb_helper.h | 9 - 3 files changed, 9 insertions(+), 31

[PATCH 3/6] drm/fb-helper: Export drm_fb_helper_release_info()

2023-03-15 Thread Thomas Zimmermann
Export the fb_info release code as drm_fb_helper_release_info(). Will help with cleaning up failed fbdev probing. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c | 33 - include/drm/drm_fb_helper.h | 5 + 2 files changed, 29

[PATCH 2/6] drm/fbdev-generic: Remove unused prefer_shadow_fbdev flag

2023-03-15 Thread Thomas Zimmermann
Remove the flag prefer_shadow_fbdev from struct drm_mode_config. Drivers set this flag to enable shadow buffering in the generic fbdev emulation. Such shadow buffering is now mandatory, so the flag is unused. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/bochs.c| 1

Re: [PATCH] drm/virtio: Enable fb damage clips property for the primary plane

2023-03-10 Thread Thomas Zimmermann
d really be two separate functions. But withing the constrains of the current code Reviewed-by: Thomas Zimmermann Best regards Thomas return plane; drm_plane_helper_add(plane, funcs); + + if (type == DRM_PLANE_TYPE_PRIMARY) + drm_plane_enable_fb_dam

Re: [PATCH v12 09/11] drm/gem: Export drm_gem_pin/unpin()

2023-03-07 Thread Thomas Zimmermann
unpin(struct drm_gem_object *obj); + #endif /* __DRM_GEM_H__ */ -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev OpenPGP_signature Description: OpenPGP digit

Re: [PATCH v12 10/11] drm/virtio: Support memory shrinking

2023-03-07 Thread Thomas Zimmermann
al @@ -247,6 +257,10 @@ struct drm_virtgpu_context_init { DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_CONTEXT_INIT, \ struct drm_virtgpu_context_init) +#define DRM_IOCTL_VIRTGPU_MADVISE \ + DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MADVISE, \ +struct

Re: [PATCH v3] drm/virtio: Add option to disable KMS support

2023-02-28 Thread Thomas Zimmermann
Am 28.02.23 um 13:34 schrieb Thomas Zimmermann: Hi Am 27.02.23 um 19:15 schrieb Rob Clark: On Mon, Feb 27, 2023 at 9:57 AM Dmitry Osipenko wrote: On 2/27/23 20:38, Rob Clark wrote: ... + if (IS_ENABLED(CONFIG_DRM_VIRTIO_GPU_KMS)) { + /* get display info

Re: [PATCH v3] drm/virtio: Add option to disable KMS support

2023-02-28 Thread Thomas Zimmermann
ted to. The config option is the only thing _I_ want, everything else is just a bonus to help other people's use-cases. I find this very vague. What's the security thread? And if the config option is useful, shouldn't it be DRM-wide? The modesetting ioctl calls are shared among all

Re: [PATCH] drm/virtio: Add option to disable KMS support

2023-02-28 Thread Thomas Zimmermann
d) virtio_gpu_cmd_get_edids(vgdev); +#if defined(CONFIG_DRM_VIRTIO_GPU_KMS) virtio_gpu_cmd_get_display_info(vgdev); virtio_gpu_notify(vgdev); wait_event_timeout(vgdev->resp_wq, !vgdev->display_info_pending, 5 * HZ); +#endif retur

Re: [PATCH] drm/virtio: Add option to disable KMS support

2023-02-28 Thread Thomas Zimmermann
if (ret) { - DRM_ERROR("modeset init failed\n"); - goto err_scanouts; - } - virtio_device_ready(vgdev->vdev); if (num_capsets) @@ -252,8 +231,6 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)

Re: [PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-20 Thread Thomas Zimmermann
Hi Am 16.02.23 um 12:33 schrieb Gerd Hoffmann: On Wed, Feb 15, 2023 at 05:15:17PM +0100, Thomas Zimmermann wrote: Set the VGA bit for unblanking with macro constants instead of magic values. No functional changes. blank/unblank should work simliar to bochs (see commit 250e743915d4), that is

Re: [PATCH v10 09/11] drm/gem: Add drm_gem_pin_unlocked()

2023-02-17 Thread Thomas Zimmermann
eviction during scanout. Signed-off-by: Dmitry Osipenko Reviewed-by: Thomas Zimmermann Best regards Thomas --- drivers/gpu/drm/drm_gem.c | 29 + include/drm/drm_gem.h | 3 +++ 2 files changed, 32 insertions(+) diff --git a/drivers/gpu/drm/drm_gem.c b

Re: [PATCH v10 07/11] drm/shmem-helper: Switch to reservation lock

2023-02-17 Thread Thomas Zimmermann
between dma-buf importers and exporters. Suggested-by: Daniel Vetter Signed-off-by: Dmitry Osipenko I don't dare to r-b this, but take my Acked-by: Thomas Zimmermann if you want to land this patch. Best regards Thomas --- drivers/gpu/drm/drm_gem_shmem_helper.c

Re: [PATCH v10 00/11] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

2023-02-17 Thread Thomas Zimmermann
_device, like was suggested by Thomas Zimmermann. - Replaced drm_gem_shmem_shrinker_register() with drmm_gem_shmem_init(), like was suggested by Thomas Zimmermann. - Moved evict() callback to drm_gem_object_funcs and added common drm_gem_object_evict() helper, like was

Re: [PATCH v10 08/11] drm/shmem-helper: Add memory shrinker

2023-02-17 Thread Thomas Zimmermann
e_count && !shmem->pages_pin_count && + !shmem->base.dma_buf && !shmem->base.import_attach && + (shmem->sgt || shmem->evicted); } +int drm_gem_shmem_swap_in(struct drm_gem_shmem_object *shmem); + +void drm_gem_shmem_evict(

Re: [PATCH v10 07/11] drm/shmem-helper: Switch to reservation lock

2023-02-17 Thread Thomas Zimmermann
size_t size); void drm_gem_shmem_free(struct drm_gem_shmem_object *shmem); -int drm_gem_shmem_get_pages(struct drm_gem_shmem_object *shmem); void drm_gem_shmem_put_pages(struct drm_gem_shmem_object *shmem); int drm_gem_shmem_pin(struct drm_gem_shmem_object *shmem); void drm_gem_shmem_unpin(struct d

Re: [PATCH v10 06/11] drm/shmem-helper: Don't use vmap_use_count for dma-bufs

2023-02-17 Thread Thomas Zimmermann
over dma-bufs. Signed-off-by: Dmitry Osipenko Reviewed-by: Thomas Zimmermann with my comments below considered. --- drivers/gpu/drm/drm_gem_shmem_helper.c | 35 +++--- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c

Re: [PATCH v10 05/11] drm/shmem: Switch to use drm_* debug helpers

2023-02-17 Thread Thomas Zimmermann
Am 08.01.23 um 22:04 schrieb Dmitry Osipenko: Ease debugging of a multi-GPU system by using drm_WARN_*() and drm_dbg_kms() helpers that print out DRM device name corresponding to shmem GEM. Suggested-by: Thomas Zimmermann Signed-off-by: Dmitry Osipenko Reviewed-by: Thomas Zimmermann

Re: [PATCH v10 04/11] drm/shmem: Put booleans in the end of struct drm_gem_shmem_object

2023-02-17 Thread Thomas Zimmermann
Am 08.01.23 um 22:04 schrieb Dmitry Osipenko: Group all 1-bit boolean members of struct drm_gem_shmem_object in the end of the structure, allowing compiler to pack data better and making code to look more consistent. Suggested-by: Thomas Zimmermann Signed-off-by: Dmitry Osipenko Reviewed

Re: [PATCH v10 03/11] drm/gem: Add evict() callback to drm_gem_object_funcs

2023-02-17 Thread Thomas Zimmermann
Hi Am 08.01.23 um 22:04 schrieb Dmitry Osipenko: Add new common evict() callback to drm_gem_object_funcs and corresponding drm_gem_object_evict() helper. This is a first step on a way to providing common GEM-shrinker API for DRM drivers. Suggested-by: Thomas Zimmermann Signed-off-by: Dmitry

Re: [PATCH v10 01/11] drm/msm/gem: Prevent blocking within shrinker loop

2023-02-17 Thread Thomas Zimmermann
int nr_to_scan, + unsigned long *remaining, bool (*shrink)(struct drm_gem_object *obj)); #endif /* __DRM_GEM_H__ */ -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nü

Re: [PATCH] gpu-drm-tiny-cirrus: Add NULL check of pointer pipe->plane.state->fb in cirrus_pipe_update()

2023-02-17 Thread Thomas Zimmermann
ere it is dereferenced at cirrus.c:316. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Alexandr Sapozhnikov Reviewed-by: Thomas Zimmermann I'll add you patch to drm-misc-fixes. Best regards Thomas --- drivers/gpu/drm/tiny/cirrus.c | 2 +- 1 file chan

Re: [PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-17 Thread Thomas Zimmermann
Hi Am 16.02.23 um 18:20 schrieb Ville Syrjälä: On Thu, Feb 16, 2023 at 02:21:43PM +0100, Thomas Zimmermann wrote: Hi Am 16.02.23 um 13:52 schrieb Ville Syrjälä: On Thu, Feb 16, 2023 at 01:03:02PM +0100, Thomas Zimmermann wrote: Hi, thanks for taking a look at the patches. Am 16.02.23 um

Re: [PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-16 Thread Thomas Zimmermann
Hi Am 16.02.23 um 13:52 schrieb Ville Syrjälä: On Thu, Feb 16, 2023 at 01:03:02PM +0100, Thomas Zimmermann wrote: Hi, thanks for taking a look at the patches. Am 16.02.23 um 12:33 schrieb Gerd Hoffmann: On Wed, Feb 15, 2023 at 05:15:17PM +0100, Thomas Zimmermann wrote: Set the VGA bit for

Re: [PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-16 Thread Thomas Zimmermann
Hi, thanks for taking a look at the patches. Am 16.02.23 um 12:33 schrieb Gerd Hoffmann: On Wed, Feb 15, 2023 at 05:15:17PM +0100, Thomas Zimmermann wrote: Set the VGA bit for unblanking with macro constants instead of magic values. No functional changes. blank/unblank should work simliar

[PATCH 11/17] drm/cirrus: Remove format test from cirrus_fb_create()

2023-02-15 Thread Thomas Zimmermann
The DRM core implements a format check when setting a framebuffer for a plane. [1] Remove the unnecessary test from cirrus_fb_create(). Signed-off-by: Thomas Zimmermann Link: https://elixir.bootlin.com/linux/v6.1/source/drivers/gpu/drm/drm_atomic.c#L629 # [1] --- drivers/gpu/drm/tiny/cirrus.c

[PATCH 04/17] drm/cirrus: Move drm_dev_{enter, exit}() into DRM helpers

2023-02-15 Thread Thomas Zimmermann
Call drm_dev_enter() and drm_dev_exit() immediately after entering cirrus' DRM helper functions. Remove these calls from other functions. Each enter/exit block in the DRM helpers covers the full hardware update. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm

[PATCH 08/17] drm/cirrus: Convert to regular atomic helpers

2023-02-15 Thread Thomas Zimmermann
ne updates and handle each individually. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 202 +++--- 1 file changed, 138 insertions(+), 64 deletions(-) diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c index 7c

[PATCH 12/17] drm/cirrus: Remove size test from cirrus_fb_create()

2023-02-15 Thread Thomas Zimmermann
The DRM core implements a size check against the mode config's limits when creating a framebuffer. [1] Remove the unnecessary test from cirrus_fb_create() and remove the now-empty function. Create framebuffers with drm_gem_fb_create_with_dirty(). Signed-off-by: Thomas Zimmermann Link:

[PATCH 13/17] drm/cirrus: Test mode against video-memory size in device-wide mode_valid

2023-02-15 Thread Thomas Zimmermann
Test a display mode against the available amount of video memory in struct drm_mode_config_funcs.mode_valid, which cirrus implements in cirrus_mode_config_mode_valid(). This helper tests display modes against device-wide limits. Remove the now-obsolete per-CRTC test. Signed-off-by: Thomas

[PATCH 15/17] drm/cirrus: Introduce struct cirrus_primary_plane_state

2023-02-15 Thread Thomas Zimmermann
The cirrus driver maintains plane state, format and pitch, in it's device structure. Introduce a plane state for the primary plane to store the values. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 59 ++- 1 file changed, 58 inser

[PATCH 09/17] drm/cirrus: Enable damage clipping on primary plane

2023-02-15 Thread Thomas Zimmermann
amage information known, cirrus now iterates over a list of change areas and only flushes those to the hardware's scanout buffer. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tin

[PATCH 14/17] drm/cirrus: Inline cirrus_check_size() into primary-plane atomic_check

2023-02-15 Thread Thomas Zimmermann
Inline the framebuffer size check into the primary plane's atomic_check cirrus_primary_plane_atomic_check(). No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --

[PATCH 07/17] drm/cirrus: Move primary-plane format arrays

2023-02-15 Thread Thomas Zimmermann
Move the primary plane's format and modifier arrays within the source file and adapt naming slightly. No functional changes. Done in preparation of converting cirrus to regular atomic helpers. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c

[PATCH 03/17] drm/cirrus: Use drm_fb_blit() to update scanout buffer

2023-02-15 Thread Thomas Zimmermann
Cirrus' blit helper reimplements code from the shared blit helper drm_fb_blit(). Use the helper instead. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/gpu/drm/tiny/cirrus.c b/dr

[PATCH 16/17] drm/cirrus: Store HW format/pitch in primary-plane state

2023-02-15 Thread Thomas Zimmermann
dates consider the difference between the old and the new plane state before updating format or pitch. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 51 +-- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/tiny/cirru

[PATCH 00/17] cirrus: Modernize the cirrus driver

2023-02-15 Thread Thomas Zimmermann
state of the primary plane. These fields have been kept in the device structure itself, where thy don't belong. Patch 17 replaces two magic values by macro constants. There are more such cases within cirrus, but those two values stuck out as specifically hard to interpret. Tested with qemu&#x

[PATCH 06/17] drm/cirrus: Integrate connector into pipeline code

2023-02-15 Thread Thomas Zimmermann
Integrate the connector with the rest of the pipeline setup code. Move some helpers within the file and adapt naming slightly. No functional changes. Done in preparation of converting cirrus to regular atomic helpers. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 80

[PATCH 05/17] drm/cirrus: Split cirrus_mode_set() into smaller functions

2023-02-15 Thread Thomas Zimmermann
Split cirrus_mode_set() into smaller functions that set the display mode, color format and scnaline pitch individually. Better reflects the design of the DRM modesetting pipeline. Done in preparation of converting cirrus to regular atomic helpers. Signed-off-by: Thomas Zimmermann --- drivers

[PATCH 02/17] drm/cirrus: Replace cpp value with format

2023-02-15 Thread Thomas Zimmermann
Using components per pixel to describe a color format is obsolete. Use the format info and 4CC value instead. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 50 ++- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/gpu

[PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-15 Thread Thomas Zimmermann
Set the VGA bit for unblanking with macro constants instead of magic values. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny

[PATCH 10/17] drm/cirrus: Inline cirrus_fb_blit_rect()

2023-02-15 Thread Thomas Zimmermann
Inline cirrus_fb_blit_rect into its only caller. While at it, update the code to use IOSYS_MAP_INIT_OFFSET(), which is the ideomatic way of initializing struct iosys_map with an offset. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 22 ++ 1 file

[PATCH 01/17] drm/cirrus: Compute blit destination offset in single location

2023-02-15 Thread Thomas Zimmermann
The calculation for the scanout-buffer blit offset is independent from the color format. In the one case where the current code uses fb->pitches[0] instead of cirrus->pitch, their values are identical. Hence merge all into a single line. Signed-off-by: Thomas Zimmermann --- drivers/gpu/dr

[PATCH v2 7/7] drm/fb-helper: Don't use the preferred depth for the BPP default

2022-11-23 Thread Thomas Zimmermann
default depth of 24 and the format XRGB. As XRGB is the default format for most of the current and legacy graphics stack, all drivers must support it. So it is the safe choice. v2: * fix commit-message typo (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez

[PATCH v2 5/7] drm/simpledrm: Set preferred depth from format of scanout buffer

2022-11-23 Thread Thomas Zimmermann
Set the preferred depth from the format of the scanout buffer. The value cannot be hardcoded, as the scanout buffer is only known at runtime. Also derive the fbdev emulation's bpp value from the scanout format. v2: * fix commit-message typo Signed-off-by: Thomas Zimmermann Review

[PATCH v2 3/7] drm/cirrus: Decouple fbdev bpp value from color depth

2022-11-23 Thread Thomas Zimmermann
Cirrus has a preferred color depth of 16 bit; also use it as fbdev bpp value. Don't use the color depth directly. It has a different meaning than bpp and both cannot be used interchangeably. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Daniel V

[PATCH v2 2/7] drm/logicvc: Fix preferred fbdev cpp

2022-11-23 Thread Thomas Zimmermann
Logicvc can have different values for the preferred color depth. Set the fbdev bpp value depending on the runtime value. v2: * remove unused color depth of 15 from switch (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Daniel Vetter

[PATCH v2 6/7] drm/solomon: Set preferred color depth and bpp to the correct values

2022-11-23 Thread Thomas Zimmermann
Set the preferred color depth to 24 bits and the fbdev bpp to 32 bits. This will signal XRGB as default format to clients. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Daniel Vetter --- drivers/gpu/drm/solomon/ssd130x.c | 4 ++-- 1 file changed, 2

[PATCH v2 4/7] drm/ofdrm: Set preferred depth from format of scanout buffer

2022-11-23 Thread Thomas Zimmermann
ll to drm_fbdev_generic_setup() as the driver now handles color depth and bpp values correctly. v2: * fix commit-message typo Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Daniel Vetter --- drivers/gpu/drm/tiny/ofdrm.c | 13 + 1 file chang

[PATCH v2 1/7] drm/hisilicon/hibmc: Fix preferred depth and bpp

2022-11-23 Thread Thomas Zimmermann
Set the preferred color depth to 24 bits and the fbdev bpp to 32 bits. This will signal XRGB as default format to clients. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Daniel Vetter --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++-- 1 file

[PATCH v2 0/7] drm: Fix the color-depth/bpp confusion

2022-11-23 Thread Thomas Zimmermann
fix the fbdev format selection. v2: * leave out 15-bit color in logicvc (Javier) * minor typos (Javier) Thomas Zimmermann (7): drm/hisilicon/hibmc: Fix preferred depth and bpp drm/logicvc: Fix preferred fbdev cpp drm/cirrus: Decouple fbdev bpp value from color depth drm

Re: [PATCH 2/7] drm/logicvc: Fix preferred fbdev cpp

2022-11-18 Thread Thomas Zimmermann
Hi Am 18.11.22 um 14:41 schrieb Javier Martinez Canillas: On 11/18/22 14:22, Thomas Zimmermann wrote: [...] I'm also not sure if this is needed. Since IIUC in logicvc_mode_init() the driver does: preferred_depth = layer_primary->formats->depth; /* DRM counts alp

Re: [PATCH 2/7] drm/logicvc: Fix preferred fbdev cpp

2022-11-18 Thread Thomas Zimmermann
Hi Am 18.11.22 um 14:08 schrieb Javier Martinez Canillas: On 11/16/22 17:09, Thomas Zimmermann wrote: Logicvc can have different values for the preferred color depth. Set the fbdev bpp value depending on the runtime value. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/logicvc

Re: [PATCH 1/7] drm/hisilicon/hibmc: Fix preferred depth and bpp

2022-11-18 Thread Thomas Zimmermann
Hi Javier Am 18.11.22 um 13:52 schrieb Javier Martinez Canillas: Hello Thomas, On 11/16/22 17:09, Thomas Zimmermann wrote: Set the preferred color depth to 24 bits and the fbdev bpp to 32 bits. This will signal XRGB as default format to clients. Signed-off-by: Thomas Zimmermann

[PATCH 6/7] drm/solomon: Set preferred color depth and bpp to the correct values

2022-11-16 Thread Thomas Zimmermann
Set the preferred color depth to 24 bits and the fbdev bpp to 32 bits. This will signal XRGB as default format to clients. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/solomon/ssd130x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/solomon

[PATCH 5/7] drm/simpledrm: Set preferred depth from format of scanout buffer

2022-11-16 Thread Thomas Zimmermann
Set the preferred depth from the format of the scanout buffer. The value cannot be hardcoded, as the scanout buffer's is only known at runtime. Also derive the fbdev emulations bpp value from the scanout format. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/simpledrm.c | 4 ++

[PATCH 3/7] drm/cirrus: Decouple fbdev bpp value from color depth

2022-11-16 Thread Thomas Zimmermann
Cirrus has a preferred color depth of 16 bit; also use it as fbdev bpp value. Don't use the color depth directly. It has a different meaning than bpp and both cannot be used interchangeably. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/cirrus.c | 2 +- 1 file changed, 1 inse

[PATCH 7/7] drm/fb-helper: Don't use the preferred depth for the BPP default

2022-11-16 Thread Thomas Zimmermann
default depth of 24 and the format XRGB. As XRGB is the default format for most of the current and legacy graphics stack, all drivers must support it. So it is the safe choice. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 15 +-- 1 file changed, 9

[PATCH 2/7] drm/logicvc: Fix preferred fbdev cpp

2022-11-16 Thread Thomas Zimmermann
Logicvc can have different values for the preferred color depth. Set the fbdev bpp value depending on the runtime value. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/logicvc/logicvc_drm.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm

[PATCH 4/7] drm/ofdrm: Set preferred depth from format of scanout buffer

2022-11-16 Thread Thomas Zimmermann
he call to drm_fbdev_generic_setup() as the driver now handles color depth and bpp values correctly. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/ofdrm.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/ti

[PATCH 0/7] drm: Fix the color-depth/bpp confusion

2022-11-16 Thread Thomas Zimmermann
fix the fbdev format selection. Thomas Zimmermann (7): drm/hisilicon/hibmc: Fix preferred depth and bpp drm/logicvc: Fix preferred fbdev cpp drm/cirrus: Decouple fbdev bpp value from color depth drm/ofdrm: Set preferred depth from format of scanout buffer drm/simpledrm: Set preferred depth

[PATCH 1/7] drm/hisilicon/hibmc: Fix preferred depth and bpp

2022-11-16 Thread Thomas Zimmermann
Set the preferred color depth to 24 bits and the fbdev bpp to 32 bits. This will signal XRGB as default format to clients. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu

Re: [PATCH v8 2/7] drm/shmem-helper: Don't use vmap_use_count for dma-bufs

2022-11-10 Thread Thomas Zimmermann
gt;vmap_use_count); + Here's another case where a GEM DMA-BUF object might become helpful. Best regards Thomas drm_printf_indent(p, indent, "vaddr=%p\n", shmem->vaddr); } EXPORT_SYMBOL(drm_gem_shmem_print_info); -- Thomas Zimmermann Graphics Driver Developer SUSE

Re: [PATCH v8 4/7] drm/shmem-helper: Add memory shrinker

2022-11-09 Thread Thomas Zimmermann
mem_object *shmem); +int drm_gem_shmem_swap_in(struct drm_gem_shmem_object *shmem); + +int drm_gem_shmem_evict(struct drm_gem_shmem_object *shmem); +int drm_gem_shmem_purge(struct drm_gem_shmem_object *shmem); struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_shmem_object *shme

[PATCH v3 13/23] drm/fb-helper: Rename drm_fb_helper_alloc_fbi() to use _info postfix

2022-11-03 Thread Thomas Zimmermann
Rename drm_fb_helper_alloc_fbi() to drm_fb_helper_alloc_info() as part of unifying the naming within fbdev helpers. Adapt drivers. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/armada/armada_fbdev.c | 2 +- drivers/gpu

[PATCH v3 18/23] drm/fb_helper: Minimize damage-helper overhead

2022-11-03 Thread Thomas Zimmermann
Pull the test for fb_dirty into the caller to avoid extra work if no callback has been set. In this case no damage handling is required and no damage area needs to be computed. Print a warning if the damage worker runs without getting an fb_dirty callback. Signed-off-by: Thomas Zimmermann

[PATCH v3 01/23] drm/komeda: Don't set struct drm_driver.lastclose

2022-11-03 Thread Thomas Zimmermann
Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as komeda uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose(). Signed-off-by: Thomas Zimmermann R

[PATCH v3 21/23] drm/fb-helper: Move generic fbdev emulation into separate source file

2022-11-03 Thread Thomas Zimmermann
vmwgfx changes * rebase onto xlnx changes * fix include statements in amdgpu Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/Makefile | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 + .../gpu/drm/arm

[PATCH v3 20/23] drm/fb-helper: Set flag in struct drm_fb_helper for leaking physical addresses

2022-11-03 Thread Thomas Zimmermann
Uncouple the parameter drm_leak_fbdev_smem from the implementation by setting a flag in struct drm_fb_helper. This will help to move the generic fbdev emulation into its own source file, while keeping the parameter in drm_fb_helper.c. No functional changes. Signed-off-by: Thomas Zimmermann

[PATCH v3 17/23] drm/fb-helper: Perform all fbdev I/O with the same implementation

2022-11-03 Thread Thomas Zimmermann
e(). Several drivers require these. Until now tegra used I/O read and write, although the memory buffer appears to be in system memory. So use _sys_ helpers now. v3: * fix docs (Javier) v2: * rebase onto vmwgfx changes Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Ca

  1   2   3   4   5   6   7   8   9   >