[PATCH] drm/vmwgfx: Add tracepoints

2024-09-05 Thread Ian Forbes
submitted to hardware. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/Makefile| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 9 +++- drivers/gpu/drm/vmwgfx/vmwgfx_trace.c | 32 + drivers/gpu/drm/vmwgfx/vmwgfx_trace.h | 62 ++ 4 files changed

Re: [PATCH] drm/vmwgfx: Add tracepoints

2024-09-06 Thread Ian Forbes
On Thu, Sep 5, 2024 at 10:59 PM Zack Rusin wrote: > > > In general it looks good but what's the reason for the submit_time? > > z So you can get an approximate time of how long each command buffer takes. You can then use it to construct a histogram or look for outliers using bpftrace. Useful when

Re: [REGRESSION] drm/vmwgfx shows green Xv instead of actual video (bisected I think)

2024-07-15 Thread Ian Forbes
Hi Doug, Can you try this patch with 6.10. diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c index c45b4724e414..e20f64b67b26 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c @@ -92,7 +92,7 @@ static in

[PATCH] drm/vmwgfx: Fix overlay when using Screen Targets

2024-07-19 Thread Ian Forbes
) Reported-by: Doug Brown Closes: https://lore.kernel.org/all/bd9cb3c7-90e8-435d-bc28-0e38fee58...@schmorgal.com Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/d

Re: [PATCH v4 3/4] drm/vmwgfx: Fix handling of dumb buffers

2024-07-19 Thread Ian Forbes
On Thu, Jul 18, 2024 at 11:22 AM Zack Rusin wrote: > +bool vmw_user_object_is_mapped(struct vmw_user_object *uo) > +{ > + struct vmw_bo *bo; > + > + if (!uo || vmw_user_object_is_null(uo)) > + return false; > + > + bo = vmw_user_object_buffer(uo); > + WARN_ON

[PATCH] drm/vmwgfx: Limit display layout ioctl array size to VMWGFX_NUM_DISPLAY_UNITS

2024-08-08 Thread Ian Forbes
Currently the array size is only limited by the largest kmalloc size which is incorrect. This change will also return a more specific error message than ENOMEM to userspace. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4

[PATCH] drm/vmwgfx: Handle possible ENOMEM in vmw_stdu_connector_atomic_check

2024-08-09 Thread Ian Forbes
Handle unlikely ENOMEN condition and other errors in vmw_stdu_connector_atomic_check. Signed-off-by: Ian Forbes Reported-by: Dan Carpenter Fixes: 75c3e8a26a35 ("drm/vmwgfx: Trigger a modeset when the screen moves") --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 4 1 file changed, 4

Re: [PATCH 1/2] drm/vmwgfx: Prevent unmapping active read buffers

2024-08-13 Thread Ian Forbes
Remove `busy_places` now that it's unused. There's also probably a better place to put `map_count` in the struct layout to avoid false sharing with `cpu_writers`. I'd repack the whole struct if we're going to be adding and removing fields.

Re: [PATCH 1/2] drm/vmwgfx: Prevent unmapping active read buffers

2024-08-13 Thread Ian Forbes
In that case move `map_count` above `map` which should move it to a separate cache line and update the doc strings as needed. Reviewed-by: Ian Forbes On Tue, Aug 13, 2024 at 12:40 PM Zack Rusin wrote: > > On Tue, Aug 13, 2024 at 1:29 PM Ian Forbes wrote: > > > > Remove `bus

Re: [PATCH v2 1/2] drm/vmwgfx: Prevent unmapping active read buffers

2024-08-14 Thread Ian Forbes
Looks Good Thanks, Reviewed-by: Ian Forbes On Wed, Aug 14, 2024 at 2:28 PM Zack Rusin wrote: > > The kms paths keep a persistent map active to read and compare the cursor > buffer. These maps can race with each other in simple scenario where: > a) buffer "a" mapped for

Re: [PATCH 0/5] drm/vmwgfx: Various kms related fixes

2024-01-29 Thread Ian Forbes
LGTM. Reviewed-by: Ian Forbes

[PATCH v2] drm/vmwgfx: Filter modes which exceed 3/4 of graphics memory.

2024-02-02 Thread Ian Forbes
memory (< 64MiB) configured with high resolution mode boot to a black screen because surface creation fails. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vmw

Re: [PATCH v2] drm/vmwgfx: Filter modes which exceed 3/4 of graphics memory.

2024-02-06 Thread Ian Forbes
t might be using texture limits instead. On Fri, Feb 2, 2024 at 1:29 PM Zack Rusin wrote: > > On Fri, Feb 2, 2024 at 11:58 AM Ian Forbes wrote: > > > > SVGA requires surfaces to fit within graphics memory (max_mob_pages) which > > means that modes with a final buffer size

[PATCH] drm/vmwgfx: Remove unused code

2024-02-14 Thread Ian Forbes
Remove unused structs, members, and file. Many of these are written but never read. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/ttm_object.c| 4 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.h| 27 - drivers/gpu/drm/vmwgfx/vmwgfx_kms.c| 12 --- drivers/gpu/drm

[PATCH v2 0/4] Fix memory limits for STDU

2024-05-17 Thread Ian Forbes
Fixes a bug where modes that are too large for the device are exposed and set causing a black screen on boot. v2: Fixed llvmpipe over-alignment bug. Ian Forbes (4): drm/vmwgfx: Filter modes which exceed graphics memory drm/vmwgfx: 3D disabled should not effect STDU memory limits drm/vmwgfx

[PATCH v2 1/4] drm/vmwgfx: Filter modes which exceed graphics memory

2024-05-17 Thread Ian Forbes
igh resolution mode boot to a black screen because surface creation fails. Fixes: d947d1b71deb ("drm/vmwgfx: Add and connect connector helper function") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 43 ++-- 1 file changed, 41 insertions(+)

[PATCH v2 2/4] drm/vmwgfx: 3D disabled should not effect STDU memory limits

2024-05-17 Thread Ian Forbes
drm/vmwgfx: Read new register for GB memory when available") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 4bf6da2b15fe..2e1fb46bca

[PATCH v2 3/4] drm/vmwgfx: Remove STDU logic from generic mode_valid function

2024-05-17 Thread Ian Forbes
STDU has its own mode_valid function now so this logic can be removed from the generic version. Fixes: 935f795045a6 ("drm/vmwgfx: Refactor drm connector probing for display modes") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 3 --- drivers/gpu/drm/vmwgfx/vm

[PATCH v2 4/4] drm/vmwgfx: Standardize use of kibibytes when logging

2024-05-17 Thread Ian Forbes
Use the same standard abbreviation KiB instead of incorrect variants. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 12 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH v3 0/4] Fix memory limits for STDU

2024-05-21 Thread Ian Forbes
Fixes a bug where modes that are too large for the device are exposed and set causing a black screen on boot. v2: Fixed llvmpipe over-alignment bug. v3: Fix comment formatting. Ian Forbes (4): drm/vmwgfx: Filter modes which exceed graphics memory drm/vmwgfx: 3D disabled should not effect

[PATCH v3 1/4] drm/vmwgfx: Filter modes which exceed graphics memory

2024-05-21 Thread Ian Forbes
igh resolution mode boot to a black screen because surface creation fails. Fixes: d947d1b71deb ("drm/vmwgfx: Add and connect connector helper function") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 45 ++-- 1 file changed, 43 insertions(+)

[PATCH v3 3/4] drm/vmwgfx: Remove STDU logic from generic mode_valid function

2024-05-21 Thread Ian Forbes
STDU has its own mode_valid function now so this logic can be removed from the generic version. Fixes: 935f795045a6 ("drm/vmwgfx: Refactor drm connector probing for display modes") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 3 --- drivers/gpu/drm/vmwgfx/vm

[PATCH v3 4/4] drm/vmwgfx: Standardize use of kibibytes when logging

2024-05-21 Thread Ian Forbes
Use the same standard abbreviation KiB instead of incorrect variants. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 12 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH v3 2/4] drm/vmwgfx: 3D disabled should not effect STDU memory limits

2024-05-21 Thread Ian Forbes
drm/vmwgfx: Read new register for GB memory when available") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 4bf6da2b15fe..2e1fb46bca

[PATCH] drm/vmwgfx: Don't memcmp equivalent pointers

2024-03-28 Thread Ian Forbes
These pointers are frequently the same and memcmp does not compare the pointers before comparing their contents so this was wasting cycles comparing 16 KiB of memory which will always be equal. Fixes: bb6780aa5a1d9 ("drm/vmwgfx: Diff cursors when using cmds") Signed-off-by:

[PATCH] drm/vmwgfx: Filter modes which exceed graphics memory

2024-04-01 Thread Ian Forbes
igh resolution mode boot to a black screen because surface creation fails. Fixes: d947d1b71deb ("drm/vmwgfx: Add and connect connector helper function") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 32 +++- 1 file changed, 31 insertions(+

[PATCH v2] drm/vmwgfx: Don't memcmp equivalent pointers

2024-04-05 Thread Ian Forbes
These pointers are frequently the same and memcmp does not compare the pointers before comparing their contents so this was wasting cycles comparing 16 KiB of memory which will always be equal. Fixes: bb6780aa5a1d ("drm/vmwgfx: Diff cursors when using cmds") Signed-off-by: Ian Forbes C

Re: [PATCH 4/5] drm/vmwgfx: Fix crtc's atomic check conditional

2024-04-05 Thread Ian Forbes
Makes sense. Reviewed-by: Ian Forbes On Tue, Apr 2, 2024 at 6:28 PM Zack Rusin wrote: > > The conditional was supposed to prevent enabling of a crtc state > without a set primary plane. Accidently it also prevented disabling > crtc state with a set primary plane. Neither is corr

[PATCH v2 0/4] Fix memory limits for STDU

2024-04-09 Thread Ian Forbes
v2: - Fix bug when not using 3D - Remove STDU code from generic code path - Always use KiB when logging kibibytes Ian Forbes (4): drm/vmwgfx: Filter modes which exceed graphics memory drm/vmwgfx: 3D disabled should not effect STDU memory limits drm/vmwgfx: Remove STDU logic from generic

[PATCH v2 3/4] drm/vmwgfx: Remove STDU logic from generic mode_valid function

2024-04-09 Thread Ian Forbes
STDU has its own mode_valid function now so this logic can be removed from the generic version. Fixes: 935f795045a6 ("drm/vmwgfx: Refactor drm connector probing for display modes") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 3 --- drivers/gpu/drm/vmwgfx/vm

[PATCH v2 1/4] drm/vmwgfx: Filter modes which exceed graphics memory

2024-04-09 Thread Ian Forbes
igh resolution mode boot to a black screen because surface creation fails. Fixes: d947d1b71deb ("drm/vmwgfx: Add and connect connector helper function") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 32 +++- 1 file changed, 31 insertions(+

[PATCH v2 2/4] drm/vmwgfx: 3D disabled should not effect STDU memory limits

2024-04-09 Thread Ian Forbes
drm/vmwgfx: Read new register for GB memory when available") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 41ad13e45554..570d5fb65a

[PATCH v2 4/4] drm/vmwgfx: Standardize use of kibibytes when logging

2024-04-09 Thread Ian Forbes
Use the same standard abbreviation KiB instead of incorrect variants. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 12 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH 0/4] Fix memory limits for STDU

2024-04-11 Thread Ian Forbes
Fixes a bug where modes that are too large for the device are exposed and set causing a black screen on boot. Resending as Patchwork did not like my last submission. Ian Forbes (4): drm/vmwgfx: Filter modes which exceed graphics memory drm/vmwgfx: 3D disabled should not effect STDU memory

[PATCH 1/4] drm/vmwgfx: Filter modes which exceed graphics memory

2024-04-11 Thread Ian Forbes
igh resolution mode boot to a black screen because surface creation fails. Fixes: d947d1b71deb ("drm/vmwgfx: Add and connect connector helper function") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 32 +++- 1 file changed, 31 insertions(+

[PATCH 2/4] drm/vmwgfx: 3D disabled should not effect STDU memory limits

2024-04-11 Thread Ian Forbes
drm/vmwgfx: Read new register for GB memory when available") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 41ad13e45554..570d5fb65a

[PATCH 3/4] drm/vmwgfx: Remove STDU logic from generic mode_valid function

2024-04-11 Thread Ian Forbes
STDU has its own mode_valid function now so this logic can be removed from the generic version. Fixes: 935f795045a6 ("drm/vmwgfx: Refactor drm connector probing for display modes") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 3 --- drivers/gpu/drm/vmwgfx/vm

[PATCH 4/4] drm/vmwgfx: Standardize use of kibibytes when logging

2024-04-11 Thread Ian Forbes
Use the same standard abbreviation KiB instead of incorrect variants. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 12 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers

Re: [PATCH 0/4] Fix memory limits for STDU

2024-04-15 Thread Ian Forbes
On Thu, Apr 11, 2024 at 10:22 PM Zack Rusin wrote: > > - with stdu what happens when the mode selected is close to our > limits, the guest is using a hardware cursor and we allocate cursor > mobs? With overcommit (cfdc3458db8a1620b1e307e3cb07480a161146ab) it won't be an issue. Before overcommit t

[PATCH] drm/vmwgfx: Trigger a modeset when the screen moves

2024-06-24 Thread Ian Forbes
scrollable host window rather than in 2+ windows on separate host displays. Fixes: 426826933109 ("drm/vmwgfx: Filter modes which exceed graphics memory") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 29 +++- 1 file changed, 28 insertions(+),

[PATCH] drm/vmwgfx: Fix Legacy Display Unit

2024-04-25 Thread Ian Forbes
985eea5a6d ("drm/vmwgfx: Abstract placement selection") Signed-off-by: Ian Forbes Cc: # v6.4+ --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c index 2bfac3aad7b7..98e73

[PATCH] drm/vmwgfx: Re-introduce drm_crtc_helper_funcs::prepare

2024-05-03 Thread Ian Forbes
ation") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index 2041c4d48daa..37223f95cbec 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/d

[PATCH] drm/vmwgfx: Add SVGA_3D_CMD_DEFINE_GB_SURFACE_V4 to command array.

2024-01-08 Thread Ian Forbes
Without this definition device errors will display the command name as (null) when debug logging is enabled. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm

[PATCH] drm/vmwgfx: Filter modes which exceed 3/4 of graphics memory.

2024-01-12 Thread Ian Forbes
memory (< 64MiB) configured with high resolution mode boot to a black screen because surface creation fails. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vmw

[PATCH] drm/vmwgfx: Don't destroy Screen Target when CRTC is enabled but inactive

2024-05-31 Thread Ian Forbes
mode has not changed and CRTC is enabled. This fixes a bug with GDM where locking the screen results in a permanent black screen because the Screen Target is no longer defined. Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation") Signed-off-by: Ian Forbes --- drive

[PATCH] drm/vmwgfx: Add common resolutions to the connector mode list

2024-10-28 Thread Ian Forbes
some of the removed modes and adds some additional common ones. Fixes: 935f795045a6 ("drm/vmwgfx: Refactor drm connector probing for display modes") Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2081803 Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_

Re: [PATCH v4] drm/edid: add CTA Video Format Data Block support

2024-11-01 Thread Ian Forbes
We'd like to use the OVT modes for vmwgfx. Can you export the main OVT function so it matches the CVT one? Something like this: struct drm_display_mode *drm_ovt_mode(struct drm_device *dev, int rid, int vrefresh); On Mon, Sep 9, 2024 at 12:17 PM Hamza Mahfooz wrote: > > + > +/* OVT Algorthim as

[PATCH v2] drm/vmwgfx: Add common resolutions to the connector mode list

2024-11-04 Thread Ian Forbes
some of the removed modes and adds some additional common ones. Fixes: 935f795045a6 ("drm/vmwgfx: Refactor drm connector probing for display modes") Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2081803 Signed-off-by: Ian Forbes --- v2: Rename modes array and mak