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

2025-01-24 Thread Zack Rusin
On Fri, Jan 24, 2025 at 11:48 AM Ian Forbes wrote: > > 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) > > +{ > >

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

2025-01-21 Thread Zack Rusin
On Tue, Jan 21, 2025 at 2:11 PM Ian Forbes wrote: > > 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 > >

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

2025-01-17 Thread Zack Rusin
On Fri, Jan 17, 2025 at 2:14 PM Ian Forbes wrote: > > 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 deleti

[PATCH 0/2] Fix native cursors with vmwgfx

2025-01-14 Thread Zack Rusin
vmwgfx had a number of cursor issues that related both to our handling of dumb buffers and general detection when a cursor has actually changed. Fix those issues and bump the kernel module version to allow userspace to recognize fixed versions of the driver. Zack Rusin (2): drm/vmwgfx: Refactor

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

2025-01-14 Thread Zack Rusin
properly updated in the guest. Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/Makefile | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 6 + drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 2 + drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c | 844 +++ drivers

[PATCH 2/2] drm/vmwgfx: Bump the minor version

2025-01-14 Thread Zack Rusin
on vmwgfx again. Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 09ffb49970c9..a171379abf94 100644 --- a/drivers/gpu/drm/vmwgfx

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

2025-01-10 Thread Zack Rusin
.size = bo_size, > - .pin = true > + .pin = true, > + .keep_resv = true, > }; > > ret = vmw_bo_create(dev_priv, &bo_params, &vbo); > if (unlikely(ret != 0)) > return ret; > > - ret = ttm_bo_reserve(&vbo->tbo, false, true, NULL); > - BUG_ON(ret != 0); > ret = vmw_ttm_populate(vbo->tbo.bdev, vbo->tbo.ttm, &ctx); > if (likely(ret == 0)) { > struct vmw_ttm_tt *vmw_tt = > -- > 2.34.1 > That's a pretty nice cleanup and a fix. Reviewed-by: Zack Rusin z smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH v2 22/25] drm/vmwgfx: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-01-10 Thread Zack Rusin
On Thu, Jan 9, 2025 at 10:03 AM Thomas Zimmermann wrote: > > Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch > and buffer size. No alignment required. > > Signed-off-by: Thomas Zimmermann > Cc: Zack Rusin > Cc: Broadcom internal kernel review list >

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

2024-12-03 Thread Zack Rusin
On Tue, Dec 3, 2024 at 1:21 PM Jonas Ådahl wrote: > > On Tue, Dec 03, 2024 at 11:39:05AM -0500, Zack Rusin wrote: > > On Tue, Dec 3, 2024 at 11:32 AM Jonas Ådahl wrote: > > > > > > On Tue, Dec 03, 2024 at 11:27:52AM -0500, Zack Rusin wrote: > > > > O

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

2024-12-03 Thread Zack Rusin
On Tue, Dec 3, 2024 at 11:42 AM Thomas Zimmermann wrote: > > Hi > > > Am 03.12.24 um 17:39 schrieb Zack Rusin: > > On Tue, Dec 3, 2024 at 11:32 AM Jonas Ådahl wrote: > >> On Tue, Dec 03, 2024 at 11:27:52AM -0500, Zack Rusin wrote: > >>> On Tue,

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

2024-12-03 Thread Zack Rusin
On Tue, Dec 3, 2024 at 11:32 AM Jonas Ådahl wrote: > > On Tue, Dec 03, 2024 at 11:27:52AM -0500, Zack Rusin wrote: > > On Tue, Dec 3, 2024 at 10:57 AM Jonas Ådahl wrote: > > > > > > On Wed, Nov 20, 2024 at 07:52:18AM -0500, Zack Rusin wrote: > > > > O

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

2024-12-03 Thread Zack Rusin
On Tue, Dec 3, 2024 at 10:57 AM Jonas Ådahl wrote: > > On Wed, Nov 20, 2024 at 07:52:18AM -0500, Zack Rusin wrote: > > On Wed, Nov 20, 2024 at 5:22 AM Jani Nikula > > wrote: > > > > > > On Wed, 20 Nov 2024, Thomas Zimmermann wrote: > > > >

Re: [PATCH] drm/vmwgfx: Remove initialization of connector status

2024-12-02 Thread Zack Rusin
> > } > > > > drm_connector_helper_add(connector, &vmw_stdu_connector_helper_funcs); > > - connector->status = vmw_du_connector_detect(connector, false); > > > > ret = drm_encoder_init(dev, encoder, &vmw_stdu_encoder_funcs, > > DRM_MODE_ENCODER_VIRTUAL, NULL); > Thank you. Looks good. Reviewed-by: Zack Rusin z smime.p7s Description: S/MIME Cryptographic Signature

Re: Phase out ttm_exec

2024-11-21 Thread Zack Rusin
On Thu, Nov 21, 2024 at 5:27 AM Christian König wrote: > > Hey Zack, > > vmwgfx is the only driver left using this component. > > So I though I go ahead and complete switching over to drm_exec. > The patches are only compile tested, but relatively staright forward. Hi, Christian. Thank you so mu

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

2024-11-20 Thread Zack Rusin
On Wed, Nov 20, 2024 at 5:22 AM Jani Nikula wrote: > > On Wed, 20 Nov 2024, Thomas Zimmermann wrote: > > Hi > > > > > > Am 19.11.24 um 20:40 schrieb Ian Forbes: > >> Most compositors are using a change in EDID as an indicator to > >> refresh their connector information on hotplug regardless of wh

Re: [PATCH v2 2/3] drm/vmwgfx: Support hw_destroy for userspace managed surfaces

2024-11-19 Thread Zack Rusin
On Fri, Oct 18, 2024 at 5:01 PM Maaz Mombasawala wrote: > > A userspace may create a userspace managed surface but not destroy it, > add hw_destroy function for userspace surfaces so that vmwgfx records the > destroy command and submits it when the userspace context is destroyed. > > Signed-off-by

Re: [PATCH v2 1/3] drm/vmwgfx: Introduce userspace managed surfaces

2024-11-19 Thread Zack Rusin
On Fri, Oct 18, 2024 at 5:01 PM Maaz Mombasawala wrote: > > The kernel currently exposes both mobs and surfaces to userspace through > ioctls. We would like to move to a model where kernel would only expose > mobs and have userspace manage surfaces. This would simplify kernel paths > for surfaces

Re: [PATCH] drm/vmwgfx: avoid null_ptr_deref in vmw_framebuffer_surface_create_handle

2024-11-13 Thread Zack Rusin
On Tue, Oct 29, 2024 at 4:43 AM Chen Ridong wrote: > > From: Chen Ridong > > The 'vmw_user_object_buffer' function may return NULL with incorrect > inputs. To avoid possible null pointer dereference, add a check whether > the 'bo' is NULL in the vmw_framebuffer_surface_create_handle. > > Fixes: d

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

2024-10-30 Thread Zack Rusin
On Mon, Oct 28, 2024 at 4:14 PM Ian Forbes wrote: > > We replaced our custom list of resolutions with the noedid list, which is > based on the VESA DMT standard, in the referenced fixes commit. The reason > for this was that the user can technically set any resolution they want by > using Autofit

Re: [RESEND PATCH] drm/vmwgfx: Remove unnecessary NULL checks before kvfree()

2024-10-10 Thread Zack Rusin
On Mon, Oct 7, 2024 at 7:52 AM Thorsten Blum wrote: > > Since kvfree() already checks if its argument is NULL, an additional > check before calling kvfree() is unnecessary and can be removed. > > Remove both and the following Coccinelle/coccicheck warnings reported by > ifnullfree.cocci: > > WAR

Re: [PATCH] vmwgfx: allow building with CONFIG_HAS_IOPORT disabled

2024-10-10 Thread Zack Rusin
a_v3(const struct vmw_private *dev) > { > + if (!IS_ENABLED(CONFIG_HAS_IOPORT)) > + return true; > + > return dev->pci_id == VMWGFX_PCI_ID_SVGA3; > } > > -- > 2.39.2 > Thanks! Looks good. Would you like me to push this through drm-misc-fixes? Reviewed-by: Zack Rusin z

Re: [PATCH] drm/vmwgfx: Handle surface check failure correctly

2024-10-10 Thread Zack Rusin
On Wed, Oct 2, 2024 at 8:26 AM Nikolay Kuratov wrote: > > Currently if condition (!bo and !vmw_kms_srf_ok()) was met > we go to err_out with ret == 0. > err_out dereferences vfb if ret == 0, but in our case vfb is still NULL. > > Fix this by assigning sensible error to ret. > > Found by Linux Veri

Re: [PATCH v2 1/2] drm/ttm: Change ttm_device_init to use a struct instead of multiple bools

2024-10-02 Thread Zack Rusin
n of adding yet another bool flag parameter to the > function. > > Cc: Christian König > Cc: amd-...@lists.freedesktop.org > Cc: intel-...@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Cc: spice-de...@lists.freedesktop.org > Cc: dri-devel@lists.freedesktop.org >

Re: [PATCH v4 71/80] drm/vmwgfx: Run DRM default client setup

2024-09-09 Thread Zack Rusin
On Mon, Sep 9, 2024 at 7:37 AM Thomas Zimmermann wrote: > > Call drm_client_setup() to run the kernel's default client setup > for DRM. Set fbdev_probe in struct drm_driver, so that the client > setup can start the common fbdev client. > > Signed-off-by: Thomas Zimmermann

Re: [PATCH] drm/vmwgfx: Add tracepoints

2024-09-06 Thread Zack Rusin
On Fri, Sep 6, 2024 at 11:26 AM Ian Forbes wrote: > > 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

Re: [PATCH] drm/vmwgfx: Add tracepoints

2024-09-05 Thread Zack Rusin
On Thu, Sep 5, 2024 at 2:17 PM Ian Forbes wrote: > > Adds the necessary files to create tracepoints for the vmwgfx driver. > > Adds a single tracepoint for command buffer completion. This tracepoint > can be used to time command buffer execution time and to decode command > buffer errors. The subm

[PATCH v2] drm/vmwgfx: Cleanup kms setup without 3d

2024-08-26 Thread Zack Rusin
abled on configurations without 3d but with those changes the code actually makes sense. v2: Remove the now unused format variable Signed-off-by: Zack Rusin Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.fre

[PATCH] drm/vmwgfx: Cleanup kms setup without 3d

2024-08-26 Thread Zack Rusin
abled on configurations without 3d but with those changes the code actually makes sense. Signed-off-by: Zack Rusin Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v6.9+ Cc: Maaz Mombasaw

Re: [REGRESSION][BISECTED] vmwgfx crashes with command buffer error after update

2024-08-16 Thread Zack Rusin
On Thu, Aug 15, 2024 at 4:30 PM Andreas Piesk wrote: > > Hello, > > the bug was first reported on VMware Workstation by rdkehn. > > On my setup (archlinux text mode only VM on ESXi 8.0U3 latest) the kernel > does NOT crash, the screen just goes dark after switching the console from > > [2.745

[PATCH 3/3] drm/vmwgfx: Disable coherent dumb buffers without 3d

2024-08-16 Thread Zack Rusin
y low graphics memory limits. The pinned console fb, mob cursors and graphical login manager tend to run out of 16MB graphics memory that those guests use. Fix it by making sure the coherent dumb buffers are only used on configs with 3d enabled. Signed-off-by: Zack Rusin Fixes: d6667f0ddf46

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

2024-08-16 Thread Zack Rusin
d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v5.19+ Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 13 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 3 +++ 2 f

[PATCH 2/3] drm/vmwgfx: Fix prime with external buffers

2024-08-16 Thread Zack Rusin
to be used. Fixes crashes in IGT's kms_prime with vgem. Regular desktop usage won't trigger this due to the fact that virtual machines will not have multiple GPUs but it enables better test coverage in IGT. Signed-off-by: Zack Rusin Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/

[PATCH 0/3] Various prime/dumb buffer fixes

2024-08-16 Thread Zack Rusin
This is the same series I've sent out earlier but with one extra patch, that fixes the dumb buffer coherency on low mem systems. The second patch has also been updated to not use math functions. Zack Rusin (3): drm/vmwgfx: Prevent unmapping active read buffers drm/vmwgfx: Fix prime

Re: [REGRESSION][BISECTED] vmwgfx crashes with command buffer error after update

2024-08-15 Thread Zack Rusin
On Thu, Aug 15, 2024 at 1:48 PM Christian Heusel wrote: > > Hello Zack, > > the user rdkehn (in CC) on the Arch Linux Forums reports that after > updating to the 6.10.4 stable kernel inside of their VM Workstation the > driver crashes with the error attached below. This error is also present > on

[PATCH v3 2/2] drm/vmwgfx: Fix prime with external buffers

2024-08-15 Thread Zack Rusin
to be used. Fixes crashes in IGT's kms_prime with vgem. Regular desktop usage won't trigger this due to the fact that virtual machines will not have multiple GPUs but it enables better test coverage in IGT. v2: Fix the diff rectangle computation Signed-off-by: Zack Rusin Fixes: b32233acce

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

2024-08-15 Thread Zack Rusin
Fixes: 485d98d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v5.19+ Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 13 +++-- drivers/gpu/drm/vmwgf

[PATCH v2 2/2] drm/vmwgfx: Fix prime with external buffers

2024-08-14 Thread Zack Rusin
to be used. Fixes crashes in IGT's kms_prime with vgem. Regular desktop usage won't trigger this due to the fact that virtual machines will not have multiple GPUs but it enables better test coverage in IGT. Signed-off-by: Zack Rusin Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/

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

2024-08-14 Thread Zack Rusin
Fixes: 485d98d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v5.19+ Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 13 +++-- drivers/gpu/drm/vmwgf

Re: [PATCH 0/3] drm/vmwgfx: Add support for userspace managed surfaces.

2024-08-13 Thread Zack Rusin
On Mon, Aug 12, 2024 at 3:16 PM Maaz Mombasawala wrote: > > This series introduces basic support for userspace managed surfaces. The > lifetime and id's of these surfaces is managed by userspace submitted > commands instead of relying on the kernel to manage them. > > Maaz Mombasawala (3): > drm

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

2024-08-13 Thread Zack Rusin
On Tue, Aug 13, 2024 at 1:56 PM Ian Forbes wrote: > > In that case move `map_count` above `map` which should move it to a > separate cache line and update the doc strings as needed. Sorry, I'm not sure I understand. What are you trying to fix? z

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

2024-08-13 Thread Zack Rusin
On Tue, Aug 13, 2024 at 1:29 PM Ian Forbes wrote: > > 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] drm/vmwgfx: Handle possible ENOMEM in vmw_stdu_connector_atomic_check

2024-08-13 Thread Zack Rusin
gt; + if (IS_ERR(conn_state)) > + return PTR_ERR(conn_state); > + > du = vmw_connector_to_stdu(conn); > > if (!conn_state->crtc) > -- > 2.34.1 > Reviewed-by: Zack Rusin z

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

2024-08-13 Thread Zack Rusin
_y2; > }; > > -#define VMWGFX_NUM_DISPLAY_UNITS 8 > - > - > #define vmw_framebuffer_to_vfb(x) \ > container_of(x, struct vmw_framebuffer, base) > #define vmw_framebuffer_to_vfbs(x) \ > -- > 2.34.1 > Looks good. Thanks. Reviewed-by: Zack Rusin z

[PATCH 2/2] drm/vmwgfx: Fix prime with external buffers

2024-08-01 Thread Zack Rusin
to be used. Fixes crashes in IGT's kms_prime with vgem. Regular desktop usage won't trigger this due to the fact that virtual machines will not have multiple GPUs but it enables better test coverage in IGT. Signed-off-by: Zack Rusin Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/

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

2024-08-01 Thread Zack Rusin
d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v5.19+ Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 13 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 1 + 2 f

Re: [PATCH] drm/plane: Fix IS_ERR() vs NULL bug

2024-07-29 Thread Zack Rusin
INT_MIN, INT_MAX); > - if (IS_ERR(prop_y)) { > + if (!prop_y) { > drm_property_destroy(plane->dev, prop_x); > - return PTR_ERR(prop_y); > + return -ENOMEM; > } > > drm_object_attach_property(&plane->base, prop_x, 0); Thanks, that looks good to me. Reviewed-by: Zack Rusin z

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

2024-07-24 Thread Zack Rusin
On Fri, Jul 19, 2024 at 12:37 PM Ian Forbes wrote: > > This code was never updated to support Screen Targets. > Fixes a bug where Xv playback displays a green screen instead of actual > video contents when 3D acceleration is disabled in the guest. > > Fixes: c8261a961ece ("vmwgfx: Major KMS refact

[PATCH] drm/vmwgfx: Bump the minor version of the driver

2024-07-22 Thread Zack Rusin
Provide a way to query for the fixed support for dumb buffers with kms. Lets mesa svga return a buffer id, instead of a surface id from resource_to_handle which fixes a lot of userspace apps that assume that those handles are gem buffers. Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx

[PATCH v5 4/4] drm/vmwgfx: Add basic support for external buffers

2024-07-22 Thread Zack Rusin
by us, it's semantically completely broken. Fix importing of external buffers by forwarding all memory access requests to the importer. Tested by the vmw_prime basic_vgem test. Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Reviewed-by: Martin Krastev --- drivers/gpu/drm/vmwgfx/vm

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

2024-07-22 Thread Zack Rusin
d kms but internally switch to vmw_surface's to properly track the dirty state of the objects between the GPU and CPU. Fixes new kwin and kde on wayland. Signed-off-by: Zack Rusin Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/export") Cc: Broadcom internal kernel review

[PATCH v5 2/4] drm/vmwgfx: Make sure the screen surface is ref counted

2024-07-22 Thread Zack Rusin
s not always the code, in particular during atomic disable, so to make sure the surface, when present, is not being actively destroyed at the same time, hold a reference to it. Signed-off-by: Zack Rusin Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation") Cc: Zack Rusi

[PATCH v5 1/4] drm/vmwgfx: Fix a deadlock in dma buf fence polling

2024-07-22 Thread Zack Rusin
particular this fixes KDE stalls/deadlock. Signed-off-by: Zack Rusin Fixes: 2298e804e96e ("drm/vmwgfx: rework to new fence interface, v2") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v6.2+ --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 17

[PATCH v5 0/4] Fix various buffer mapping/import issues

2024-07-22 Thread Zack Rusin
or races due to buffer mapping not being reserved in the third patch v5: Use map.virtual to check whether an user buffer is mapped instead of map.bo. There's no change in functionality but we do use map.virtual to check whether a buffer has been mapped elsewhere so usage of it is more consistent. S

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

2024-07-18 Thread Zack Rusin
d kms but internally switch to vmw_surface's to properly track the dirty state of the objects between the GPU and CPU. Fixes new kwin and kde on wayland. Signed-off-by: Zack Rusin Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/export") Cc: Broadcom internal kernel review

[PATCH v4 4/4] drm/vmwgfx: Add basic support for external buffers

2024-07-18 Thread Zack Rusin
by us, it's semantically completely broken. Fix importing of external buffers by forwarding all memory access requests to the importer. Tested by the vmw_prime basic_vgem test. Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Reviewed-by: Martin Krastev --- drivers/gpu/drm/vmwgfx/vm

[PATCH v4 2/4] drm/vmwgfx: Make sure the screen surface is ref counted

2024-07-18 Thread Zack Rusin
s not always the code, in particular during atomic disable, so to make sure the surface, when present, is not being actively destroyed at the same time, hold a reference to it. Signed-off-by: Zack Rusin Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation") Cc: Zack Rusi

[PATCH v4 1/4] drm/vmwgfx: Fix a deadlock in dma buf fence polling

2024-07-18 Thread Zack Rusin
particular this fixes KDE stalls/deadlock. Signed-off-by: Zack Rusin Fixes: 2298e804e96e ("drm/vmwgfx: rework to new fence interface, v2") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v6.2+ --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 17

[PATCH v4 0/4] Fix various buffer mapping/import issues

2024-07-18 Thread Zack Rusin
or races due to buffer mapping not being reserved in the third patch Zack Rusin (4): drm/vmwgfx: Fix a deadlock in dma buf fence polling drm/vmwgfx: Make sure the screen surface is ref counted drm/vmwgfx: Fix handling of dumb buffers drm/vmwgfx: Add basic support for external buffers drivers

Re: [PATCH v2] drm/qxl: Pin buffer objects for internal mappings

2024-07-08 Thread Zack Rusin
1-65d02bb02...@suse.de/ > Tested-by: David Kaplan > Reviewed-by: Daniel Vetter > Cc: Thomas Zimmermann > Cc: Dmitry Osipenko > Cc: Christian König > Cc: Zack Rusin > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: virtualizat...@lists.linux.dev > Cc: spice-de...@

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

2024-07-01 Thread Zack Rusin
d kms but internally switch to vmw_surface's to properly track the dirty state of the objects between the GPU and CPU. Fixes new kwin and kde on wayland. Signed-off-by: Zack Rusin Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/export") Cc: Broadcom internal kernel review

[PATCH v3 4/4] drm/vmwgfx: Add basic support for external buffers

2024-07-01 Thread Zack Rusin
by us, it's semantically completely broken. Fix importing of external buffers by forwarding all memory access requests to the importer. Tested by the vmw_prime basic_vgem test. Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Reviewed-by: Martin Krastev --- drivers/gpu/drm/vmwgfx/vm

[PATCH v3 2/4] drm/vmwgfx: Make sure the screen surface is ref counted

2024-07-01 Thread Zack Rusin
s not always the code, in particular during atomic disable, so to make sure the surface, when present, is not being actively destroyed at the same time, hold a reference to it. Signed-off-by: Zack Rusin Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation") Cc: Zack Rusi

[PATCH v3 1/4] drm/vmwgfx: Fix a deadlock in dma buf fence polling

2024-07-01 Thread Zack Rusin
particular this fixes KDE stalls/deadlock. Signed-off-by: Zack Rusin Fixes: 2298e804e96e ("drm/vmwgfx: rework to new fence interface, v2") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v6.2+ --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 17

[PATCH v3 0/4] Fix various buffer mapping/import issues

2024-07-01 Thread Zack Rusin
which always works and doesn't require any changes in userspace. This fixes the known KDE (KWin's) buffer rendering issues. v2: Fix compute_crc in the second patch, as spotted by Martin v3: Simplify the first change which fixes the deadlock in the dma-buf fence polling Zack Rusin (4): dr

[PATCH v2 1/4] drm/vmwgfx: Fix a deadlock in dma buf fence polling

2024-06-28 Thread Zack Rusin
particular this fixes KDE stalls/deadlock. Signed-off-by: Zack Rusin Fixes: 2298e804e96e ("drm/vmwgfx: rework to new fence interface, v2") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v6.2+ --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 26 ++

[PATCH v2 2/4] drm/vmwgfx: Make sure the screen surface is ref counted

2024-06-28 Thread Zack Rusin
s not always the code, in particular during atomic disable, so to make sure the surface, when present, is not being actively destroyed at the same time, hold a reference to it. Signed-off-by: Zack Rusin Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation") Cc: Zack Rusin Cc:

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

2024-06-28 Thread Zack Rusin
d kms but internally switch to vmw_surface's to properly track the dirty state of the objects between the GPU and CPU. Fixes new kwin and kde on wayland. Signed-off-by: Zack Rusin Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/export") Cc: Broadcom internal kernel review

[PATCH v2 4/4] drm/vmwgfx: Add basic support for external buffers

2024-06-28 Thread Zack Rusin
by us, it's semantically completely broken. Fix importing of external buffers by forwarding all memory access requests to the importer. Tested by the vmw_prime basic_vgem test. Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 62 +++-- 1 file c

[PATCH v2 0/4] Fix various buffer mapping/import issues

2024-06-28 Thread Zack Rusin
which always works and doesn't require any changes in userspace. This fixes the known KDE (KWin's) buffer rendering issues. v2: Fix compute_crc in the second patch, as spotted by Martin Zack Rusin (4): drm/vmwgfx: Fix a deadlock in dma buf fence polling drm/vmwgfx: Make sure the screen

Re: [PATCH 2/4] drm/vmwgfx: Make sure the screen surface is ref counted

2024-06-27 Thread Zack Rusin
On Thu, Jun 27, 2024 at 8:37 AM Martin Krastev wrote: > > On Thu, Jun 27, 2024 at 8:34 AM Zack Rusin wrote: > > > > Fix races issues in virtual crc generation by making sure the surface > > the code uses for crc computation is properly ref counted. > > > >

[PATCH 4/4] drm/vmwgfx: Add basic support for external buffers

2024-06-26 Thread Zack Rusin
by us, it's semantically completely broken. Fix importing of external buffers by forwarding all memory access requests to the importer. Tested by the vmw_prime basic_vgem test. Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 62 +++-- 1 file c

[PATCH 2/4] drm/vmwgfx: Make sure the screen surface is ref counted

2024-06-26 Thread Zack Rusin
s not always the code, in particular during atomic disable, so to make sure the surface, when present, is not being actively destroyed at the same time, hold a reference to it. Signed-off-by: Zack Rusin Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation") Cc: Zack Rusin Cc:

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

2024-06-26 Thread Zack Rusin
d kms but internally switch to vmw_surface's to properly track the dirty state of the objects between the GPU and CPU. Fixes new kwin and kde on wayland. Signed-off-by: Zack Rusin Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/export") Cc: Broadcom internal kernel review

[PATCH 1/4] drm/vmwgfx: Fix a deadlock in dma buf fence polling

2024-06-26 Thread Zack Rusin
particular this fixes KDE stalls/deadlock. Signed-off-by: Zack Rusin Fixes: 2298e804e96e ("drm/vmwgfx: rework to new fence interface, v2") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v6.2+ --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 26 ++

[PATCH 0/4] Fix various buffer mapping/import issues

2024-06-26 Thread Zack Rusin
ffers both (raw buffers and surfaces referenced by the same handle), which always works and doesn't require any changes in userspace. This fixes the known KDE (KWin's) buffer rendering issues. Zack Rusin (4): dr

Re: [PATCH 1/2] drm/vmwgfx: Fix missing HYPERVISOR_GUEST dependency

2024-06-17 Thread Zack Rusin
On Mon, Jun 17, 2024 at 6:02 AM Borislav Petkov wrote: > > On Mon, Jun 17, 2024 at 11:07:09AM +0200, Borislav Petkov wrote: > > On Sat, Jun 15, 2024 at 06:25:10PM -0700, Alexey Makhalov wrote: > > > VMWARE_HYPERCALL alternative will not work as intended without > > > VMware guest code initializati

Re: [PATCH 3/6] drm/vmwgfx: remove unused struct 'vmw_stdu_dma'

2024-06-05 Thread Zack Rusin
On Mon, Jun 3, 2024 at 1:24 PM Dr. David Alan Gilbert wrote: > > * li...@treblig.org (li...@treblig.org) wrote: > > From: "Dr. David Alan Gilbert" > > > > 'vmw_stdu_dma' is unused since > > commit 39985eea5a6d ("drm/vmwgfx: Abstract placement selection") > > Remove it. > > Ping. Thanks. I pushed

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

2024-05-21 Thread Zack Rusin
nged, 60 insertions(+), 37 deletions(-) Looks great. For the series: Reviewed-by: Zack Rusin z

Re: dma-buf sg mangling

2024-05-15 Thread Zack Rusin
On Tue, May 14, 2024 at 3:00 AM Christian König wrote: > > Am 14.05.24 um 06:15 schrieb Zack Rusin: > > On Mon, May 13, 2024 at 1:09 PM Christian König > wrote: > > Am 10.05.24 um 18:34 schrieb Zack Rusin: > > Hey, > > so this is a bit of a silly problem but I&#x

Re: dma-buf sg mangling

2024-05-13 Thread Zack Rusin
On Mon, May 13, 2024 at 1:09 PM Christian König wrote: > > Am 10.05.24 um 18:34 schrieb Zack Rusin: > > Hey, > > > > so this is a bit of a silly problem but I'd still like to solve it > > properly. The tldr is that virtualized drivers abuse > > drm_dr

dma-buf sg mangling

2024-05-10 Thread Zack Rusin
Hey, so this is a bit of a silly problem but I'd still like to solve it properly. The tldr is that virtualized drivers abuse drm_driver::gem_prime_import_sg_table (at least vmwgfx and xen do, virtgpu and xen punt on it) because there doesn't seem to be a universally supported way of converting the

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

2024-05-03 Thread Zack Rusin
On Fri, May 3, 2024 at 6:29 PM Ian Forbes wrote: > > This function was removed in the referenced fixes commit and caused a > regression. This is because the presence of this function, even though it > is a noop, changes the behaviour of disable_outputs in > drm_atomic_helper.c:1211. > > Fixes: 7b0

Re: [PATCH] drm/vmwgfx: Stop using dev_private to store driver data.

2024-05-01 Thread Zack Rusin
position(plane->dev->dev_private, false, 0, 0); > + vmw_cursor_update_position(vmw_priv(plane->dev), false, 0, 0); > > for (i = 0; i < ARRAY_SIZE(vcp->cursor_mobs); i++) > vmw_du_destroy_cursor_mob(&vcp->cursor_mobs[i]); > -- > 2.34.1 > Looks good. Reviewed-by: Zack Rusin z

Re: [PATCH] drm/vmwgfx: Remove duplicate vmwgfx_vkms.h header

2024-04-30 Thread Zack Rusin
On Tue, Apr 16, 2024 at 9:29 PM Jiapeng Chong wrote: > > ./drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c: vmwgfx_vkms.h is included more than > once. > > Reported-by: Abaci Robot > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8772 > Signed-off-by: Jiapeng Chong > --- > drivers/gpu/drm/vmwgfx/

Re: [PATCH] drm/vmwgfx: Fix Legacy Display Unit

2024-04-25 Thread Zack Rusin
ttm_bo_validate(bo, &buf->placement, &ctx); > > /* For some reason we didn't end up at the start of vram */ Looks great. I'll push it through drm-misc-fixes. Reviewed-by: Zack Rusin z

[PATCH] drm/vmwgfx: Fix invalid reads in fence signaled events

2024-04-25 Thread Zack Rusin
thus resuling in oob reads. Signed-off-by: Zack Rusin Fixes: 8b7de6aa8468 ("vmwgfx: Rework fence event action") Reported-by: zdi-disclosu...@trendmicro.com # ZDI-CAN-23566 Cc: David Airlie CC: Daniel Vetter Cc: Zack Rusin Cc: Broadcom internal kernel review list Cc: dri-devel@lists.

Re: [PATCH] drm/ttm: Print the memory decryption status just once

2024-04-18 Thread Zack Rusin
Ping on this one. If we don't want the "_once" then I can quickly prepare a patch that just removes the logging altogether, because while useful it's polluting up the kernel logs too much right now so getting a fix in for 6.9 for this would be great. z On Mon, Apr 8, 2024 a

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

2024-04-11 Thread Zack Rusin
On Thu, Apr 11, 2024 at 5:27 PM Ian Forbes wrote: > > 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 m

[PATCH v2 5/5] drm/vmwgfx: Sort primary plane formats by order of preference

2024-04-11 Thread Zack Rusin
arams pass because the test picks the first format which for vmwgfx was DRM_FORMAT_XRGB1555 and uses fb's with odd sizes which make Pixman, which IGT depends on assert due to the fact that our 16bpp formats aren't 32 bit aligned like Pixman requires all formats to be. Signed-off-by: Zack Rusin

[PATCH v2 0/5] drm/vmwgfx: vblank and crc generation support

2024-04-11 Thread Zack Rusin
er of kms issues in the driver. v2: Fix misspelled comment header found by the kernel test robot, a style fix spotted by Martin and improve commit message in 5/5 as suggested by Pekka. Zack Rusin (5): drm/vmwgfx: Implement virtual kms drm/vmwgfx: Implement virtual crc generation drm/vmwgfx

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

2024-04-11 Thread Zack Rusin
will help debug broken userspace. Fixes IGT's kms_atomic_interruptible and kms_atomic_transition tests. Signed-off-by: Zack Rusin Fixes: 06ec41909e31 ("drm/vmwgfx: Add and connect CRTC helper functions") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.o

[PATCH v2 3/5] drm/vmwgfx: Fix prime import/export

2024-04-11 Thread Zack Rusin
t the driver created buffers couldn't have been prime exported or imported. Fix prime import/export. Makes IGT's kms_prime pass. Signed-off-by: Zack Rusin Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM") Cc: # v6.6+ Reviewed-by: Martin Krastev --- drivers/gpu/drm/vmwgfx

[PATCH v2 2/5] drm/vmwgfx: Implement virtual crc generation

2024-04-11 Thread Zack Rusin
er IGT tests which require CRC generation of the output to actually run on vmwgfx. Makes it possible to actually validate a lof of the kms and drm functionality with vmwgfx. Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |

[PATCH v2 1/5] drm/vmwgfx: Implement virtual kms

2024-04-11 Thread Zack Rusin
.vkms_enable = "TRUE" somewhere in the vmx file, otherwise it's off by default. Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/Makefile | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 3 + drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 2 + drivers/gpu/drm/vmwgfx/vmwgf

Re: [PATCH] drm/ttm: Print the memory decryption status just once

2024-04-08 Thread Zack Rusin
Sorry, apologies to everyone. By accident I replied off the list. Redoing it now on the list. More below. On Mon, Apr 8, 2024 at 12:10 PM Christian König wrote: > > Am 08.04.24 um 18:04 schrieb Zack Rusin: > > On Mon, Apr 8, 2024 at 11:59 AM Christian König > > wrote: > &g

[PATCH] drm/ttm: Print the memory decryption status just once

2024-04-08 Thread Zack Rusin
Stop printing the TT memory decryption status info each time tt is created and instead print it just once. Reduces the spam in the system logs when running guests with SEV enabled. Signed-off-by: Zack Rusin Fixes: 71ce046327cf ("drm/ttm: Make sure the mapped tt pages are decrypted when n

[PATCH] drm/vmwgfx: Enable DMA mappings with SEV

2024-04-07 Thread Zack Rusin
Enable DMA mappings in vmwgfx after TTM has been fixed in commit 3bf3710e3718 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem") This enables full guest-backed memory support and in particular allows usage of screen targets as the presentation mechanism. Signed-off-by:

Re: [PATCH 1/5] drm/vmwgfx: Implement virtual kms

2024-04-05 Thread Zack Rusin
On Fri, Apr 5, 2024 at 5:53 PM Maaz Mombasawala wrote: > > On 4/2/24 16:28, Zack Rusin wrote: > > > > @@ -541,6 +518,8 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, > > unsigned unit) > >dev_priv->implicit_placement_prope

Re: [PATCH 5/5] drm/vmwgfx: Sort primary plane formats by order of preference

2024-04-03 Thread Zack Rusin
On Wed, Apr 3, 2024 at 3:43 AM Pekka Paalanen wrote: > > On Tue, 2 Apr 2024 19:28:13 -0400 > Zack Rusin wrote: > > > The table of primary plane formats wasn't sorted at all, leading to > > applications picking our least desirable formats by defaults. > >

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

2024-04-02 Thread Zack Rusin
will help debug broken userspace. Fixes IGT's kms_atomic_interruptible and kms_atomic_transition tests. Signed-off-by: Zack Rusin Fixes: 06ec41909e31 ("drm/vmwgfx: Add and connect CRTC helper functions") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.o

  1   2   3   4   5   6   7   >