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

2024-05-21 Thread Zack Rusin
s changed, 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'd

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_driver:

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

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:

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

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

2024-04-25 Thread Zack Rusin
ret = ttm_bo_validate(bo, >placement, ); > > /* 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
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.freed

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 at 1:46 PM

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

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

2024-04-11 Thread Zack Rusin
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 Fixes: 36cc79bc9077

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

2024-04-11 Thread Zack Rusin
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: Fix

[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.org Cc

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

2024-04-11 Thread Zack Rusin
that 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/vmwgfx_blit.c

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

2024-04-11 Thread Zack Rusin
equire 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 | 2 + drivers/gpu/

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

2024-04-11 Thread Zack Rusin
;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/vmwgfx_kms.c | 15 ++- drive

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.org Cc

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

2024-04-02 Thread Zack Rusin
format. Signed-off-by: Zack Rusin Fixes: 36cc79bc9077 ("drm/vmwgfx: Add universal plane support") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v4.12+ --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

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

2024-04-02 Thread Zack Rusin
that 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+ --- drivers/gpu/drm/vmwgfx/vmwgfx_blit.c | 35 +++-- d

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

2024-04-02 Thread Zack Rusin
equire 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 | 2 + drivers/gpu/

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

2024-04-02 Thread Zack Rusin
;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/vmwgfx_kms.c | 15 ++- drive

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

2024-04-02 Thread Zack Rusin
of kms issues in the driver. Zack Rusin (5): drm/vmwgfx: Implement virtual kms drm/vmwgfx: Implement virtual crc generation drm/vmwgfx: Fix prime import/export drm/vmwgfx: Fix crtc's atomic check conditional drm/vmwgfx: Sort primary plane formats by order of preference drivers/gpu/drm

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

2024-04-02 Thread Zack Rusin
On Mon, Apr 1, 2024 at 4:35 PM Ian Forbes wrote: > > SVGA requires individual surfaces to fit within graphics memory > (max_mob_pages) which means that modes with a final buffer size that would > exceed graphics memory must be pruned otherwise creation will fail. > > This fixes an issue where VMs

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

2024-03-28 Thread Zack Rusin
On Thu, Mar 28, 2024 at 3:31 PM Ian Forbes wrote: > > 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:

Re: [PATCH 01/43] drm/fbdev-generic: Do not set physical framebuffer address

2024-03-17 Thread Zack Rusin
and only exported to userspace > on dedicated ARM configs. No functional change is expected. > > Signed-off-by: Thomas Zimmermann > Fixes: a5b44c4adb16 ("drm/fbdev-generic: Always use shadow buffering") > Cc: Thomas Zimmermann > Cc: Javier Martinez Canillas > Cc: Zack Ru

Re: [PATCH] vmwgfx: Create debugfs ttm_resource_manager entry only if needed

2024-03-13 Thread Zack Rusin
ttm"); > + if (vmw->has_mob) { > + > ttm_resource_manager_create_debugfs(ttm_manager_type(>bdev, VMW_PL_MOB), > + root, "mob_ttm"); > + > ttm_resource_manager_create_debugfs(ttm_manager_type(>bdev, > VMW_PL_SYSTEM), > + root, "system_mob_ttm"); > + } > } > > static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, > > base-commit: b33651a5c98dbd5a919219d8c129d0674ef74299 > -- > 2.44.0 > Thanks! That looks great. I can push it through drm-misc-fixes. Reviewed-by: Zack Rusin z

Re: [PATCH 00/13] drm: Fix reservation locking for pin/unpin and console

2024-02-27 Thread Zack Rusin
e21ba4582761c > prerequisite-patch-id: 734c87e610747779aa41be12eb9e4c984bdfa743 > prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb > prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24 > prerequisite-patch-id: cbc453ee02fae02af22fbfdce56ab732c7a88c36 > -- > 2.43.2 > That's a really nice cleanup! I already gave a r-b for 9/13. For the rest: Acked-by: Zack Rusin z

Re: [PATCH 09/13] drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()

2024-02-27 Thread Zack Rusin
false); > + struct vmw_bo *vbo = to_vmw_bo(obj); > + > + vmw_bo_pin_reserved(vbo, false); > } > > static struct sg_table *vmw_gem_object_get_sg_table(struct drm_gem_object > *obj) > diff --git a/include/drm/drm_gem_shmem_helper.h > b/include/drm/drm_gem_shmem_helper.h > index eb12aa9a8c556..efbc9f27312b5 100644 > --- a/include/drm/drm_gem_shmem_helper.h > +++ b/include/drm/drm_gem_shmem_helper.h > @@ -175,15 +175,8 @@ static inline void > drm_gem_shmem_object_print_info(struct drm_printer *p, unsign > static inline int drm_gem_shmem_object_pin(struct drm_gem_object *obj) > { > struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj); > - int ret; > > - ret = dma_resv_lock_interruptible(shmem->base.resv, NULL); > - if (ret) > - return ret; > - ret = drm_gem_shmem_pin_locked(shmem); > - dma_resv_unlock(shmem->base.resv); > - > - return ret; > + return drm_gem_shmem_pin_locked(shmem); > } > > /** > @@ -197,9 +190,7 @@ static inline void drm_gem_shmem_object_unpin(struct > drm_gem_object *obj) > { > struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj); > > - dma_resv_lock(shmem->base.resv, NULL); > drm_gem_shmem_unpin_locked(shmem); > - dma_resv_unlock(shmem->base.resv); > } > > Ah, I see. Looks great. Reviewed-by: Zack Rusin

Re: [PATCH 08/13] drm/qxl: Acquire reservation lock in GEM pin/unpin callbacks

2024-02-27 Thread Zack Rusin
On Tue, Feb 27, 2024 at 6:39 AM Thomas Zimmermann wrote: > > Acquire the reservation lock directly in GEM pin callback. Same for > unpin. Prepares for further changes. > > Dma-buf locking semantics require callers to hold the buffer's > reservation lock when invoking the pin and unpin callbacks.

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

2024-02-07 Thread Zack Rusin
On Tue, Feb 6, 2024 at 4:30 PM Ian Forbes wrote: > > So the issue is that SVGA_3D_CMD_DX_PRED_COPY_REGION between 2 > surfaces that are the size of the mode fails. Technically for this to > work the filter will have to be 1/2 of graphics mem. I was just lucky > that the next mode in the list was

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

2024-02-02 Thread Zack Rusin
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 that would exceed graphics memory > must be pruned otherwise creation will fail. Sorry, I didn't notice this originally but

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

2024-01-30 Thread Zack Rusin
On Tue, Jan 30, 2024 at 6:50 PM Daniel Stone wrote: > > Hi, > > On Tue, 30 Jan 2024 at 18:39, Zack Rusin wrote: > > In general, yes. Of course it's a little more convoluted because we'll > > act like OpenGL runtime here (i.e. glXSwapBuffers), i.e. our driver > >

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

2024-01-30 Thread Zack Rusin
On Fri, Jan 12, 2024 at 4:20 PM Ian Forbes wrote: > > SVGA requires surfaces to fit within graphics memory (max_mob_pages) which > means that modes with a final buffer size that would exceed graphics memory > must be pruned otherwise creation will fail. > > Additionally, device commands which use

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

2024-01-30 Thread Zack Rusin
On Fri, Jan 19, 2024 at 4:22 AM Thomas Zimmermann wrote: > > Hi > > Am 18.01.24 um 19:25 schrieb Zack Rusin: > > On Mon, Jan 15, 2024 at 3:21 AM Thomas Zimmermann > > wrote: > >> > >> Hi > >> > >> Am 12.01.24 um 21:38 schrieb Ian

[PATCH 1/5] drm/vmwgfx: Refactor drm connector probing for display modes

2024-01-26 Thread Zack Rusin
From: Martin Krastev Implement drm_connector_helper_funcs.mode_valid and .get_modes, replacing custom drm_connector_funcs.fill_modes code with drm_helper_probe_single_connector_modes; for STDU, LDU & SOU display units. Signed-off-by: Martin Krastev Reviewed-by: Zack Rusin Signed-off-by:

[PATCH 5/5] drm/vmwgfx: Fix the lifetime of the bo cursor memory

2024-01-26 Thread Zack Rusin
of the mapped memory themselves, leading to crashes. Use the map_and_cache instead of trying to manage the lifetime of the buffer objects held by the vmw_plane_state. Fixes kernel oops'es in IGT's kms_cursor_legacy forked-bo. Signed-off-by: Zack Rusin Fixes: bb6780aa5a1d ("drm/vmwgfx: Diff cursors

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

2024-01-26 Thread Zack Rusin
-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/ttm_object.c | 6 +++--- drivers/gpu/drm/vmwgfx/ttm_object.h | 3 +-- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 17 ++--- include/uapi/drm/vmwgfx_drm.h | 5 +++-- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git

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

2024-01-26 Thread Zack Rusin
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: Zack Rusin --- include/uapi/drm/vmwgfx_drm.h | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 4/5] drm/vmwgfx: Fix vmw_du_get_cursor_mob fencing of newly-created MOBs

2024-01-26 Thread Zack Rusin
feature. Fixes: 53bc3f6fb6b3 ("drm/vmwgfx: Clean up cursor mobs") Signed-off-by: Martin Krastev Reviewed-by: Maaz Mombasawala Reviewed-by: Zack Rusin Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-)

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

2024-01-26 Thread Zack Rusin
for display modes drm/vmwgfx: Fix vmw_du_get_cursor_mob fencing of newly-created MOBs Zack Rusin (1): drm/vmwgfx: Fix the lifetime of the bo cursor memory drivers/gpu/drm/vmwgfx/ttm_object.c | 6 +- drivers/gpu/drm/vmwgfx/ttm_object.h | 3 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Re: [PATCH v3] drm/ttm: Make sure the mapped tt pages are decrypted when needed

2024-01-25 Thread Zack Rusin
On Fri, Jan 5, 2024 at 8:51 AM Zack Rusin wrote: > > Some drivers require the mapped tt pages to be decrypted. In an ideal > world this would have been handled by the dma layer, but the TTM page > fault handling would have to be rewritten to able to do that. > > A side-effe

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

2024-01-18 Thread Zack Rusin
On Mon, Jan 15, 2024 at 3:21 AM Thomas Zimmermann wrote: > > Hi > > Am 12.01.24 um 21:38 schrieb Ian Forbes: > > SVGA requires surfaces to fit within graphics memory (max_mob_pages) which > > means that modes with a final buffer size that would exceed graphics memory > > must be pruned otherwise

Re: Rework TTMs busy handling

2024-01-16 Thread Zack Rusin
n fact the entire series looks good to me. For the series: Reviewed-by: Zack Rusin z

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

2024-01-10 Thread Zack Rusin
mwgfx: 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 Mombasawala Cc: Ian Forbes Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/vmwgfx/vmwgfx_exec

Re: BUG / design challenge: vmwgfx + PRIME handle free == clobbering errno

2024-01-09 Thread Zack Rusin
On Tue, Jan 9, 2024 at 11:06 AM Xaver Hugl wrote: > > Hi, > > KWin does use DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT. Can you point me to the code that implements it? Just wanted to take a quick look, because I didn't see the cursor on KDE 6 after fixing the kernel oops. > Tying the check to >

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

2024-01-09 Thread Zack Rusin
On Mon, Jan 8, 2024 at 4:57 PM Ian Forbes wrote: > > 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

Re: [PATCH 3/5] drm/ttm: replace busy placement with flags v5

2024-01-09 Thread Zack Rusin
t; if (res->placement & TTM_PL_FLAG_TEMPORARY) > return false; > > - for (i = 0; i < num_placement; i++) { > - const struct ttm_place *heap = [i]; > + for (i = 0; i < placement->num_placement; i++) { > + const struct ttm_place *place = >placement[i]; > + struct ttm_resource_manager *man; > > - if (!ttm_resource_compatible(bdev, res, heap, bo->base.size)) > + if (res->mem_type != place->mem_type) > + continue; > + > + man = ttm_manager_type(bdev, res->mem_type); > + if (man->func->compatible && > + !man->func->compatible(man, res, place, bo->base.size)) > continue; > > - if ((res->mem_type == heap->mem_type) && > - (!(heap->flags & TTM_PL_FLAG_CONTIGUOUS) || > + if ((!(place->flags & TTM_PL_FLAG_CONTIGUOUS) || > (res->placement & TTM_PL_FLAG_CONTIGUOUS))) > return true; > } > return false; > } > > -/** > - * ttm_resource_compat - check if resource is compatible with placement > - * > - * @res: the resource to check > - * @placement: the placement to check against > - * > - * Returns true if the placement is compatible. > - */ > -bool ttm_resource_compat(struct ttm_resource *res, > -struct ttm_placement *placement) > -{ > - if (ttm_resource_places_compat(res, placement->placement, > - placement->num_placement)) > - return true; > - > - if ((placement->busy_placement != placement->placement || > -placement->num_busy_placement > placement->num_placement) && > - ttm_resource_places_compat(res, placement->busy_placement, > - placement->num_busy_placement)) > - return true; > - > - return false; > -} > - > void ttm_resource_set_bo(struct ttm_resource *res, > struct ttm_buffer_object *bo) > { > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c > b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c > index 2bfac3aad7b7..7d7b33fcb5cf 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c > @@ -821,8 +821,6 @@ void vmw_bo_placement_set(struct vmw_bo *bo, u32 domain, > u32 busy_domain) > __func__, bo->tbo.resource->mem_type, > domain); > } > > - pl->busy_placement = bo->busy_places; > - pl->num_busy_placement = set_placement_list(bo->busy_places, > busy_domain); > } Sorry, one last thing. Could you add the exact same code you've added to nouveau_bo.c here or add a fixme mentioning that it should be done? With that, for the series: Reviewed-by: Zack Rusin z

Re: [PATCH v3] drm/ttm: Make sure the mapped tt pages are decrypted when needed

2024-01-05 Thread Zack Rusin
On Fri, Jan 5, 2024 at 8:51 AM Zack Rusin wrote: > > Some drivers require the mapped tt pages to be decrypted. In an ideal > world this would have been handled by the dma layer, but the TTM page > fault handling would have to be rewritten to able to do that. > > A side-effe

[PATCH v3] drm/ttm: Make sure the mapped tt pages are decrypted when needed

2024-01-05 Thread Zack Rusin
of TTM's page fault handling. Fixes vmwgfx with SEV enabled. v2: Explicitly include cc_platform.h v3: Use CC_ATTR_GUEST_MEM_ENCRYPT instead of CC_ATTR_MEM_ENCRYPT to limit the scope to guests and log when memory decryption is enabled. Signed-off-by: Zack Rusin Fixes: 3bf3710e3718 ("drm/ttm

Re: [PATCH 2/4] drm/ttm: replace busy placement with flags v4

2024-01-04 Thread Zack Rusin
On Thu, Jan 4, 2024 at 10:05 AM Christian König wrote: > > From: Somalapuram Amaranath > > Instead of a list of separate busy placement add flags which indicate > that a placement should only be used when there is room or if we need to > evict. > > v2: add missing TTM_PL_FLAG_IDLE for i915 > v3:

Re: [PATCH V2] drivers: gpu: drm: vmwgfx: fixed typos

2024-01-03 Thread Zack Rusin
On Fri, Dec 15, 2023 at 1:21 AM Randy Dunlap wrote: > > Hi-- > > On 12/14/23 22:01, Ghanshyam Agrawal wrote: > > Fixed multiple typos in vmwgfx_execbuf.c > > > > Signed-off-by: Ghanshyam Agrawal > > --- > > V2: > > Fixed some more typos suggested by codespell > > and the community. > > > > V1: >

Re: [PATCH] drm/vmwgfx: fix kernel-doc Excess struct member 'base'

2024-01-03 Thread Zack Rusin
Signed-off-by: Randy Dunlap > Reported-by: kernel test robot > Closes: > https://lore.kernel.org/oe-kbuild-all/202312150701.kni9lum3-...@intel.com/ > Cc: Kees Cook > Cc: Zack Rusin > Cc: VMware Graphics Reviewers > Cc: dri-devel@lists.freedesktop.org > Cc: Maarten La

Re: [PATCH] [v2] drm/vmwgfx: fix a memleak in vmw_gmrid_man_get_node

2024-01-03 Thread Zack Rusin
On Mon, Dec 4, 2023 at 4:15 AM Zhipeng Lu wrote: > > When ida_alloc_max fails, resources allocated before should be freed, > including *res allocated by kmalloc and ttm_resource_init. > > Fixes: d3bcb4b02fe9 ("drm/vmwgfx: switch the TTM backends to self alloc") > Signed-off-by: Zhipeng Lu > ---

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

2023-12-23 Thread Zack Rusin
0028 CR3: 000104006004 CR4: 0000003706f0 Signed-off-by: Zack Rusin Fixes: 485d98d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4") Reported-by: Stefan Hoffmeister Closes: https://gitlab.freedesktop.org/drm/misc/-/issues/34 Cc: Martin Krastev Cc: Maaz Mombasawal

[PATCH] MAINTAINERS: Change vmware.com addresses to broadcom.com

2023-12-23 Thread Zack Rusin
Update the email addresses for vmwgfx and vmmouse to reflect the fact that VMware is now part of Broadcom. Add a .mailmap entry because the vmware.com address will start bouncing soon. Signed-off-by: Zack Rusin Cc: Andrew Morton Cc: Ian Forbes Cc: Martin Krastev Cc: Maaz Mombasawala Cc

Re: BUG / design challenge: vmwgfx + PRIME handle free == clobbering errno

2023-12-22 Thread Zack Rusin
On Tue, Dec 19, 2023 at 11:15 AM Stefan Hoffmeister wrote: > > > Hi, > > vmwgfx implements drmPrimeFDToHandle in terms of the TTM resource manager. > > At the same time, the driver advertises > > .driver_features = > DRIVER_MODESET | DRIVER_RENDER | DRIVER_ATOMIC | DRIVER_GEM, > >

Re: [PATCH] drm/vmwgfx: Keep a gem reference to user bos in surfaces

2023-12-22 Thread Zack Rusin
On Thu, Dec 21, 2023 at 5:54 AM Sverdlin, Alexander wrote: > > Hi Zack, > > thank you for the patch! > > On Thu, 2023-09-28 at 00:13 -0400, Zack Rusin wrote: > > From: Zack Rusin > > > > Surfaces can be backed (i.e. stored in) memory objects (mob'

Re: [PATCH] drm/vmwgfx: fix all kernel-doc warnings in stdu

2023-12-18 Thread Zack Rusin
.c:895: warning: No description found for return value of > 'vmw_stdu_primary_plane_prepare_fb' > vmwgfx_stdu.c:1470: warning: No description found for return value of > 'vmw_stdu_init' > > Signed-off-by: Randy Dunlap > Reported-by: kernel test robot > Closes: > https://lore.

Re: [PATCH v3 0/5] drm: Allow the damage helpers to handle buffer damage

2023-11-19 Thread Zack Rusin
tation/gpu/todo.rst | 20 > drivers/gpu/drm/drm_damage_helper.c| 3 ++- > drivers/gpu/drm/drm_plane.c| 26 ++ > drivers/gpu/drm/virtio/virtgpu_plane.c | 10 ++ > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c| 11 +++ > include/drm/drm_plane.h| 8 > 6 files changed, 77 insertions(+), 1 deletion(-) > Looks good. Thanks. For the series: Reviewed-by: Zack Rusin z

Re: [PATCH v2 0/5] drm: Allow the damage helpers to handle buffer damage

2023-11-15 Thread Zack Rusin
On Wed, 2023-11-15 at 14:15 +0100, Javier Martinez Canillas wrote: > Hello, > > This series is to fix an issue that surfaced after damage clipping was > enabled for the virtio-gpu by commit 01f05940a9a7 ("drm/virtio: Enable > fb damage clips property for the primary plane"). > > After that change,

Re: [PATCH v2] drm/ttm: Make sure the mapped tt pages are decrypted when needed

2023-10-02 Thread Zack Rusin
On Mon, 2023-10-02 at 16:27 +0200, Thomas Hellström wrote: > !! External Email > > On Mon, 2023-10-02 at 10:16 +0200, Thomas Hellström wrote: > > Hi, Zack > > > > On 9/26/23 19:51, Zack Rusin wrote: > > > From: Zack Rusin > > > > > > So

[PATCH] drm/vmwgfx: Refactor drm connector probing for display modes

2023-09-27 Thread Zack Rusin
From: Martin Krastev Implement drm_connector_helper_funcs.mode_valid and .get_modes, replacing custom drm_connector_funcs.fill_modes code with drm_helper_probe_single_connector_modes; for STDU, LDU & SOU display units. Signed-off-by: Martin Krastev Reviewed-by: Zack Rusin Signed-off-by:

[PATCH] drm/vmwgfx: Keep a gem reference to user bos in surfaces

2023-09-27 Thread Zack Rusin
From: Zack Rusin Surfaces can be backed (i.e. stored in) memory objects (mob's) which are created and managed by the userspace as GEM buffers. Surfaces grab only a ttm reference which means that the gem object can be deleted underneath us, especially in cases where prime buffer export is used

[PATCH v2] drm/ttm: Make sure the mapped tt pages are decrypted when needed

2023-09-26 Thread Zack Rusin
From: Zack Rusin Some drivers require the mapped tt pages to be decrypted. In an ideal world this would have been handled by the dma layer, but the TTM page fault handling would have to be rewritten to able to do that. A side-effect of the TTM page fault handling is using a dma allocation per

[PATCH] drm/ttm: Make sure the mapped tt pages are decrypted when needed

2023-09-25 Thread Zack Rusin
From: Zack Rusin Some drivers require the mapped tt pages to be decrypted. In an ideal world this would have been handled by the dma layer, but the TTM page fault handling would have to be rewritten to able to do that. A side-effect of the TTM page fault handling is using a dma allocation per

Re: [PATCH 8/9] drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by

2023-09-22 Thread Zack Rusin
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct vmw_surface_dirty. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Zack Ru

Re: Decrypting tt maps in ttm

2023-09-20 Thread Zack Rusin
On Wed, 2023-09-20 at 21:22 +0200, Thomas Hellström wrote: > !! External Email > > On 9/20/23 20:24, Zack Rusin wrote: > > On Wed, 2023-09-20 at 19:17 +0200, Thomas Hellström wrote: > > > !! External Email > > > > > > Hi, Zack > > > > > >

Re: Decrypting tt maps in ttm

2023-09-20 Thread Zack Rusin
On Wed, 2023-09-20 at 19:17 +0200, Thomas Hellström wrote: > !! External Email > > Hi, Zack > > On 9/20/23 18:39, Zack Rusin wrote: > > On Wed, 2023-09-20 at 12:48 +0200, Christian König wrote: > > > !! External Email > > > > > > Am 20.09.23 um

Re: Decrypting tt maps in ttm

2023-09-20 Thread Zack Rusin
On Wed, 2023-09-20 at 12:48 +0200, Christian König wrote: > !! External Email > > Am 20.09.23 um 09:36 schrieb Thomas Hellström: > > Hi, Zack, > > > > On 9/20/23 05:43, Zack Rusin wrote: > > > On Tue, 2023-09-19 at 09:47 +0200, Christian König wrote: > >

Re: Decrypting tt maps in ttm

2023-09-19 Thread Zack Rusin
On Tue, 2023-09-19 at 09:47 +0200, Christian König wrote: > !! External Email > > Am 19.09.23 um 08:56 schrieb Thomas Hellström: > > > > On 9/19/23 07:39, Christian König wrote: > > > Am 19.09.23 um 03:26 schrieb Zack Rusin: > > > > On Mon, 202

Re: Decrypting tt maps in ttm

2023-09-18 Thread Zack Rusin
On Mon, 2023-09-18 at 16:21 -0400, Alex Deucher wrote: > !! External Email > > On Mon, Sep 18, 2023 at 3:06 PM Thomas Hellström > wrote: > > > > > > On 9/18/23 17:52, Zack Rusin wrote: > > > On Mon, 2023-09-18 at 17:13 +0200, Thomas Hellström wrote: >

Re: [PATCH v2 0/5] Introduce new wrappers to copy user-arrays

2023-09-11 Thread Zack Rusin
   |  2 +- >  5 files changed, 46 insertions(+), 6 deletions(-) > Series, and in particular the vmwgfx changes, look good to me. Reviewed-by: Zack Rusin

Re: [PATCH] drm: Rename drm_ioctl_flags() to eliminate duplicate declaration warning

2023-09-06 Thread Zack Rusin
On Thu, 2023-09-07 at 00:45 +0800, Juntong Deng wrote: > There are 'enum drm_ioctl_flags' and 'bool drm_ioctl_flags(...)' with the > same name, which is not a problem in C, but it can lead to > 'WARNING: Duplicate C declaration' when generating documentation. > > According to the purpose of the

Re: [PATCH] drm/vmwgfx: fix typo of sizeof argument

2023-09-05 Thread Zack Rusin
->size + sizeof(*header)); > SVGA3dTextureState *cur_state = (SVGA3dTextureState *) > ((unsigned long) header + sizeof(*cmd)); > struct vmw_resource *ctx; Hah, yea, that's an old one. Thanks! I can push it through the drm-misc tree. Reviewed-by: Zack Rusin z

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

2023-08-17 Thread Zack Rusin
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 very old userspace would be exercising those paths but it wouldn't be hard to hit on old distros with brand new kernels

Re: [PATCH v5 9/9] drm: Introduce documentation for hotspot properties

2023-07-20 Thread Zack Rusin
On Thu, 2023-07-20 at 09:07 +, Simon Ser wrote: > !! External Email > > On Thursday, July 20th, 2023 at 10:50, Javier Martinez Canillas > wrote: > > > > On Thursday, July 20th, 2023 at 07:03, Zack Rusin za...@vmware.com wrote: > > > > > > > I'll

Re: [PATCH v5 9/9] drm: Introduce documentation for hotspot properties

2023-07-19 Thread Zack Rusin
On Wed, 2023-07-19 at 11:15 +0300, Pekka Paalanen wrote: > On Tue, 18 Jul 2023 21:42:18 -0400 > Zack Rusin wrote: > > > From: Michael Banack > > > > To clarify the intent and reasoning behind the hotspot properties > > introduce userspace documentati

[PATCH v5 9/9] drm: Introduce documentation for hotspot properties

2023-07-18 Thread Zack Rusin
to all. Signed-off-by: Zack Rusin --- Documentation/gpu/drm-kms.rst | 6 drivers/gpu/drm/drm_plane.c | 58 ++- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst index c92d425cb2dd

[PATCH v5 8/9] drm: Introduce DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT

2023-07-18 Thread Zack Rusin
From: Zack Rusin Virtualized drivers place additional restrictions on the cursor plane which breaks the contract of universal planes. To allow atomic modesettings with virtualized drivers the clients need to advertise that they're capable of dealing with those extra restrictions. To do

[PATCH v5 4/9] drm/qxl: Use the hotspot properties from cursor planes

2023-07-18 Thread Zack Rusin
From: Zack Rusin Atomic modesetting got support for mouse hotspots via the hotspot properties. Port the legacy kms hotspot handling to the new properties on cursor planes. Signed-off-by: Zack Rusin Reviewed-by: Gerd Hoffmann Cc: Dave Airlie Cc: Daniel Vetter Cc: virtualizat...@lists.linux

[PATCH v5 5/9] drm/vboxvideo: Use the hotspot properties from cursor planes

2023-07-18 Thread Zack Rusin
From: Zack Rusin Atomic modesetting got support for mouse hotspots via the hotspot properties. Port the legacy kms hotspot handling to the new properties on cursor planes. Signed-off-by: Zack Rusin Cc: Hans de Goede Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Javier Martinez Canillas

[PATCH v5 2/9] drm/atomic: Add support for mouse hotspots

2023-07-18 Thread Zack Rusin
From: Zack Rusin Atomic modesetting code lacked support for specifying mouse cursor hotspots. The legacy kms DRM_IOCTL_MODE_CURSOR2 had support for setting the hotspot but the functionality was not implemented in the new atomic paths. Due to the lack of hotspots in the atomic paths userspace

[PATCH v5 7/9] drm: Remove legacy cursor hotspot code

2023-07-18 Thread Zack Rusin
From: Zack Rusin Atomic modesetting supports mouse cursor offsets via the hotspot properties that are created on cursor planes. All drivers which support hotspots are atomic and the legacy code has been implemented in terms of the atomic properties as well. Due to the above the lagacy cursor

[PATCH v5 3/9] drm/vmwgfx: Use the hotspot properties from cursor planes

2023-07-18 Thread Zack Rusin
From: Zack Rusin Atomic modesetting got support for mouse hotspots via the hotspot properties. Port the legacy kms hotspot handling to the new properties on cursor planes. Signed-off-by: Zack Rusin Cc: Maaz Mombasawala Reviewed-by: Javier Martinez Canillas Reviewed-by: Martin Krastev

[PATCH v5 6/9] drm/virtio: Use the hotspot properties from cursor planes

2023-07-18 Thread Zack Rusin
From: Zack Rusin Atomic modesetting got support for mouse hotspots via the hotspot properties. Port the legacy kms hotspot handling to the new properties on cursor planes. Signed-off-by: Zack Rusin Reviewed-by: Gerd Hoffmann Cc: David Airlie Cc: Gurchetan Singh Cc: Chia-I Wu Cc: Daniel

[PATCH v5 1/9] drm: Disable the cursor plane on atomic contexts with virtualized drivers

2023-07-18 Thread Zack Rusin
From: Zack Rusin Cursor planes on virtualized drivers have special meaning and require that the clients handle them in specific ways, e.g. the cursor plane should react to the mouse movement the way a mouse cursor would be expected to and the client is required to set hotspot properties

[PATCH v5 0/9] Fix cursor planes with virtualized drivers

2023-07-18 Thread Zack Rusin
From: Zack Rusin v5: Add a change with documentation from Michael, based on his discussion with Pekka and bump the kernel version DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT might be introduced with to 6.6. v4: Make drm_plane_create_hotspot_properties static, rename

Re: [PATCH v4 2/8] drm/atomic: Add support for mouse hotspots

2023-06-28 Thread Zack Rusin
On Wed, 2023-06-28 at 10:54 +0300, Pekka Paalanen wrote: > On Wed, 28 Jun 2023 10:41:06 +0300 > Pekka Paalanen wrote: > > > On Wed, 28 Jun 2023 01:21:27 -0400 > > Zack Rusin wrote: > > > > > From: Zack Rusin > > > > > > Atomic modes

Re: [PATCH v4 2/8] drm/atomic: Add support for mouse hotspots

2023-06-28 Thread Zack Rusin
On Wed, 2023-06-28 at 14:15 +, Simon Ser wrote: > I think we should drop the CRTC_X/CRTC_Y properties for hotspot-aware cursor > planes. > The drivers aren't going to do anything with these, and exposing them to user- > space > makes it sound like user-space controls the position of the plane,

[PATCH v4 8/8] drm: Introduce DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT

2023-06-27 Thread Zack Rusin
From: Zack Rusin Virtualized drivers place additional restrictions on the cursor plane which breaks the contract of universal planes. To allow atomic modesettings with virtualized drivers the clients need to advertise that they're capable of dealing with those extra restrictions. To do

[PATCH v4 4/8] drm/qxl: Use the hotspot properties from cursor planes

2023-06-27 Thread Zack Rusin
From: Zack Rusin Atomic modesetting got support for mouse hotspots via the hotspot properties. Port the legacy kms hotspot handling to the new properties on cursor planes. Signed-off-by: Zack Rusin Reviewed-by: Gerd Hoffmann Cc: Dave Airlie Cc: Daniel Vetter Cc: virtualizat...@lists.linux

[PATCH v4 3/8] drm/vmwgfx: Use the hotspot properties from cursor planes

2023-06-27 Thread Zack Rusin
From: Zack Rusin Atomic modesetting got support for mouse hotspots via the hotspot properties. Port the legacy kms hotspot handling to the new properties on cursor planes. Signed-off-by: Zack Rusin Cc: Maaz Mombasawala Reviewed-by: Javier Martinez Canillas Reviewed-by: Martin Krastev

[PATCH v4 7/8] drm: Remove legacy cursor hotspot code

2023-06-27 Thread Zack Rusin
From: Zack Rusin Atomic modesetting supports mouse cursor offsets via the hotspot properties that are created on cursor planes. All drivers which support hotspots are atomic and the legacy code has been implemented in terms of the atomic properties as well. Due to the above the lagacy cursor

[PATCH v4 2/8] drm/atomic: Add support for mouse hotspots

2023-06-27 Thread Zack Rusin
From: Zack Rusin Atomic modesetting code lacked support for specifying mouse cursor hotspots. The legacy kms DRM_IOCTL_MODE_CURSOR2 had support for setting the hotspot but the functionality was not implemented in the new atomic paths. Due to the lack of hotspots in the atomic paths userspace

  1   2   3   4   5   6   >