Re: [PATCH 1/4] drm/vmwgfx: Add support for CursorMob and CursorBypass 4

2021-07-22 Thread Zack Rusin
On 7/14/21 3:30 AM, Thomas Zimmermann wrote: @@ -301,8 +301,12 @@ static void vmw_print_capabilities2(uint32_t capabilities2)   DRM_INFO("  Grow oTable.\n"); These macros have been out of fashion for a while. There's drm_info(), drm_warn(), drm_err(), etc as replacements. They also pri

Re: [PATCH 3/3] drm/vmwgfx: fix potential UAF in vmwgfx_surface.c

2021-07-22 Thread Zack Rusin
and vmw_gb_surface_define_internal. This is fixed by replacing drm_master_get with drm_file_get_master. Signed-off-by: Desmond Cheong Zhi Xi Reviewed-by: Zack Rusin Thanks for taking the time to fix this. Apart from the clear logic error, do you happen to know under what circumstances would this be hit?

[PATCH v2 4/4] drm/vmwgfx: Use 2.19 version number to recognize mks-stats ioctls

2021-07-23 Thread Zack Rusin
To let the userspace recognize that it's running on top of a vmwgfx that supports mks-stat ioctls we need to bump the version number. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Neha Bhende --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 6 +++--- 1 file changed, 3 inser

[PATCH v2 1/4] drm/vmwgfx: Switch to using DRM_IOCTL_DEF_DRV

2021-07-23 Thread Zack Rusin
ined ioctl name and removes duplicated code. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 176 +--- 1 file changed, 84 insertions(+), 92 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwg

[PATCH v2 2/4] drm/vmwgfx: Cleanup logging

2021-07-23 Thread Zack Rusin
he platform the guest was running in. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev --- drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c| 3 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 3 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c| 224 +++-- drivers/gpu/drm/vmwgfx/vmwgfx

[PATCH v2 3/4] drm/vmwgfx: Be a lot more flexible with MOB limits

2021-07-23 Thread Zack Rusin
RAM. With the addition of some extra logging this should make the "guest has been configured with not enough graphics memory" errors a lot easier to diagnose in cases where the automatic expansion of MOB space fails. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev --- drivers/gp

[PATCH] drm/vmwgfx: Remove the deprecated lower mem limit

2021-07-23 Thread Zack Rusin
TTM during the transition to the new page allocator lost the ability to constrain the allocations via the lower_mem_limit. The code has been unused since the change: 256dd44bd897 ("drm/ttm: nuke old page allocator") and there's no reason to keep it. Signed-off-by: Zack Rusin ---

Re: [PATCH 6/8] drm/vmwgfx: Inline ttm_bo_mmap() into vmwgfx driver

2021-04-07 Thread Zack Rusin
ot a big deal and I know it's been in the original, but since you're already in there if you could change this to DRM_ERR that'd be great. Either way: Reviewed-by: Zack Rusin z ___ dri-devel mailing list dri-devel@lists.freedesktop.o

Re: [PATCH 7/8] drm/vmwgfx: Inline vmw_verify_access()

2021-04-07 Thread Zack Rusin
et = -EPERM; - goto out_unref; - } - ret = bo->bdev->funcs->verify_access(bo, filp); + ret = vmw_user_bo_verify_access(bo, tfile); if (unlikely(ret != 0)) goto out_unref; Looks great. Reviewed-by: Zack Rusin z __

[PATCH 1/2] drm/vmwgfx: Fix the lockdep breakage

2021-04-08 Thread Zack Rusin
Krastev Reviewed-by: Roland Scheidegger Cc: Tetsuo Handa Cc: dri-devel@lists.freedesktop.org Signed-off-by: Zack Rusin Fixes: 8772c0bb58bbf98a ("drm/vmwgfx: Cleanup pci resource allocation") --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 17 - drivers/gpu/drm/vmwgfx/vmwgfx_

[PATCH 2/2] drm/vmwgfx: Make sure unpinning handles reservations

2021-04-08 Thread Zack Rusin
d buffers") Cc: dri-devel@lists.freedesktop.org Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 17 - drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 8 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drive

[PATCH v2] drm/vmwgfx: Make sure unpinning handles reservations

2021-04-10 Thread Zack Rusin
d buffers") Cc: dri-devel@lists.freedesktop.org Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 11 +++ drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 18 ++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_d

Re: [PATCH 2/2] drm/vmwgfx: Make sure unpinning handles reservations

2021-04-10 Thread Zack Rusin
On 4/9/21 3:40 AM, Daniel Vetter wrote: On Thu, Apr 08, 2021 at 01:22:45PM -0400, Zack Rusin wrote: Quite often it's a little hard to tell if reservations are already held in code paths that unpin bo's. While our pinning/unpinning code should be more explicit that requires a substent

Re: [PATCH 2/2] drm/vmwgfx: Make sure unpinning handles reservations

2021-04-10 Thread Zack Rusin
On 4/9/21 3:38 AM, Thomas Hellström (Intel) wrote: Hi, Zack, On 4/8/21 7:22 PM, Zack Rusin wrote: Quite often it's a little hard to tell if reservations are already held in code paths that unpin bo's. While our pinning/unpinning code should be more explicit that requires a substent

[PATCH v3] drm/vmwgfx: Make sure bo's are unpinned before putting them back

2021-04-13 Thread Zack Rusin
nned so we just have to make sure we unpin them before releasing them. Cc: Martin Krastev Cc: Roland Scheidegger Fixes: d1a73c641afd ("drm/vmwgfx: Make sure we unpin no longer needed buffers") Cc: dri-devel@lists.freedesktop.org Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/v

Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION

2021-04-15 Thread Zack Rusin
asonable than the current setup. I'll try it out on Monday just in case, but for now: Reviewed-by: Zack Rusin z ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION

2021-04-15 Thread Zack Rusin
On 4/15/21 2:49 PM, Daniel Vetter wrote: On Thu, Apr 15, 2021 at 8:21 PM Zack Rusin wrote: On 4/15/21 7:00 AM, Thomas Zimmermann wrote: Respect DRM's kconfig setting for fbdev console emulation. If enabled, it will select all required config options. So remove them from vmwgfx's Kc

Re: [git pull] drm/vmwgfx fixes for 5.12-rc8

2021-04-21 Thread Zack Rusin
On 4/17/21 7:02 PM, Dave Airlie wrote: Hi Zack, Please make sure to always cc dri-devel and/or Daniel on these so if I'm away they don't get lost, but also so that they make it into patchwork for processing. If you have a chance can you resend it, I'll see if we can process this out of band and

Re: [PATCH] drm/ttm: remove special handling for non GEM drivers

2021-04-22 Thread Zack Rusin
On 4/22/21 7:59 AM, Christian König wrote: Zack or Roland any objections to this? There shouldn't be any functional change. Sorry, that looks good. I wanted us to add gem support for a while now, this just adds more reasons to do it for next merge window. Reviewed-by: Zack

Re: [PATCH] drm/ttm: fix error handling if no BO can be swapped out v4

2021-04-22 Thread Zack Rusin
bdev; - int ret = -EBUSY; + int ret = 0; Looks good to me. Updating the comment above that function to note it returns either tge number of pages swapped out or an error might be a good idea because it's not obvious from the name. Reviewed-by: Z

Re: vmwgfx leaking bo pins?

2021-03-15 Thread Zack Rusin
On 3/12/21 5:06 AM, Thomas Hellström (Intel) wrote: On 3/12/21 12:02 AM, Zack Rusin wrote: On Mar 11, 2021, at 17:35, Thomas Hellström (Intel) wrote: Hi, Zack On 3/11/21 10:07 PM, Zack Rusin wrote: On Mar 11, 2021, at 05:46, Thomas Hellström (Intel) wrote: Hi, I tried latest drm

Re: vmwgfx leaking bo pins?

2021-03-16 Thread Zack Rusin
On 3/15/21 6:35 PM, Thomas Hellström (Intel) wrote: On 3/15/21 9:38 PM, Daniel Vetter wrote: On Mon, Mar 15, 2021 at 6:57 PM Zack Rusin wrote: On 3/12/21 5:06 AM, Thomas Hellström (Intel) wrote: On 3/12/21 12:02 AM, Zack Rusin wrote: On Mar 11, 2021, at 17:35, Thomas Hellström (Intel

Re: [PATCH] drm/vmwgfx: fix spinlock initialization in vmw_driver_load()

2021-03-21 Thread Zack Rusin
> On Mar 21, 2021, at 10:56, Tetsuo Handa > wrote: > > Since vmw_write() from vmw_detect_version() from vmw_driver_load() calls > spin_lock(&dev_priv->hw_lock), spin_lock_init(&dev_priv->hw_lock) has to > be called before vmw_detect_version() is called, or lockdep gets disabled. > > INFO: tr

Re: [PATCH] drm/vmwgfx: Fix a typo

2021-03-21 Thread Zack Rusin
on my next series. Unless of course you want to push it through a different tree in which case: Reviewed-by: Zack Rusin z ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 1/3] drm/vmwgfx: Drop svga_lock

2021-01-14 Thread Zack Rusin
Looks good. Thanks! Reviewed-by: Zack Rusin > On Jan 12, 2021, at 03:49, Daniel Vetter wrote: > > Hi Roland, > > Hopefully you had a nice start into the new year! Ping for some > review/testing on this series. > > Thanks, Daniel > > On Fri, Dec 11, 2020 a

Re: [PATCH 00/40] [Set 14] Rid W=1 warnings from GPU

2021-01-15 Thread Zack Rusin
r all the vmwgfx bits: Reviewed-by: Zack Rusin z ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 00/29] [Set 15] Finally rid W=1 warnings from GPU!

2021-01-15 Thread Zack Rusin
x86. Thanks! For all the vmwgfx bits: Reviewed-by: Zack Rusin z ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v4 5/6] drm/vmwgfx: Remove reference to struct drm_device.pdev

2021-01-18 Thread Zack Rusin
x: Switch to a managed drm device") > Cc: Zack Rusin > Cc: Martin Krastev > Cc: Roland Scheidegger > Cc: VMware Graphics > Cc: dri-devel@lists.freedesktop.org > --- > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/dr

Re: [PATCH 00/29] [Set 15] Finally rid W=1 warnings from GPU!

2021-01-19 Thread Zack Rusin
> On Jan 19, 2021, at 03:29, Lee Jones wrote: > > On Mon, 18 Jan 2021, Daniel Vetter wrote: > >> On Mon, Jan 18, 2021 at 03:09:45PM +, Lee Jones wrote: >>> On Mon, 18 Jan 2021, Daniel Vetter wrote: >>> >>>> On Fri, Jan 15, 2021 at 06:27:15

[PATCH] drm/vmwgfx: Make sure we unpin no longer needed buffers

2021-01-19 Thread Zack Rusin
e but 57fcd550eb15bce14a7154736379dfd4ed60ae81 introduced a WARN_ON which was filling up the kernel logs rather quickly. Quite frankly internal usage of vmw_buffer_object and in general pinning needs to be refactored in vmwgfx but for now this makes it work. Signed-off-by: Zack Rusin Reviewed-by: Martin Kr

Re: [PATCH] drm/vmwgfx/vmwgfx_drv: Fix an error path in vmw_setup_pci_resources()

2021-01-25 Thread Zack Rusin
/vmwgfx: Cleanup fifo mmio handling") > Signed-off-by: Dan Carpenter Thanks, Dan. I have a patch based on your report that fixes that too but it comes with a refactoring. I’d be happy to rebase it on top of yours just to get yours in before. If you’d like I can push your patch through drm-mis

[PATCH] drm/vmwgfx: Fix some memory leaks on errors

2021-01-28 Thread Zack Rusin
x: Cleanup pci resource allocation") Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Roland Scheidegger Reported-by: kernel test robot Reported-by: Dan Carpenter --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff

Re: [PATCH 2/3] drm/ttm: move memory accounting into vmwgfx v3

2021-02-02 Thread Zack Rusin
Looks good. There’s probably not much reason to call it ttm_memory anymore as it only deals with ttm_mem_glob, we’ll likely fold it in after you submit. Thanks. Reviewed-by: Zack Rusin z > On Feb 2, 2021, at 08:04, Christian König wrote: > > Ping? > > Especially Roland

Re: [PATCH 2/3] drm/ttm: move memory accounting into vmwgfx v3

2021-02-02 Thread Zack Rusin
:16, Christian König wrote: > > Hi Zack, > > can you also give it a quick smoke test? > > I'm not sure if I wired up all the sysfs magic correctly inside vmwgfx, but I > currently don't have a setup where I can test this. > > Thanks, > Christian. > > Am 02

Re: [Linux-graphics-maintainer] [PATCH 2/3] drm/ttm: move memory accounting into vmwgfx v3

2021-02-02 Thread Zack Rusin
21, at 12:42, Zack Rusin wrote: > > Ah, yes, sorry, I missed that. I just double checked and it fails with: > > kobject_add_internal failed for memory_accounting (error: -2 parent: card0) > > which breaks the probe and the driver won’t load. I won’t have time to look > into

Re: [Linux-graphics-maintainer] [PATCH 2/3] drm/ttm: move memory accounting into vmwgfx v3

2021-02-08 Thread Zack Rusin
> On Feb 8, 2021, at 08:35, Christian König wrote: > > Hi Zack, > > ok we figured out how to do this correctly. > > Basically using the pdev->kobj instead of the drm->primary->kdev->kobj > pointer worked quite well. > > I've just send the latest patches to the mailing list. If you don't have

Re: [Linux-graphics-maintainer] [PATCH 2/3] drm/ttm: move memory accounting into vmwgfx v3

2021-02-08 Thread Zack Rusin
> On Feb 8, 2021, at 15:23, Christian König wrote: > > Am 08.02.21 um 21:21 schrieb Zack Rusin: >>> On Feb 8, 2021, at 08:35, Christian König wrote: >>> >>> Hi Zack, >>> >>> ok we figured out how to do this correctly. >>> >&

[PATCH 1/2] drm/vmwgfx: Correctly set the name of the preferred mode

2021-02-09 Thread Zack Rusin
on). This allows one to quickly validate the modes set by the open-vm-tools. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/dr

[PATCH 2/2] drm/vmwgfx: Remove pointless code

2021-02-09 Thread Zack Rusin
There's no need to check for the presence of the hotplug property just to return because this is the end of the function so we're returning either way. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |

[PATCH] drm/vmwgfx: Bump the patch level version and cleanup logging

2021-02-24 Thread Zack Rusin
We should advertise the reworked fifo/cmd handling and huge pages support. Also while bumping the version number lets cleanup the logging, there's no point in logging whether we're atomic (we always are) or what repo we use (it's always in kernel now). Signed-off-by: Zack Rus

Re: [RFC PATCH] drm/vkms: Add support for virtual hardware mode

2021-02-25 Thread Zack Rusin
On 2/25/21 4:09 AM, Daniel Vetter wrote: On Wed, Feb 24, 2021 at 11:55 AM Sumera Priyadarsini wrote: Add a virtual hardware or vblank-less mode as a module to enable VKMS to emulate virtual graphic drivers. This mode can be enabled by setting enable_virtual_hw=1 at the time of loading VKMS. A

Re: [patch 2/7] drm/vmgfx: Replace kmap_atomic()

2021-03-04 Thread Zack Rusin
usage with the given pgprot. > > Remove the NULL pointer check for the map. These functions return a valid > address for valid pages and the return was bogus anyway as it would have > left preemption and pagefaults disabled. > > Signed-off-by: Thomas Gleixner > Cc: VMware Grap

[PATCH 1/2] locking/rwsem: Add down_write_interruptible

2021-03-08 Thread Zack Rusin
Add an interruptible version of down_write. It's the other side of the already implemented down_read_interruptible. It allows drivers which used custom locking code to support interruptible rw semaphores to switch over to rwsem. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Will Deacon Cc: linux-ker..

[PATCH 2/2] drm/vmwgfx: Remove custom locking code

2021-03-08 Thread Zack Rusin
vmwgfx used a custom locking code to support semantics of a interruptible rwsem. Now with down_(read|write)_interruptible implemented in the rwsem we can completely remove the custom locking code. It also allows us to remove the hacks we needed to support proper waits for write resources before hib

[PATCH 0/2] locking/rwsem: Add down_write_interruptible and use it

2021-03-08 Thread Zack Rusin
Zijlstra Cc: Ingo Molnar Cc: Will Deacon Cc: Martin Krastev Cc: Roland Scheidegger Cc: linux-ker...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Zack Rusin (2): locking/rwsem: Add down_write_interruptible drm/vmwgfx: Remove custom locking code drivers/gpu/drm/vmwgfx/Makefile

Re: [PATCH 1/2] locking/rwsem: Add down_write_interruptible

2021-03-09 Thread Zack Rusin
On 3/9/21 3:49 AM, Peter Zijlstra wrote: On Mon, Mar 08, 2021 at 03:54:55PM -0500, Zack Rusin wrote: Add an interruptible version of down_write. It's the other side of the already implemented down_read_interruptible. It allows drivers which used custom locking code to support interruptib

Re: vmwgfx leaking bo pins?

2021-03-11 Thread Zack Rusin
> On Mar 11, 2021, at 05:46, Thomas Hellström (Intel) > wrote: > > Hi, > > I tried latest drm-fixes today and saw a lot of these: Fallout from ttm > rework? Yes, I fixed this in d1a73c641afd2617bd80bce8b71a096fc5b74b7e it was in drm-misc-next in the drm-misc tree for a while but hasn’t been

Re: vmwgfx leaking bo pins?

2021-03-11 Thread Zack Rusin
> On Mar 11, 2021, at 17:35, Thomas Hellström (Intel) > wrote: > > Hi, Zack > > On 3/11/21 10:07 PM, Zack Rusin wrote: >>> On Mar 11, 2021, at 05:46, Thomas Hellström (Intel) >>> wrote: >>> >>> Hi, >>> >>>

[PATCH 2/6] drm/vmwgfx: Mark a surface gpu-dirty after the SVGA3dCmdDXGenMips command

2021-05-04 Thread Zack Rusin
command has been submitted. This fixes the piglit getteximage-formats test run with SVGA_FORCE_COHERENT=1 Fixes: a9f58c456e9d ("drm/vmwgfx: Be more restrictive when dirtying resource") Signed-off-by: Thomas Hellstrom Reviewed-by: Charmaine Lee Reviewed-by: Roland Scheidegger Signed-of

[PATCH 4/6] drm/vmwgfx: Remove the reservation semaphore

2021-05-04 Thread Zack Rusin
igned-off-by: Zack Rusin Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx/Makefile | 2 +- drivers/gpu/drm/vmwgfx/ttm_lock.c | 194 drivers/gpu/drm/vmwgfx/ttm_lock.h | 218 -- drivers/gpu/drm/vmwgfx/vmwgfx

[PATCH 1/6] drm/vmwgfx: Fix incorrect enum usage

2021-05-04 Thread Zack Rusin
incorrect. Lets use the correct enum when setting SVGA_REG_ENABLE. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx

[PATCH 5/6] drm/vmwgfx: Add basic support for SVGA3

2021-05-04 Thread Zack Rusin
rking. Signed-off-by: Zack Rusin Cc: Martin Krastev Reviewed-by: Roland Scheidegger --- .../gpu/drm/vmwgfx/device_include/svga_reg.h | 55 ++- drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 114 +++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 136 ++ driver

[PATCH 0/6] drm/vmwgfx: SVGA v3 and arm64 support

2021-05-04 Thread Zack Rusin
able there. Thomas Hellstrom (2): drm/vmwgfx: Mark a surface gpu-dirty after the SVGA3dCmdDXGenMips command drm/vmwgfx: Fix cpu updates of coherent multisample surfaces Zack Rusin (4): drm/vmwgfx: Fix incorrect enum usage drm/vmwgfx: Remove the reservation semaphore drm/vmwgfx: Add basic s

[PATCH 3/6] drm/vmwgfx: Fix cpu updates of coherent multisample surfaces

2021-05-04 Thread Zack Rusin
Fixes: 9ca7d19ff8ba ("drm/vmwgfx: Add surface dirty-tracking callbacks") Signed-off-by: Thomas Hellstrom Reviewed-by: Charmaine Lee Reviewed-by: Roland Scheidegger Signed-off-by: Zack Rusin --- .../drm/vmwgfx/device_include/svga3d_surfacedefs.h | 8 ++-- drivers/gpu/

[PATCH 6/6] drm/vmwgfx: Port vmwgfx to arm64

2021-05-04 Thread Zack Rusin
e. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx/Kconfig| 3 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 9 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 31 ++- drivers/gpu/

[PATCH 5/6] drm/vmwgfx: Add basic support for SVGA3

2021-05-05 Thread Zack Rusin
rking. v2: Fixes all the static analyzer warnings Signed-off-by: Zack Rusin Cc: Martin Krastev Reviewed-by: Roland Scheidegger --- .../gpu/drm/vmwgfx/device_include/svga_reg.h | 55 ++- drivers/gpu/drm/vmwgfx/vmwgfx_binding.c | 8 +- drivers/gpu/drm/vmwgfx/vmwgfx_blit.c

Re: [PATCH][V2][next] drm/vmwgfx: Fix memory allocation check and a leak of object fifo

2021-05-14 Thread Zack Rusin
On 5/14/21 10:49 AM, Colin King wrote: From: Colin Ian King The allocation of fifo is lacking an allocation failure check, so fix this by adding one. In the case where fifo->static_buffer fails to be allocated the error return path neglects to kfree the fifo object. Fix this by adding in the m

Re: [PATCH -next] drm/vmwgfx: Fix return value check in vmw_setup_pci_resources()

2021-05-14 Thread Zack Rusin
On 5/14/21 4:28 AM, Qiheng Lin wrote: In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. After that, the error code -ENOMEM should be returned. Reported-by: Hulk Robot Signed-off-by: Q

Re: [PATCH 4/7] drm/vmwgfx: switch to ttm_sg_tt_init

2020-11-30 Thread Zack Rusin
hed); A little bit more info would be much appreciated, it’s hard to tell from the message log what’s going on. Is the assumption that since vmwgfx doesn’t support dmabuf it will never use ttm_bo_type_sg or TTM_PAGE_FLAG_SG and ttm_sg_tt_init will

Re: [PATCH 14/15] drm/vmwgfx: Remove references to struct drm_device.pdev

2020-11-30 Thread Zack Rusin
vmwgfx/vmwgfx_cmdbuf.c | 8 > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c| 27 +- > drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 2 +- Reviewed-by: Zack Rusin z ___ dri-devel mailing list dri-devel@lists.freedesktop.org http

[PATCH 2/8] drm/vmwgfx: Remove stealth mode

2020-12-01 Thread Zack Rusin
akes our code a lot cleaner. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 31 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 5 - 2 files changed, 10 insertions(+), 26 deletions(-

[PATCH 6/8] drm/vmwgfx: Remove the throttling code

2020-12-01 Thread Zack Rusin
Throttling was used before fencing to implement early vsync support in the xorg state tracker a long time ago. The xorg state tracker has been removed years ago and no one else has ever used throttling. It's time to remove this code, it hasn't been used or tested in years. Signed-of

[PATCH 1/8] drm/vmwgfx: add Zack Rusin as maintainer

2020-12-01 Thread Zack Rusin
From: Roland Scheidegger Reviewed-by: Zack Rusin Signed-off-by: Roland Scheidegger Signed-off-by: Zack Rusin --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2daa6ee673f7..55e3e2ef5f18 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5712,6

[PATCH 5/8] drm/vmwgfx: Cleanup pci resource allocation

2020-12-01 Thread Zack Rusin
Instead of doing it in multiple spots lets centralize the code to handle pci resources. This also cleans up the error handling a bit and will make it a lot easier to add additional svga versions to the driver. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Roland Scheidegger

[PATCH 8/8] drm/vmwgfx: Fix display register usage for some older configs

2020-12-01 Thread Zack Rusin
We can't be setting the display_id register to an invalid value because that makes our device reset the fb which causes nasty flicker (due to destruction and creation of a new fb). Also we can't be using the BITS_PER_PIXEL register if the 8BIT_EMULATION is not supported. Signed-off-by:

[PATCH 4/8] drm/vmwgfx: Cleanup fifo mmio handling

2020-12-01 Thread Zack Rusin
. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 29 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 31 +- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 24 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 83

[PATCH 3/8] drm/vmwgfx: Switch to a managed drm device

2020-12-01 Thread Zack Rusin
To cleanup some of the error handling and prepare for some other work lets switch to a managed drm device. It will let us get a better handle on some of the error paths. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx

[PATCH 7/8] drm/vmwgfx: Cleanup the cmd/fifo split

2020-12-01 Thread Zack Rusin
mmand buffers) as _cmd_ and functions which operate on the MMIO based commands as FIFO to match the SVGA device naming. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev --- drivers/gpu/drm/vmwgfx/Makefile | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_binding.c

[PATCH v2 3/8] drm/vmwgfx: Switch to a managed drm device

2020-12-01 Thread Zack Rusin
To cleanup some of the error handling and prepare for some other work lets switch to a managed drm device. It will let us get a better handle on some of the error paths. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Roland Scheidegger --- drivers/gpu/drm/vmwgfx

Re: [PATCH 14/15] drm/vmwgfx: Remove references to struct drm_device.pdev

2020-12-02 Thread Zack Rusin
> On Dec 2, 2020, at 09:27, Thomas Zimmermann wrote: > > Hi > > Am 02.12.20 um 09:01 schrieb Thomas Zimmermann: >> Hi >> Am 30.11.20 um 21:59 schrieb Zack Rusin: >>> >>> >>>> On Nov 24, 2020, at 06:38, Thomas Zimmermann wrote: >&

Re: [PATCH 14/15] drm/vmwgfx: Remove references to struct drm_device.pdev

2020-12-02 Thread Zack Rusin
> On Dec 2, 2020, at 11:03, Daniel Vetter wrote: > > On Wed, Dec 2, 2020 at 4:37 PM Zack Rusin wrote: >> >> >> >>> On Dec 2, 2020, at 09:27, Thomas Zimmermann wrote: >>> >>> Hi >>> >>> Am 02.12.20 um 09:01 schrieb

Re: [PATCH 14/15] drm/vmwgfx: Remove references to struct drm_device.pdev

2020-12-03 Thread Zack Rusin
> On Dec 3, 2020, at 10:12, Daniel Vetter wrote: > > On Thu, Dec 03, 2020 at 03:06:20AM +0000, Zack Rusin wrote: >> >> >>> On Dec 2, 2020, at 11:03, Daniel Vetter wrote: >>> >>> On Wed, Dec 2, 2020 at 4:37 PM Zack Rusin wrote: >>

Re: [PATCH -next] drm: vmwgfx: add header file for ttm_range_manager

2021-06-30 Thread Zack Rusin
("drm/ttm: remove available_caching") > Fixes: a343160235f5 ("drm/vmwgfx/ttm: fix the non-THP cleanup path.") > Signed-off-by: Randy Dunlap > Cc: "VMware Graphics" > Cc: Roland Scheidegger > Cc: Zack Rusin > Cc: dri-devel@lists.freedesktop.org >

Re: [PATCH] drm/vmwgfx: Convert to Linux IRQ interfaces

2021-07-06 Thread Zack Rusin
he reference to struct drm_device.irq. Use irq value of struct pci_dev instead. Signed-off-by: Thomas Zimmermann Looks great. Thank you. Reviewed-by: Zack Rusin

Re: [PATCH v1] fix vmwgfx compilation error due to a missing include

2021-07-09 Thread Zack Rusin
On 7/9/21 4:04 PM, Dave Airlie wrote: cc'ing Christian to fix this I assume it was ttm refactor? Yes, but it's on me because after fixing it I kept forgetting to queue it up for a merge. It's now in drm-misc/drm-misc-next-fixes. Thomas, if you could make sure your next drm-misc-next-fixes pul

[PATCH 3/4] drm/vmwgfx: Be a lot more flexible with MOB limits

2021-07-13 Thread Zack Rusin
RAM. With the addition of some extra logging this should make the "guest has been configured with not enough graphics memory" errors a lot easier to diagnose in cases where the automatic expansion of MOB space fails. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev --- drivers/gp

[PATCH 1/4] drm/vmwgfx: Add support for CursorMob and CursorBypass 4

2021-07-13 Thread Zack Rusin
From: Martin Krastev * Add support for CursorMob * Add support for CursorBypass 4 Reviewed-by: Zack Rusin Signed-off-by: Martin Krastev Signed-off-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 45 +++- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 6 +++ drivers/gpu/drm

[PATCH 2/4] drm/vmwgfx: Switch to using DRM_IOCTL_DEF_DRV

2021-07-13 Thread Zack Rusin
ined ioctl name and removes duplicated code. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 176 +--- 1 file changed, 84 insertions(+), 92 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwg

[PATCH 4/4] drm/vmwgfx: Use 2.19 version number to recognize mks-stats ioctls

2021-07-13 Thread Zack Rusin
To let the userspace recognize that it's running on top of a vmwgfx that supports mks-stat ioctls we need to bump the version number. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Reviewed-by: Neha Bhende --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 6 +++--- 1 file ch

Re: KASAN splat in vmwgfx driver

2022-03-15 Thread Zack Rusin
On Wed, 2022-03-16 at 00:45 +, Chuck Lever III wrote: > For a kernel development project I'm working on, I'm using > Linux in a VMware guest. After kernel v5.16.2, I noticed > this KASAN splat: Ah, yea, thanks. It's because vmw_bo_create_kernel creates a raw ttm_buffer_object instead of vmw_bu

[PATCH 0/5] drm/vmwgfx: Set of various correctness fixes

2022-03-18 Thread Zack Rusin
From: Zack Rusin This is a set of various smaller fixes. The 5th, drm/ttm one needs to be looked at by Christian, especially because it's a kernel oops. The others are largely trivial vmwgfx fixes. Zack Rusin (5): drm/vmwgfx: Fix an invalid read drm/vmwgfx: Fix mob cursor allocation

[PATCH 1/5] drm/vmwgfx: Fix an invalid read

2022-03-18 Thread Zack Rusin
From: Zack Rusin vmw_move assumed that buffers to be moved would always be vmw_buffer_object's but after introduction of new placement for mob pages that's no longer the case. The resulting invalid read didn't have any practical consequences because the memory isn't us

[PATCH 2/5] drm/vmwgfx: Fix mob cursor allocation race

2022-03-18 Thread Zack Rusin
From: Zack Rusin Writes to SVGA_REG_CURSOR_MOBID did not wait for the buffers to be fully populated. This sometimes results in the device not being aware of the buffer when the cursor mob register was written. Properly wait for the buffer to be fully populated before setting it as a cursor mob

[PATCH 4/5] drm/vmwgfx: Disable command buffers on svga3 without gbobjects

2022-03-18 Thread Zack Rusin
From: Zack Rusin With very limited vram on svga3 it's difficult to handle all the surface migrations. Without gbobjects, i.e. the ability to store surfaces in guest mobs, there's no reason to support intermediate svga2 features, especially because we can fall back to fb traces and

[PATCH 3/5] drm/vmwgfx: validate the screen formats

2022-03-18 Thread Zack Rusin
From: Zack Rusin The kms code wasn't validating the modifiers and was letting through unsupported formats. rgb8 was never properly supported and has no matching svga screen target format so remove it. This fixes format/modifier failures in kms_addfb_basic from IGT. Signed-off-by: Zack

[PATCH 5/5] drm/ttm: Fix a kernel oops due to an invalid read

2022-03-18 Thread Zack Rusin
From: Zack Rusin The res is initialized here only if there's no errors so passing it to ttm_resource_fini in the error paths results in a kernel oops. In the error paths, instead of the unitialized res, we have to use to use node->base on which ttm_resource_init was called. Sample

Re: [PATCH 07/23] drm/vmwgfx: stop using dma_resv_excl_fence

2022-03-21 Thread Zack Rusin
ned-off-by: Christian König > Reviewed-by: Daniel Vetter > Cc: VMware Graphics > Cc: Zack Rusin > --- >  drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 6 -- >  1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c

Re: [PATCH 07/23] drm/vmwgfx: stop using dma_resv_excl_fence

2022-03-21 Thread Zack Rusin
On Mon, 2022-03-21 at 15:12 +0100, Christian König wrote: > Am 21.03.22 um 15:02 schrieb Zack Rusin: > > On Mon, 2022-03-21 at 14:58 +0100, Christian König wrote: > > > ⚠ External Email: This email originated from outside of the > > > organization. Do not click links or

Re: [PATCH 07/23] drm/vmwgfx: stop using dma_resv_excl_fence

2022-03-22 Thread Zack Rusin
On Tue, 2022-03-22 at 08:13 +0100, Christian König wrote: > Am 21.03.22 um 16:11 schrieb Zack Rusin: > > On Mon, 2022-03-21 at 15:12 +0100, Christian König wrote: > > > Am 21.03.22 um 15:02 schrieb Zack Rusin: > > > > On Mon, 2022-03-21 at 14:58 +0100, Christian Kön

Re: [PATCH] drm/vmwgfx: Propagate error on failed ioctl

2022-03-25 Thread Zack Rusin
On Sun, 2022-03-13 at 06:06 +0100, Philipp Sieweck wrote: > The cases of vmw_user_bo_synccpu_grab failing with -ERESTARTSYS or - > EBUSY > are handled in vmw_user_bo_synccpu_ioctl by not printing an error > message. > However, the error value gets discarded, indicating success. This > leads > to re

[PATCH 0/8] drm/vmwgfx: 3D on arm64 and large cursor support

2022-03-02 Thread Zack Rusin
From: Zack Rusin Series finishes 3D support on arm64 with vmwgfx. With this and changes that add svga3 pci id's to Mesa3D - OpenGL 4.3 and GLES 3.1 work smoothly on arm64. Most changes are not svga3 specific but r

[PATCH 3/8] drm/vmwgfx: Print capabilities early during the initialization

2022-03-02 Thread Zack Rusin
From: Zack Rusin Capabilities were logged at the end of initialization so any early errors would make them not appear in the logs. Which is also when they're needed the most. Print the the capabilities right after fetching them, before the init code starts using them to make sure they a

[PATCH 2/8] drm/vmwgfx: Cleanup multimon initialization code

2022-03-02 Thread Zack Rusin
From: Zack Rusin The results of the legacy display unit initialization were being silently ignored. Unifying the selection of number of display units based on whether the underlying device supports multimon makes it easier to add error checking to all paths. This makes the driver report the

[PATCH 4/8] drm/vmwgfx: Fix fencing on SVGAv3

2022-03-02 Thread Zack Rusin
From: Zack Rusin Port of the vmwgfx to SVGAv3 lacked support for fencing. SVGAv3 removed FIFO's and replaced them with command buffers and extra registers. The initial version of SVGAv3 lacked support for most advanced features (e.g. 3D) which made fences unnecessary. That is no longer the

[PATCH 1/8] drm/vmwgfx: Add support for CursorMob and CursorBypass 4

2022-03-02 Thread Zack Rusin
feature which enables support for large cursors, e.g. large accessibility cursor on platforms with vmwgfx. It also cleans up the cursor code and makes it more uniform with the rest of modern guest backed objects support. Signed-off-by: Martin Krastev Reviewed-by: Zack Rusin Reviewed-by: Maaz

[PATCH 7/8] drm/vmwgfx: Implement MSI/MSI-X support for IRQs

2022-03-02 Thread Zack Rusin
From: Zack Rusin SVGAv3 deprecates legacy interrupts and adds support for MSI/MSI-X. With MSI the driver visible side remains largely unchanged but with MSI-X each interrupt gets delivered on its own vector. Add support for MSI/MSI-X while preserving the old functionality for SVGAv2. Code

[PATCH 5/8] drm/vmwgfx: Allow querying of the SVGA PCI id from the userspace

2022-03-02 Thread Zack Rusin
From: Zack Rusin Mesa3D loaders require knowledge of the devices PCI id. SVGAv2 and v3 have different PCI id's, but the same driver is used to handle them both. To allow Mesa3D svga driver to be loaded automatically for both SVGAv2 and SVGAv3 make the kernel return the PCI id of the curr

[PATCH 8/8] drm/vmwgfx: Stop using surface dma commands on most configurations

2022-03-02 Thread Zack Rusin
From: Zack Rusin Initial version of guest backed objects in the host had some performance issues that made using surface-dma's instead of direct copies faster. Surface dma's force a migration to vram which at best is slow and at worst is impossible (e.g. on svga3 where there's not

[PATCH 6/8] drm/vmwgfx: Initialize drm_mode_fb_cmd2

2022-03-02 Thread Zack Rusin
From: Zack Rusin Transition to drm_mode_fb_cmd2 from drm_mode_fb_cmd left the structure unitialized. drm_mode_fb_cmd2 adds a few additional members, e.g. flags and modifiers which were never initialized. Garbage in those members can cause random failures during the bringup of the fbcon

[PATCH v2] drm/vmwgfx: Implement MSI/MSI-X support for IRQs

2022-03-07 Thread Zack Rusin
From: Zack Rusin SVGAv3 deprecates legacy interrupts and adds support for MSI/MSI-X. With MSI the driver visible side remains largely unchanged but with MSI-X each interrupt gets delivered on its own vector. Add support for MSI/MSI-X while preserving the old functionality for SVGAv2. Code

  1   2   3   4   5   6   7   >