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

2025-04-29 Thread Maaz Mombasawala
vmw_private *dev_priv, > .busy_domain = VMW_BO_DOMAIN_SYS, > .bo_type = ttm_bo_type_device, > .size = size, > - .pin = true, > + .pin = false, > .keep_resv = true, > }; > Looks good. Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala

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

2025-04-10 Thread Maaz Mombasawala
0); > } > > -void vmw_update_seqno(struct vmw_private *dev_priv) > -{ > - uint32_t seqno = vmw_fence_read(dev_priv); > - > - if (dev_priv->last_read_seqno != seqno) { > - dev_priv->last_read_seqno = seqno; > - vmw_fences_update(dev_priv->fman); > - } > -} > - > bool vmw_seqno_passed(struct vmw_private *dev_priv, >uint32_t seqno) > { > @@ -141,7 +131,7 @@ bool vmw_seqno_passed(struct vmw_private *dev_priv, > if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP)) > return true; > > - vmw_update_seqno(dev_priv); > + vmw_fences_update(dev_priv->fman); > if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP)) > return true; > -- Maaz Mombasawala

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

2025-04-10 Thread Maaz Mombasawala
= 0); > } > > -void vmw_update_seqno(struct vmw_private *dev_priv) > -{ > - uint32_t seqno = vmw_fence_read(dev_priv); > - > - if (dev_priv->last_read_seqno != seqno) { > - dev_priv->last_read_seqno = seqno; > - vmw_fences_update(dev_priv->fman); > - } > -} > - > bool vmw_seqno_passed(struct vmw_private *dev_priv, >uint32_t seqno) > { > @@ -141,7 +131,7 @@ bool vmw_seqno_passed(struct vmw_private *dev_priv, > if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP)) > return true; > > - vmw_update_seqno(dev_priv); > + vmw_fences_update(dev_priv->fman); > if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP)) > return true; > -- Maaz Mombasawala

Re: [PATCH v2 0/2] Fix native cursors with vmwgfx

2025-03-06 Thread Maaz Mombasawala
917 deletions(-) > create mode 100644 drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c > create mode 100644 drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.h > Should update the year in the copyright to 2025, looks good otherwise. Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala

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

2024-12-09 Thread Maaz Mombasawala
ource properly if there is error in creating surface object. - Check that guest backed objects are supported when reporting DRM_VMW_PARAM_USER_SRF. - Bind hw_destroy function when command buffer gets commited. Maaz Mombasawala (3): drm/vmwgfx: Introduce userspace managed surfaces drm/vmwgfx: Su

[PATCH v3 3/3] drm/vmwgfx: Add support for older define commands for userspace surfaces

2024-12-09 Thread Maaz Mombasawala
-off-by: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 92 - 1 file changed, 90 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 0468c9f4f293..71c1e0092d55 100644 --- a

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

2024-12-09 Thread Maaz Mombasawala
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: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

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

2024-12-09 Thread Maaz Mombasawala
transfer. Allow userspace submission of surface create and destroy commands. Userspace submits its own surface id which is mapped to a ttm base object and a resource with their corresponding ids. Signed-off-by: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 23 ++- drivers/gpu/drm

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

2024-12-09 Thread Maaz Mombasawala
g the hw_destroy function when command buffer gets committed, so it only gets invoked when userspace has not submitted the destroy command. This also fixes an issue where if there is an error in command buffer checks and the surface create command gets reverted, the kernel still registered hw_destroy function and submitted a destroy surface command for the surface which was never created on device. -- Maaz Mombasawala

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

2024-12-09 Thread Maaz Mombasawala
ill start failing. > > z We can shield this with SVGA_CAP_GBOBJECTS, but sm5_context is not needed. The third patch of this series "drm/vmwgfx: Add support for older define commands for userspace surfaces" adds support for V3 and V2 of the surface creation command, V3 is invoked for sm4.1 and V2 for sm4. -- Maaz Mombasawala

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

2024-10-18 Thread Maaz Mombasawala
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: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

[PATCH v2 3/3] drm/vmwgfx: Add support for older define commands for userspace surfaces

2024-10-18 Thread Maaz Mombasawala
-off-by: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 92 - 1 file changed, 90 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 70f816062fd2..e7f224afe338 100644 --- a

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

2024-10-18 Thread Maaz Mombasawala
transfer. Allow userspace submission of surface create and destroy commands. Userspace submits its own surface id which is mapped to a ttm base object and a resource with their corresponding ids. Signed-off-by: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 23 ++- drivers/gpu/drm

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

2024-10-18 Thread Maaz Mombasawala
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. v2: Add flag for userspace to check userspace surface support. Maaz Mombasawala (3):

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

2024-08-29 Thread Maaz Mombasawala
fx: Fix handling of dumb buffers") > Cc: Broadcom internal kernel review list > > Cc: dri-devel@lists.freedesktop.org > Cc: # v6.9+ > Cc: Maaz Mombasawala > Cc: Martin Krastev > --- > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 29 - > drive

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

2024-08-16 Thread Maaz Mombasawala
rivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 3 + > drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 +- > drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c| 12 +-- > drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 6 +- > 6 files changed, 136 insertions(+), 16 deletions(-) > LGTM for the series. Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala

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

2024-08-15 Thread Maaz Mombasawala
On 8/13/24 19:33, Zack Rusin wrote: > 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

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

2024-08-15 Thread Maaz Mombasawala
LGTM. Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala

[PATCH] drm/vmwgfx: Add debugfs file for displaying buffer information

2024-08-14 Thread Maaz Mombasawala
of these files. Signed-off-by: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 120 drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 8 ++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 51 4 files changed, 131

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

2024-08-14 Thread Maaz Mombasawala
LGTM. Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala

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

2024-08-13 Thread Maaz Mombasawala
> .detect = vmw_du_connector_detect, > @@ -891,7 +917,8 @@ static const struct drm_connector_funcs > vmw_stdu_connector_funcs = { > static const struct > drm_connector_helper_funcs vmw_stdu_connector_helper_funcs = { > .get_modes = vmw_connector_get_modes, > - .mode_valid = vmw_stdu_connector_mode_valid > + .mode_valid = vmw_stdu_connector_mode_valid, > + .atomic_check = vmw_stdu_connector_atomic_check, > }; > > Maaz Mombasawala

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

2024-08-13 Thread Maaz Mombasawala
#define VMWGFX_DRIVER_MAJOR 2 > -#define VMWGFX_DRIVER_MINOR 20 > +#define VMWGFX_DRIVER_MINOR 21 > #define VMWGFX_DRIVER_PATCHLEVEL 0 > #define VMWGFX_FIFO_STATIC_SIZE (1024*1024) > #define VMWGFX_MAX_DISPLAYS 16 Reviewed-by: Maaz Mombasawala Maaz Mombasawala

[PATCH 3/3] drm/vmwgfx: Add support for older define commands for userspace surfaces

2024-08-12 Thread Maaz Mombasawala
-off-by: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 92 - 1 file changed, 90 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 70f816062fd2..e7f224afe338 100644 --- a

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

2024-08-12 Thread Maaz Mombasawala
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: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

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

2024-08-12 Thread Maaz Mombasawala
transfer. Allow userspace submission of surface create and destroy commands. Userspace submits its own surface id which is mapped to a ttm base object and a resource with their corresponding ids. Signed-off-by: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 23 ++- drivers/gpu/drm

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

2024-08-12 Thread Maaz Mombasawala
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/vmwgfx: Introduce userspace managed surfaces drm/vmwgfx: Su

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

2024-07-02 Thread Maaz Mombasawala
- > drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 40 +- > 15 files changed, 775 insertions(+), 534 deletions(-) > For the series - LGTM! Reviewed-by: Maaz Mombasawala Thanks, Maaz Mombasawala

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

2024-07-01 Thread Maaz Mombasawala
wgfx/vmwgfx_resource.c | 27 +- > drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 33 +- > drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 145 +++ > drivers/gpu/drm/vmwgfx/vmwgfx_surface.c| 277 - > drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 40 +- > 15 files changed, 788 insertions(+), 530 deletions(-) > For the series - LGTM! Reviewed-by: Maaz Mombasawala Thanks, Maaz Mombasawala

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

2024-05-01 Thread Maaz Mombasawala
vmw_private, so switch to using that exclusively and stop using dev_private. Signed-off-by: Maaz Mombasawala --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 -- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions

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

2024-04-25 Thread Maaz Mombasawala
data = user_data; > > ret = drm_event_reserve_init(dev, file_priv, &event->base, > &event->event.base); LGTM! Reviewed-by: Maaz Mombasawala Thanks, Maaz Mombasawala

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

2024-04-05 Thread Maaz Mombasawala
priv, > unsigned unit) > dev->mode_config.suggested_x_property, 0); > drm_object_attach_property(&connector->base, > dev->mode_config.suggested_y_property, 0); > + > + vmw_du_init(&stdu->base); &g

Re: [PATCH] drm/vmwgfx: Fix possible null pointer derefence with invalid contexts

2024-01-10 Thread Maaz Mombasawala
> Niels De Graef who reported it and helped to track down the poc. > > Fixes: 9c079b8ce8bf ("drm/vmwgfx: Adapt execbuf to the new validation api") > Cc: # v4.20+ > Reported-by: Niels De Graef > Signed-off-by: Zack Rusin > Cc: Martin Krastev > Cc: Maaz Mom

Re: [PATCH] drm/vmwgfx: Unmap the surface before resetting it on a plane state

2024-01-03 Thread Maaz Mombasawala
69d49c9fc00 > FS: 7f1e8f1b4180() GS:969e75f0() knlGS: > CS: 0010 DS: ES: CR0: 80050033 > CR2: 0028 CR3: 000104006004 CR4: 003706f0 > > Signed-off-by: Zack Rusin > Fixes: 485d98d472d5 ("drm/vmwgfx

[PATCH 2/2] drm/vmwgfx: Add SPDX header to vmwgfx_drm.h

2023-10-09 Thread Maaz Mombasawala (VMware)
From: Maaz Mombasawala Update vmwgfx_drm.h with SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT Signed-off-by: Maaz Mombasawala Reviewed-by: Martin Krastev Signed-off-by: Maaz Mombasawala (VMware) --- include/uapi/drm/vmwgfx_drm.h | 1 + 1 file changed, 1 insertion

[PATCH 1/2] drm/vmwgfx: Make all surfaces shareable

2023-10-09 Thread Maaz Mombasawala (VMware)
From: Maaz Mombasawala There is no real need to have a separate pool for shareable and non-shareable surfaces. Make all surfaces shareable, regardless of whether the drm_vmw_surface_flag_shareable has been specified. Signed-off-by: Maaz Mombasawala Reviewed-by: Martin Krastev Signed-off-by

Re: [PATCH] drm/vmwgfx: Fix possible invalid drm gem put calls

2023-08-23 Thread Maaz Mombasawala (VMWare)
LGTM! Reviewed-by: Maaz Mombasawala Maaz Mombasawala (VMware) On 8/17/2023 9:13 PM, Zack Rusin wrote: From: Zack Rusin vmw_bo_unreference sets the input buffer to null on exit, resulting in null ptr deref's on the subsequent drm gem put calls. This went unnoticed because only ver

Re: [PATCH] drm/vmwgfx: Fix shader stage validation

2023-06-16 Thread Maaz Mombasawala (VMWare)
LGTM. Reviewed-by: Maaz Mombasawala Maaz Mombasawala (VMware) On 6/16/2023 12:09 PM, Zack Rusin wrote: From: Zack Rusin For multiple commands the driver was not correctly validating the shader stages resulting in possible kernel oopses. The validation code was only. if ever, checking the

Re: [PATCH 2/3] drm/vmwgfx: Print errors when running on broken/unsupported configs

2023-03-21 Thread &quot;Maaz Mombasawala (VMware)
> __printf(1, 2) int vmw_host_printf(const char *fmt, ...); > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c > b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c > index ca1a3fe44fa5..2651fe0ef518 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c > @@ -1179,3 +1179,12 @@ int vmw_mksstat_remove_ioctl(struct drm_device *dev, > void *data, > > return -EAGAIN; > } > + > +/** > + * vmw_disable_backdoor: Disables all backdoor communication > + * with the hypervisor. > + */ > +void vmw_disable_backdoor(void) > +{ > + vmw_msg_enabled = 0; > +} LGTM Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala (VMware)

Re: [PATCH] drm/vmwgfx: Stop accessing buffer objects which failed init

2023-02-08 Thread &quot;Maaz Mombasawala (VMware)
vmw_bo_create(dev_priv, ¶ms, p_vbo); > - > - (*p_vbo)->tbo.base.funcs = &vmw_gem_object_funcs; > if (ret != 0) > goto out_no_bo; > > + (*p_vbo)->tbo.base.funcs = &vmw_gem_object_funcs; > + > ret = drm_gem_handle_create(filp, &(*p_vbo)->tbo.base, handle); > /* drop reference from allocate - handle holds it now */ > drm_gem_object_put(&(*p_vbo)->tbo.base); LGTM! Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala (VMware)

Re: [PATCH] drm/vmwgfx: Do not drop the reference to the handle too soon

2023-02-08 Thread &quot;Maaz Mombasawala (VMware)
x/vmwgfx_surface.c > @@ -867,7 +867,6 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void > *data, > goto out_unlock; > } > vmw_bo_reference(res->guest_memory_bo); > - drm_gem_object_get(&res->guest_memory_bo->tbo.base); > } > > tmp = vmw_resource_reference(&srf->res); LGTM! Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala (VMware)

Re: [PATCH v2 8/8] drm/vmwgfx: Stop using raw ttm_buffer_object's

2023-01-31 Thread &quot;Maaz Mombasawala (VMware)
On 1/30/23 19:35, Zack Rusin wrote: > From: Zack Rusin > > Various bits of the driver used raw ttm_buffer_object instead of the > driver specific vmw_bo object. All those places used to duplicate > the mapped bo caching policy of vmw_bo. > > Instead of duplicating all of that code and special ca

Re: [PATCH v2 7/8] drm/vmwgfx: Abstract placement selection

2023-01-31 Thread &quot;Maaz Mombasawala (VMware)
On 1/30/23 19:35, Zack Rusin wrote: > From: Zack Rusin > > Problem with explicit placement selection in vmwgfx is that by the time > the buffer object needs to be validated the information about which > placement was supposed to be used is lost. To workaround this the driver > had a bunch of stat

Re: [PATCH v2 6/8] drm/vmwgfx: Rename dummy to is_iomem

2023-01-31 Thread &quot;Maaz Mombasawala (VMware)
_mapped) { > vmw_bo_unmap(vps->surf->res.backup); > vps->surf_mapped = false; > } > > - if (vps->bo && ttm_kmap_obj_virtual(&vps->bo->map, &dummy)) { > + if (vps->bo && ttm_kmap_obj_virtual(&vps->bo->map, &is_iomem)) { > const int ret = ttm_bo_reserve(&vps->bo->base, true, false, > NULL); > > if (likely(ret == 0)) { LGTM! Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala (VMware)

Re: [PATCH v2 5/8] drm/vmwgfx: Cleanup the vmw bo usage in the cursor paths

2023-01-31 Thread &quot;Maaz Mombasawala (VMware)
gt; *plane, > hotspot_x, hotspot_y); > } > > - if (vps->bo) { > - if (ttm_kmap_obj_virtual(&vps->bo->map, &dummy)) > - atomic_dec(&vps->bo->base_mapped_count); > - } > - > du->cursor_x = new_state->crtc_x + du->set_gui_x; > du->cursor_y = new_state->crtc_y + du->set_gui_y; > LGTM! Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala (VMware)

Re: [PATCH v2 4/8] drm/vmwgfx: Simplify fb pinning

2023-01-31 Thread &quot;Maaz Mombasawala (VMware)
; +} > + > static int vmw_ldu_del_active(struct vmw_private *vmw_priv, > struct vmw_legacy_display_unit *ldu) > { > @@ -145,8 +188,7 @@ static int vmw_ldu_del_active(struct vmw_private > *vmw_priv, > list_del_init(&ldu->active); > if (--(ld->num_active) == 0) { > BUG_ON(!ld->fb); > - if (ld->fb->unpin) > - ld->fb->unpin(ld->fb); > + WARN_ON(vmw_ldu_fb_unpin(ld->fb)); > ld->fb = NULL; > } > > @@ -163,11 +205,10 @@ static int vmw_ldu_add_active(struct vmw_private > *vmw_priv, > > BUG_ON(!ld->num_active && ld->fb); > if (vfb != ld->fb) { > - if (ld->fb && ld->fb->unpin) > - ld->fb->unpin(ld->fb); > + if (ld->fb) > + WARN_ON(vmw_ldu_fb_unpin(ld->fb)); > vmw_svga_enable(vmw_priv); > - if (vfb->pin) > - vfb->pin(vfb); > + WARN_ON(vmw_ldu_fb_pin(vfb)); > ld->fb = vfb; > } > LGTM! Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala (VMware)

Re: [PATCH v2 3/8] drm/vmwgfx: Rename vmw_buffer_object to vmw_bo

2023-01-31 Thread &quot;Maaz Mombasawala (VMware)
On 1/30/23 19:35, Zack Rusin wrote: > From: Zack Rusin > > The rest of the drivers which are using ttm have mostly standardized on > driver_prefix_bo as the name for subclasses of the TTM buffer object. > Make vmwgfx match the rest of the drivers and follow the same naming > semantics. > > This

Re: [PATCH v2 2/8] drm/vmwgfx: Remove the duplicate bo_free function

2023-01-31 Thread &quot;Maaz Mombasawala (VMware)
scrn.c > @@ -445,7 +445,7 @@ vmw_sou_primary_plane_prepare_fb(struct drm_plane *plane, > vmw_overlay_pause_all(dev_priv); > ret = vmw_bo_create(dev_priv, size, > &vmw_vram_placement, > - false, true, &vmw_bo_bo_free, &vps->bo); > + false, true, &vps->bo); > vmw_overlay_resume_all(dev_priv); > if (ret) { > vps->bo = NULL; /* vmw_bo_init frees on error */ > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c > b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c > index 108a496b5d18..93b1400aed4a 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c > @@ -893,7 +893,7 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv, > return -EINVAL; > > ret = vmw_bo_create(dev_priv, size, &vmw_sys_placement, > - true, true, vmw_bo_bo_free, &buf); > + true, true, &buf); > if (unlikely(ret != 0)) > goto out; > LGTM! Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala (VMware)

Re: [PATCH v2 1/8] drm/vmwgfx: Use the common gem mmap instead of the custom code

2023-01-31 Thread &quot;Maaz Mombasawala (VMware)
m_buffer_object *bo; > - int ret; > - > - if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET_START)) > - return -EINVAL; > - > - ret = vmw_bo_vm_lookup(bdev, file_priv, vma->vm_pgoff, vma_pages(vma), > &bo); > - if (unlikely(ret != 0)) > - return ret; > - > - ret = ttm_bo_mmap_obj(vma, bo); > - if (unlikely(ret != 0)) > - goto out_unref; > - > - vma->vm_ops = &vmw_vm_ops; > - > - /* Use VM_PFNMAP rather than VM_MIXEDMAP if not a COW mapping */ > - if (!is_cow_mapping(vma->vm_flags)) > - vma->vm_flags = (vma->vm_flags & ~VM_MIXEDMAP) | VM_PFNMAP; > - > - ttm_bo_put(bo); /* release extra ref taken by ttm_bo_mmap_obj() */ > - > - return 0; > - > -out_unref: > - ttm_bo_put(bo); > - return ret; > -} > - LGTM! Reviewed-by: Maaz Mombasawala -- Maaz Mombasawala (VMware)

Re: [PATCH] drm/vmwgfx: Remove rcu locks from user resources

2022-12-07 Thread &quot;Maaz Mombasawala (VMware)
LGTM. Reviewed-by: Maaz Mombasawala On 12/7/22 09:29, Zack Rusin wrote: > From: Zack Rusin > > User resource lookups used rcu to avoid two extra atomics. Unfortunately > the rcu paths were buggy and it was easy to make the driver crash by > submitting command buffers fro

Re: [PATCH] drm/vmwgfx: Don't use screen objects when SEV is active

2022-12-01 Thread &quot;Maaz Mombasawala (VMware)
gt; struct drm_device *dev = &dev_priv->drm; > int i; > > + /* Screen objects won't work if GMR's aren't available */ > + if (!dev_priv->has_gmr) > + return -ENOSYS; > + > if (!(dev_priv->capabilities & SVGA_CAP_SCREEN_OBJECT_2)) { > return -ENOSYS; > } LGTM -- Maaz Mombasawala (VMware)

Re: [PATCH v3 17/17] drm/vmwgfx: Fix a sparse warning in kernel docs

2022-10-21 Thread &quot;Maaz Mombasawala (VMware)
> * This function copies fence information to user-space. If copying fails, > the > * user-space struct drm_vmw_fence_rep::error member is hopefully left -- Looks good. Reviewed-by: Maaz Mombasawala Maaz Mombasawala (VMware)