[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 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

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] 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 1/4] drm/vmwgfx: start to phase out ttm_exec v2

2024-11-25 Thread Ian Forbes
Tested working. Tested-by: Ian Forbes On Thu, Nov 21, 2024 at 4:27 AM Christian König wrote: > > Start switching over vmwgfx to drm_exec as well. Replacing some > unnecessary complex calls with just just single BO dma_resv locking. > > No intentional functional change, but only

Re: [PATCH 2/4] drm/vmwgfx: use the new drm_exec object v2

2024-11-25 Thread Ian Forbes
Breaks userspace command submission. Here's the log with lock debugging on. ``` [ 20.438106] [ 20.439696] WARNING: lock held when returning to user space! [ 20.441730] 6.12.0+ #11 Not tainted [ 20.442389]

Re: [PATCH] drm/vmwgfx: Add Fake EDID

2024-11-20 Thread Ian Forbes
On Wed, Nov 20, 2024 at 4:22 AM Jani Nikula wrote: > > Please avoid all struct edid based interfaces, in this case > drm_connector_update_edid_property(). They will be removed in the > future, and adding more is counter-productive. Everything should be > struct drm_edid based going forward. > > Of

[PATCH] drm/vmwgfx: Add Fake EDID

2024-11-19 Thread Ian Forbes
. This is the approach that virtio takes. This also removes the need to add hotplug_mode_update support for all compositors as traditionally this niche feature has fallen on virtualized driver developers to implement. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 172

Re: [PATCH] drm/vmwgfx: Fix dumb buffer leak

2025-01-30 Thread Ian Forbes
On Tue, Jan 21, 2025 at 1:42 PM Zack Rusin wrote: > > > Ah, that makes sense. If you could improve the commit message that'd > be great (just describe both issues. i.e. the buffer handle being > allocated via vmw_gem_object_create_with_handle which create a gem > handle that holds the reference an

[PATCH] drm/vmwgfx: Switch to exclusively using GEM references

2025-01-31 Thread Ian Forbes
GEM vtable for all BOs even if they are not exposed to userspace. Suggested-by: Christian König Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c| 2 +- drivers/gpu

[PATCH] drm/vmwgfx: Unreserve BO on error

2024-12-10 Thread Ian Forbes
Unlock BOs in reverse order. Add an acquire context so that lockdep doesn't complain. Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 20 +++- 1 file changed, 15 insertions(

Re: [PATCH RFC v2 17/18] drm/vkms: Introduce config for connector EDID

2024-11-22 Thread Ian Forbes
I didn't see a `drm_connector_attach_edid_property` call in this series. Did you forget this? Virtual connectors don't have this property by default. Ian,

[PATCH v2] drm/vmwgfx: Add Fake EDID

2024-11-22 Thread Ian Forbes
fallen on virtualized driver developers to implement. Signed-off-by: Ian Forbes --- v2: - Use drm_edid_read_custom and struct drm_edid - Use DRM_EDID defines where possible - Add edid property to Legacy DU and Screen Object DU - memset the detailed timings since we no longer control the

Re: [PATCH 1/2] drm/vmwgfx: Refactor cursor handling

2025-01-24 Thread Ian Forbes
On Tue, Jan 14, 2025 at 10:50 PM Zack Rusin wrote: > > +int vmw_cursor_plane_prepare_fb(struct drm_plane *plane, > + struct drm_plane_state *new_state) > +{ > + struct drm_framebuffer *fb = new_state->fb; > + struct vmw_cursor_plane *vcp = vmw_plane_to_vcp

[PATCH v2] drm/vmwgfx: Fix dumb buffer leak

2025-01-23 Thread Ian Forbes
ffers") Signed-off-by: Ian Forbes --- v2: - Update commit description - Clean up leaked dirty tracking resources - Fix handling of leaked TTM objects drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 6 -- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_surfa

Re: [PATCH] drm/vmwgfx: Fix dumb buffer leak

2025-01-21 Thread Ian Forbes
On Fri, Jan 17, 2025 at 1:20 PM Zack Rusin wrote: > > You're going to have to explain that one in the commit message a lot > better because as is it doesn't make sense to me. Especially the > !vbo->is_dumb in vmw_bo_free. > > z The dirty tracker is freed later in vmw_bo_release when it's a cohere

[PATCH] drm/vmwgfx: Add new keep_resv BO param

2025-01-10 Thread Ian Forbes
Adds a new BO param that keeps the reservation locked after creation. This removes the need to re-reserve the BO after creation which is a waste of cycles. This also fixes a bug in vmw_prime_import_sg_table where the imported reservation is unlocked twice. Signed-off-by: Ian Forbes Fixes

[PATCH] drm/vmwgfx: Fix dumb buffer leak

2025-01-17 Thread Ian Forbes
Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwg

[PATCH] drm/vmwgfx: Remove busy_places

2025-01-08 Thread Ian Forbes
Unused since commit a78a8da51b36 ("drm/ttm: replace busy placement with flags v6") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/d

[PATCH 2/2] drm/vmwgfx: Implement dma_fence_ops properly

2025-04-10 Thread Ian Forbes
ow work as expected. It also removes vmwgfx's custom implementation of fence callbacks and removes vmwgfx's custom dma_fence_ops::wait function which is no longer necessary now that enable_signaling works. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 16 +- dr

[PATCH 1/2] drm/vmwgfx: Update last_read_seqno under the fence lock

2025-04-10 Thread Ian Forbes
ensures that last_read_seqno is monotonic again. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 3 +-- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 18 +- drivers

[PATCH] drm/vmwgfx: Fix Host-Backed userspace on Guest-Backed kernel

2025-04-29 Thread Ian Forbes
mwgfx: Stop using raw ttm_buffer_object's") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c index 7fb1c88bcc47..69dfe69ce0

[PATCH] drm/vmwgfx: Add seqno waiter for sync_files

2025-03-01 Thread Ian Forbes
ently started using sync_files heavily over the course of 2024 as part of their explicit sync support. Fixes: c906965dee22 ("drm/vmwgfx: Add export fence to file descriptor support") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 26 +

Re: [PATCH] drm/vmwgfx: Make sure the dirty tracker is released on surfaces

2025-03-05 Thread Ian Forbes
Looks good. Reviewed-by: Ian Forbes smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH][next] drm/vmwgfx: fix missing assignment to ts

2025-06-24 Thread Ian Forbes
an King Was this caught by a compiler warning? I'm surprised I didn't get some sort of warning for this. Reviewed-by: Ian Forbes smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH 1/6] drm/vmwgfx: drop printing the TTM refcount for debugging

2025-06-23 Thread Ian Forbes
On Mon, Jun 16, 2025 at 8:07 AM Christian König wrote: > > That is something TTM internal which is about to get dropped. > > Signed-off-by: Christian König Reviewed-by: Ian Forbes smime.p7s Description: S/MIME Cryptographic Signature

[PATCH 1/2] drm/syncobj: Export drm_syncobj_destroy

2025-06-26 Thread Ian Forbes
In order for vmwgfx to use syncobj and maintain compatibility with our existing userspace fencing IOCTLs we need to be able to call this function. Signed-off-by: Ian Forbes --- drivers/gpu/drm/drm_syncobj.c | 13 +++-- include/drm/drm_syncobj.h | 1 + 2 files changed, 12 insertions

[PATCH 2/2] drm/vmwgfx: Implement DRIVER_SYNCOBJ

2025-06-26 Thread Ian Forbes
Replace vmwgfx's ad hoc userspace fence tracking with drm_syncobj. They are nearly identical and it is possible to maintain compatibility with the old IOCTLs. Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 3 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

[PATCH v2 2/2] drm/vmwgfx: Implement dma_fence_ops properly

2025-05-30 Thread Ian Forbes
ow work as expected. It also removes vmwgfx's custom implementation of fence callbacks and removes vmwgfx's custom dma_fence_ops::wait function which is no longer necessary now that enable_signaling works. Signed-off-by: Ian Forbes --- v2: - Rebase - Fix GCC 9 compilation failure due

[PATCH v2 1/2] drm/vmwgfx: Update last_read_seqno under the fence lock

2025-05-30 Thread Ian Forbes
ensures that last_read_seqno is monotonic again. Signed-off-by: Ian Forbes --- v2: - Rebase - Made last_read_seqno atomic drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 8 +--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 3 +-- drivers/gpu/drm

[PATCH] drm/vmwgfx: Clamp the max COTable size

2025-07-28 Thread Ian Forbes
by less than 1% should not have any noticeable impact on well behaving applications. Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support") Signed-off-by: Ian Forbes --- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git