Implement DRIVER_GEM and GL 4.3
Subsystems (3)
cover Implement DRIVER_GEM and GL 4.3
From: Zack Rusin <[email protected]>
This series lays the groundwork for adding GEM support across vmwgfx an implements features missing for GL4.3.
It fixes a lot of broken userspace code which was assuming GEM objects coming via the "dumb" entrypoints and fixes a lot of bugs in our code by letting DRM helpers use the standard GEM paths resulting in hundreds more passing IGT tests.
There's more work to be done on the GEM side - in particular the driver should start using the DRM fb/kms helpers which depend on GEM. They're blocked by surfaces which are currently still opaque TTM handles. Switching surfaces to GEM objects without breaking userspace is a little more complicated but we'll get there.
Roland Scheidegger (2):
drm/vmwgfx: support SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2 command drm/vmwgfx: add support for updating only offsets of constant buffers
Zack Rusin (10):
drm/vmwgfx: Remove the dedicated memory accounting drm/vmwgfx: Add a debug callback to mobid resource manager drm/vmwgfx: Stop hardcoding the PCI ID
drm/vmwgfx: Implement DRIVER_GEM
drm/vmwgfx: Implement create_handle on drm_framebuffer_funcs drm/vmwgfx: Update device headers for GL43 drm/vmwgfx: support 64 UAVs
drm/vmwgfx: Allow checking for gl43 contexts drm/vmwgfx: Remove usage of MOBFMT_RANGE drm/vmwgfx: Bump the major version
drivers/gpu/drm/vmwgfx/Kconfig | 1 + drivers/gpu/drm/vmwgfx/Makefile | 3 +- .../drm/vmwgfx/device_include/svga3d_cmd.h | 6 +- .../vmwgfx/device_include/svga3d_devcaps.h | 10 +- .../gpu/drm/vmwgfx/device_include/svga3d_dx.h | 12 +- .../drm/vmwgfx/device_include/svga3d_limits.h | 8 +- .../drm/vmwgfx/device_include/svga3d_reg.h | 6 +- .../drm/vmwgfx/device_include/svga3d_types.h | 7 +- .../drm/vmwgfx/device_include/svga_escape.h | 6 +- .../drm/vmwgfx/device_include/svga_overlay.h | 6 +- .../gpu/drm/vmwgfx/device_include/svga_reg.h | 14 +- drivers/gpu/drm/vmwgfx/ttm_memory.c | 586 ------------------ drivers/gpu/drm/vmwgfx/ttm_memory.h | 92 --- drivers/gpu/drm/vmwgfx/ttm_object.c | 150 +---- drivers/gpu/drm/vmwgfx/ttm_object.h | 56 +- drivers/gpu/drm/vmwgfx/vmwgfx_binding.c | 45 +- drivers/gpu/drm/vmwgfx/vmwgfx_binding.h | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 580 ++++------------- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 19 - drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 30 +- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 26 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 47 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 130 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 82 ++- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 13 +- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 43 +- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 294 +++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 16 +- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 3 + drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 45 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 13 +- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c | 20 +- drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 91 +-- .../gpu/drm/vmwgfx/vmwgfx_simple_resource.c | 29 +- drivers/gpu/drm/vmwgfx/vmwgfx_so.c | 21 +- drivers/gpu/drm/vmwgfx/vmwgfx_so.h | 6 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c | 21 - drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 158 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 77 +-- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 74 +-- drivers/gpu/drm/vmwgfx/vmwgfx_va.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_validation.c | 13 +- drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 46 -- include/uapi/drm/vmwgfx_drm.h | 1 + 50 files changed, 820 insertions(+), 2125 deletions(-) delete mode 100644 drivers/gpu/drm/vmwgfx/ttm_memory.c delete mode 100644 drivers/gpu/drm/vmwgfx/ttm_memory.h create mode 100644 drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
Signature · 1 line
2.32.0
PATCH 1/12 drm/vmwgfx: Remove the dedicated memory accounting
From: Zack Rusin <[email protected]>
vmwgfx shared very elaborate memory accounting with ttm. It was moved from ttm to vmwgfx in changef07069da6b4c ("drm/ttm: move memory accounting into vmwgfx v4") but because of complexity it was hard to maintain. Some parts of the code weren't freeing memory correctly and some were missing accounting all together. While those would be fairly easy to fix the fundamental reason for memory accounting in the driver was the ability to invoke shrinker which is part of TTM code as well (with support for unified memory hopefully coming soon).
That meant that vmwgfx had a lot of code that was either unused or duplicating code from TTM. Removing this code also prevents excessive calls to global swapout which were common during memory pressure because both vmwgfx and TTM would invoke the shrinker when memory usage reached half of RAM.
--- drivers/gpu/drm/vmwgfx/Makefile | 2 +- drivers/gpu/drm/vmwgfx/ttm_memory.c | 586 ------------------ drivers/gpu/drm/vmwgfx/ttm_memory.h | 92 --- drivers/gpu/drm/vmwgfx/ttm_object.c | 36 +- drivers/gpu/drm/vmwgfx/ttm_object.h | 12 +- drivers/gpu/drm/vmwgfx/vmwgfx_binding.c | 20 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 65 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 19 - drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 26 - drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 18 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 25 - drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 - drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 30 - drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 7 +- drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c | 20 +- drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 74 +-- .../gpu/drm/vmwgfx/vmwgfx_simple_resource.c | 27 +- drivers/gpu/drm/vmwgfx/vmwgfx_so.c | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c | 21 - drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 90 +-- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 50 -- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 35 -- drivers/gpu/drm/vmwgfx/vmwgfx_validation.c | 13 +- drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 46 -- 27 files changed, 38 insertions(+), 1316 deletions(-) delete mode 100644 drivers/gpu/drm/vmwgfx/ttm_memory.c delete mode 100644 drivers/gpu/drm/vmwgfx/ttm_memory.h
drivers/gpu/drm/vmwgfx/Makefile +1 -1
@@ -9,7 +9,7 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_hashtab.o vmwgfx_kms.o vmwgfx_d vmwgfx_cotable.o vmwgfx_so.o vmwgfx_binding.o vmwgfx_msg.o \ vmwgfx_simple_resource.o vmwgfx_va.o vmwgfx_blit.o \ vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \ - vmwgfx_devcaps.o ttm_object.o ttm_memory.o vmwgfx_system_manager.o + vmwgfx_devcaps.o ttm_object.o vmwgfx_system_manager.o vmwgfx-$(CONFIG_DRM_FBDEV_EMULATION) += vmwgfx_fb.o vmwgfx-$(CONFIG_TRANSPARENT_HUGEPAGE) += vmwgfx_thp.o
drivers/gpu/drm/vmwgfx/ttm_memory.c deleted +0 -586
586 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/ttm_memory.h deleted +0 -92
92 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/ttm_object.c +2 -34
@@ -93,10 +93,8 @@ struct ttm_object_device {spinlock_t object_lock;struct vmwgfx_open_hash object_hash;atomic_t object_count; -struct ttm_mem_global *mem_glob;struct dma_buf_ops ops;void (*dmabuf_release)(struct dma_buf *dma_buf); -size_t dma_buf_size;struct idr idr; };
@@ -352,11 +350,6 @@ int ttm_ref_object_add(struct ttm_object_file *tfile,struct vmwgfx_open_hash *ht = &tfile->ref_hash[ref_type];struct ttm_ref_object *ref;struct vmwgfx_hash_item *hash; -struct ttm_mem_global *mem_glob = tfile->tdev->mem_glob; -struct ttm_operation_ctx ctx = { - .interruptible = false, - .no_wait_gpu = false - };int ret = -EINVAL ;if (base->tfile != tfile && !base->shareable)
@@ -381,13 +374,8 @@ int ttm_ref_object_add(struct ttm_object_file *tfile,if (require_existed)return -EPERM ; - ret =ttm_mem_global_alloc (mem_glob,sizeof (*ref), - &ctx); -if (unlikely (ret !=0 )) -return ret; ref =kmalloc (sizeof (*ref),GFP_KERNEL );if (unlikely (ref ==NULL )) { -ttm_mem_global_free (mem_glob,sizeof (*ref));return -ENOMEM ; }
@@ -412,7 +400,6 @@ int ttm_ref_object_add(struct ttm_object_file *tfile,spin_unlock (&tfile->lock);BUG_ON (ret != -EINVAL ); -ttm_mem_global_free (mem_glob,sizeof (*ref));kfree (ref); }
@@ -427,7 +414,6 @@ ttm_ref_object_release(struct kref *kref)struct ttm_base_object *base = ref->obj;struct ttm_object_file *tfile = ref->tfile;struct vmwgfx_open_hash *ht; -struct ttm_mem_global *mem_glob = tfile->tdev->mem_glob; ht = &tfile->ref_hash[ref->ref_type]; (void )vmwgfx_ht_remove_item_rcu (ht, &ref->hash);
@@ -438,7 +424,6 @@ ttm_ref_object_release(struct kref *kref) base->ref_obj_release (base, ref->ref_type);ttm_base_object_unref (&ref->obj); -ttm_mem_global_free (mem_glob,sizeof (*ref));kfree_rcu (ref, rcu_head);spin_lock (&tfile->lock); }
@@ -526,8 +511,7 @@ struct ttm_object_file *ttm_object_file_init(struct ttm_object_device *tdev, }struct ttm_object_device * -ttm_object_device_init (struct ttm_mem_global *mem_glob, -unsigned int hash_order, +ttm_object_device_init (unsigned int hash_order,const struct dma_buf_ops *ops) {struct ttm_object_device *tdev =kmalloc (sizeof (*tdev),GFP_KERNEL );
@@ -536,7 +520,6 @@ ttm_object_device_init(struct ttm_mem_global *mem_glob,if (unlikely (tdev ==NULL ))return NULL ; - tdev->mem_glob = mem_glob;spin_lock_init (&tdev->object_lock);atomic_set (&tdev->object_count,0 ); ret =vmwgfx_ht_create (&tdev->object_hash, hash_order);
@@ -547,8 +530,6 @@ ttm_object_device_init(struct ttm_mem_global *mem_glob, tdev->ops = *ops; tdev->dmabuf_release = tdev->ops.release; tdev->ops.release = ttm_prime_dmabuf_release; - tdev->dma_buf_size =ttm_round_pot (sizeof (struct dma_buf )) + -ttm_round_pot (sizeof (struct file ));return tdev; out_no_object_hash:
@@ -633,7 +614,6 @@ static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf)if (prime->dma_buf == dma_buf) prime->dma_buf =NULL ;mutex_unlock (&prime->mutex); -ttm_mem_global_free (tdev->mem_glob, tdev->dma_buf_size);ttm_base_object_unref (&base); }
@@ -715,30 +695,18 @@ int ttm_prime_handle_to_fd(struct ttm_object_file *tfile, dma_buf = prime->dma_buf;if (!dma_buf || !get_dma_buf_unless_doomed (dma_buf)) {DEFINE_DMA_BUF_EXPORT_INFO (exp_info); -struct ttm_operation_ctx ctx = { - .interruptible = true, - .no_wait_gpu = false - }; exp_info.ops = &tdev->ops; exp_info.size = prime->size; exp_info.flags = flags; exp_info.priv = prime;/* -* Need to create a new dma_buf, with memory accounting. +* Need to create a new dma_buf */ - ret =ttm_mem_global_alloc (tdev->mem_glob, tdev->dma_buf_size, - &ctx); -if (unlikely (ret !=0 )) { -mutex_unlock (&prime->mutex); - goto out_unref; - } dma_buf =dma_buf_export (&exp_info);if (IS_ERR (dma_buf)) { ret =PTR_ERR (dma_buf); -ttm_mem_global_free (tdev->mem_glob, - tdev->dma_buf_size);mutex_unlock (&prime->mutex); goto out_unref; }
drivers/gpu/drm/vmwgfx/ttm_object.h +1 -11
@@ -42,7 +42,6 @@#include <linux/list.h> #include <linux/rcupdate.h> -#include "ttm_memory.h" #include "vmwgfx_hashtab.h" /**
@@ -296,7 +295,6 @@ extern void ttm_object_file_release(struct ttm_object_file **p_tfile);/** * ttm_object device init - initialize a struct ttm_object_device * -* @mem_glob: struct ttm_mem_global for memory accounting. * @hash_order: Order of hash table used to hash the base objects. * @ops: DMA buf ops for prime objects of this device. *
@@ -305,8 +303,7 @@ extern void ttm_object_file_release(struct ttm_object_file **p_tfile);*/ extern struct ttm_object_device * -ttm_object_device_init (struct ttm_mem_global *mem_glob, -unsigned int hash_order, +ttm_object_device_init (unsigned int hash_order,const struct dma_buf_ops *ops);/**
@@ -352,13 +349,6 @@ extern int ttm_prime_handle_to_fd(struct ttm_object_file *tfile,#define ttm_prime_object_kfree (__obj, __prime) \ kfree_rcu(__obj, __prime.base.rhead) -/* -* Extra memory required by the base object's idr storage, which is allocated -* separately from the base object itself. We estimate an on-average 128 bytes -* per idr. -*/ -#define TTM_OBJ_EXTRA_SIZE 128 -struct ttm_base_object *ttm_base_object_noref_lookup (struct ttm_object_file *tfile,uint32_t key);
drivers/gpu/drm/vmwgfx/vmwgfx_binding.c +2 -18
@@ -1327,8 +1327,7 @@ static int vmw_binding_scrub_so(struct vmw_ctx_bindinfo *bi, bool rebind) }/** -* vmw_binding_state_alloc - Allocate a struct vmw_ctx_binding_state with -* memory accounting. +* vmw_binding_state_alloc - Allocate a struct vmw_ctx_binding_state. * * @dev_priv: Pointer to a device private structure. *
@@ -1338,20 +1337,9 @@ struct vmw_ctx_binding_state * vmw_binding_state_alloc(struct vmw_private *dev_priv) {struct vmw_ctx_binding_state *cbs; -struct ttm_operation_ctx ctx = { - .interruptible = false, - .no_wait_gpu = false - }; -int ret; - - ret =ttm_mem_global_alloc (vmw_mem_glob (dev_priv),sizeof (*cbs), - &ctx); -if (ret) -return ERR_PTR (ret); cbs =vzalloc (sizeof (*cbs));if (!cbs) { -ttm_mem_global_free (vmw_mem_glob (dev_priv),sizeof (*cbs));return ERR_PTR (-ENOMEM ); }
@@ -1362,17 +1350,13 @@ vmw_binding_state_alloc(struct vmw_private *dev_priv) }/** -* vmw_binding_state_free - Free a struct vmw_ctx_binding_state and its -* memory accounting info. +* vmw_binding_state_free - Free a struct vmw_ctx_binding_state. * * @cbs: Pointer to the struct vmw_ctx_binding_state to be freed. */ void vmw_binding_state_free (struct vmw_ctx_binding_state *cbs) { -struct vmw_private *dev_priv = cbs->dev_priv; -vfree (cbs); -ttm_mem_global_free (vmw_mem_glob (dev_priv),sizeof (*cbs)); }/**
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +9 -56
118 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c +0 -19
@@ -324,22 +324,3 @@ void vmw_cmdbuf_res_man_destroy(struct vmw_cmdbuf_res_manager *man)kfree (man); } -/** -* vmw_cmdbuf_res_man_size - Return the size of a command buffer managed -* resource manager -* -* Returns the approximate allocation size of a command buffer managed -* resource manager. -*/ -size_t vmw_cmdbuf_res_man_size (void ) -{ -static size_t res_man_size; - -if (unlikely (res_man_size ==0 )) - res_man_size = -ttm_round_pot (sizeof (struct vmw_cmdbuf_res_manager )) + -ttm_round_pot (sizeof (struct hlist_head ) << -VMW_CMDBUF_RES_MAN_HT_ORDER ); - -return res_man_size; -}
drivers/gpu/drm/vmwgfx/vmwgfx_context.c +0 -26
@@ -60,8 +60,6 @@ static int vmw_dx_context_unbind(struct vmw_resource *res, struct ttm_validate_buffer *val_buf);static int vmw_dx_context_destroy (struct vmw_resource *res); -static uint64_t vmw_user_context_size; -static const struct vmw_user_resource_conv user_context_conv = { .object_type =VMW_RES_CONTEXT , .base_obj_to_res = vmw_user_context_base_to_res,
@@ -686,7 +684,6 @@ static void vmw_user_context_free(struct vmw_resource *res) {struct vmw_user_context *ctx = container_of(res, struct vmw_user_context, res); -struct vmw_private *dev_priv = res->dev_priv;if (ctx->cbs)vmw_binding_state_free (ctx->cbs);
@@ -694,8 +691,6 @@ static void vmw_user_context_free(struct vmw_resource *res) (void )vmw_context_bind_dx_query (res,NULL );ttm_base_object_kfree (ctx, base); -ttm_mem_global_free (vmw_mem_glob (dev_priv), - vmw_user_context_size); }/*
@@ -732,10 +727,6 @@ static int vmw_context_define(struct drm_device *dev, void *data,struct vmw_resource *tmp;struct drm_vmw_context_arg *arg = (struct drm_vmw_context_arg *)data;struct ttm_object_file *tfile =vmw_fpriv (file_priv)->tfile; -struct ttm_operation_ctx ttm_opt_ctx = { - .interruptible = true, - .no_wait_gpu = false - };int ret;if (!has_sm4_context (dev_priv) && dx) {
@@ -743,25 +734,8 @@ static int vmw_context_define(struct drm_device *dev, void *data,return -EINVAL ; } -if (unlikely (vmw_user_context_size ==0 )) - vmw_user_context_size =ttm_round_pot (sizeof (*ctx)) + - ((dev_priv->has_mob) ?vmw_cmdbuf_res_man_size () :0 ) + - +VMW_IDA_ACC_SIZE +TTM_OBJ_EXTRA_SIZE ; - - ret =ttm_mem_global_alloc (vmw_mem_glob (dev_priv), - vmw_user_context_size, - &ttm_opt_ctx); -if (unlikely (ret !=0 )) { -if (ret != -ERESTARTSYS ) -DRM_ERROR ("Out of graphics memory for context" -" creation.\n" ); - goto out_ret; - } - ctx =kzalloc (sizeof (*ctx),GFP_KERNEL );if (unlikely (!ctx)) { -ttm_mem_global_free (vmw_mem_glob (dev_priv), - vmw_user_context_size); ret = -ENOMEM ; goto out_ret; }
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c +0 -18
@@ -546,8 +546,6 @@ static void vmw_hw_cotable_destroy(struct vmw_resource *res) (void )vmw_cotable_destroy (res); } -static size_t cotable_acc_size; -/** * vmw_cotable_free - Cotable resource destructor *
@@ -555,10 +553,7 @@ static size_t cotable_acc_size;*/ static void vmw_cotable_free (struct vmw_resource *res) { -struct vmw_private *dev_priv = res->dev_priv; -kfree (res); -ttm_mem_global_free (vmw_mem_glob (dev_priv), cotable_acc_size); }/**
@@ -574,21 +569,9 @@ struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv, u32 type) {struct vmw_cotable *vcotbl; -struct ttm_operation_ctx ttm_opt_ctx = { - .interruptible = true, - .no_wait_gpu = false - };int ret;u32 num_entries; -if (unlikely (cotable_acc_size ==0 )) - cotable_acc_size =ttm_round_pot (sizeof (struct vmw_cotable )); - - ret =ttm_mem_global_alloc (vmw_mem_glob (dev_priv), - cotable_acc_size, &ttm_opt_ctx); -if (unlikely (ret)) -return ERR_PTR (ret); - vcotbl =kzalloc (sizeof (*vcotbl),GFP_KERNEL );if (unlikely (!vcotbl)) { ret = -ENOMEM ;
@@ -622,7 +605,6 @@ struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv, out_no_init:kfree (vcotbl); out_no_alloc: -ttm_mem_global_free (vmw_mem_glob (dev_priv), cotable_acc_size);return ERR_PTR (ret); }
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +2 -15
@@ -50,9 +50,6 @@#define VMW_MIN_INITIAL_WIDTH 800#define VMW_MIN_INITIAL_HEIGHT 600 -#define VMWGFX_VALIDATION_MEM_GRAN (16*PAGE_SIZE) - -/* * Fully encoded drm commands. Might move to vmw_drm.h */
@@ -986,8 +983,7 @@ static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id) goto out_err0; } - dev_priv->tdev =ttm_object_device_init (&ttm_mem_glob,12 , - &vmw_prime_dmabuf_ops); + dev_priv->tdev =ttm_object_device_init (12 , &vmw_prime_dmabuf_ops);if (unlikely (dev_priv->tdev ==NULL )) { drm_err(&dev_priv->drm,
@@ -1083,8 +1079,6 @@ static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id) dev_priv->sm_type =VMW_SM_4 ; } -vmw_validation_mem_init_ttm (dev_priv,VMWGFX_VALIDATION_MEM_GRAN ); -/* SVGA_CAP2_DX2 (DefineGBSurface_v3) is needed for SM4_1 support */ if (has_sm4_context (dev_priv) && (dev_priv->capabilities2 &SVGA_CAP2_DX2 )) {
@@ -1397,7 +1391,6 @@ static void vmw_remove(struct pci_dev *pdev) {struct drm_device *dev =pci_get_drvdata (pdev); -ttm_mem_global_release (&ttm_mem_glob);drm_dev_unregister (dev);vmw_driver_unload (dev); }
@@ -1641,13 +1634,9 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)pci_set_drvdata (pdev, &vmw->drm); - ret =ttm_mem_global_init (&ttm_mem_glob, &pdev->dev); -if (ret) - goto out_error; - ret =vmw_driver_load (vmw, ent->device);if (ret) - goto out_release; + goto out_error; ret =drm_dev_register (&vmw->drm,0 );if (ret)
@@ -1656,8 +1645,6 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)return 0 ; out_unload:vmw_driver_unload (&vmw->drm); -out_release: -ttm_mem_global_release (&ttm_mem_glob); out_error:return ret; }
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0 -25
@@ -628,9 +628,6 @@ struct vmw_private {struct vmw_cmdbuf_man *cman;DECLARE_BITMAP (irqthread_pending,VMW_IRQTHREAD_MAX ); -/* Validation memory reservation */ -struct vmw_validation_mem vvm; -uint32 *devcaps;/*
@@ -1028,9 +1025,6 @@ vmw_is_cursor_bypass3_enabled(const struct vmw_private *dev_priv)extern int vmw_mmap (struct file *filp,struct vm_area_struct *vma); -extern void vmw_validation_mem_init_ttm (struct vmw_private *dev_priv, -size_t gran); -/** * TTM buffer object driver - vmwgfx_ttm_buffer.c */
@@ -1328,18 +1322,6 @@ extern int vmw_gb_surface_define_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv);extern int vmw_gb_surface_reference_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); -int vmw_surface_gb_priv_define (struct drm_device *dev, -uint32_t user_accounting_size, -SVGA3dSurfaceAllFlags svga3d_flags, -SVGA3dSurfaceFormat format, -bool for_scanout, -uint32_t num_mip_levels, -uint32_t multisample_count, -uint32_t array_size, -struct drm_vmw_size size, -SVGA3dMSPattern multisample_pattern, -SVGA3dMSQualityLevel quality_level, -struct vmw_surface **srf_out);extern int vmw_gb_surface_define_ext_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv);
@@ -1348,7 +1330,6 @@ extern int vmw_gb_surface_reference_ext_ioctl(struct drm_device *dev, struct drm_file *file_priv);int vmw_gb_surface_define (struct vmw_private *dev_priv, -uint32_t user_accounting_size,const struct vmw_surface_metadata *req,struct vmw_surface **srf_out);
@@ -1409,7 +1390,6 @@ void vmw_dx_streamoutput_cotable_list_scrub(struct vmw_private *dev_priv,extern struct vmw_cmdbuf_res_manager *vmw_cmdbuf_res_man_create (struct vmw_private *dev_priv);extern void vmw_cmdbuf_res_man_destroy (struct vmw_cmdbuf_res_manager *man); -extern size_t vmw_cmdbuf_res_man_size (void );extern struct vmw_resource * vmw_cmdbuf_res_lookup(struct vmw_cmdbuf_res_manager *man, enum vmw_cmdbuf_res_type res_type,
@@ -1606,11 +1586,6 @@ vmw_bo_reference(struct vmw_buffer_object *buf)return buf; } -static inline struct ttm_mem_global *vmw_mem_glob (struct vmw_private *dev_priv) -{ -return &ttm_mem_glob; -} -static inline void vmw_fifo_resource_inc (struct vmw_private *dev_priv) {atomic_inc (&dev_priv->num_fifo_resources);
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +0 -2
@@ -4054,8 +4054,6 @@ int vmw_execbuf_process(struct drm_file *file_priv,struct sync_file *sync_file =NULL ;DECLARE_VAL_CONTEXT (val_ctx, &sw_context->res_ht,1 ); -vmw_validation_set_val_mem (&val_ctx, &dev_priv->vvm); -if (flags &DRM_VMW_EXECBUF_FLAG_EXPORT_FENCE_FD ) { out_fence_fd =get_unused_fd_flags (O_CLOEXEC );if (out_fence_fd <0 ) {
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +0 -30
@@ -37,9 +37,6 @@ struct vmw_fence_manager {spinlock_t lock;struct list_head fence_list;struct work_struct work; -u32 user_fence_size; -u32 fence_size; -u32 event_fence_action_size;bool fifo_down;struct list_head cleanup_list;uint32_t pending_actions[VMW_ACTION_MAX ];
@@ -304,11 +301,6 @@ struct vmw_fence_manager *vmw_fence_manager_init(struct vmw_private *dev_priv)INIT_LIST_HEAD (&fman->cleanup_list);INIT_WORK (&fman->work, &vmw_fence_work_func); fman->fifo_down = true; - fman->user_fence_size =ttm_round_pot (sizeof (struct vmw_user_fence )) + -TTM_OBJ_EXTRA_SIZE ; - fman->fence_size =ttm_round_pot (sizeof (struct vmw_fence_obj )); - fman->event_fence_action_size = -ttm_round_pot (sizeof (struct vmw_event_fence_action ));mutex_init (&fman->goal_irq_mutex); fman->ctx =dma_fence_context_alloc (1 );
@@ -560,14 +552,8 @@ static void vmw_user_fence_destroy(struct vmw_fence_obj *fence) {struct vmw_user_fence *ufence = container_of(fence, struct vmw_user_fence, fence); -struct vmw_fence_manager *fman =fman_from_fence (fence);ttm_base_object_kfree (ufence, base); -/* -* Free kernel space accounting. -*/ -ttm_mem_global_free (vmw_mem_glob (fman->dev_priv), - fman->user_fence_size); }static void vmw_user_fence_base_release (struct ttm_base_object **p_base)
@@ -590,23 +576,8 @@ int vmw_user_fence_create(struct drm_file *file_priv,struct ttm_object_file *tfile =vmw_fpriv (file_priv)->tfile;struct vmw_user_fence *ufence;struct vmw_fence_obj *tmp; -struct ttm_mem_global *mem_glob =vmw_mem_glob (fman->dev_priv); -struct ttm_operation_ctx ctx = { - .interruptible = false, - .no_wait_gpu = false - };int ret; -/* -* Kernel memory space accounting, since this object may -* be created by a user-space request. -*/ - - ret =ttm_mem_global_alloc (mem_glob, fman->user_fence_size, - &ctx); -if (unlikely (ret !=0 )) -return ret; - ufence =kzalloc (sizeof (*ufence),GFP_KERNEL );if (unlikely (!ufence)) { ret = -ENOMEM ;
@@ -646,7 +617,6 @@ int vmw_user_fence_create(struct drm_file *file_priv, tmp = &ufence->fence;vmw_fence_obj_unreference (&tmp); out_no_object: -ttm_mem_global_free (mem_glob, fman->user_fence_size);return ret; }
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -1
@@ -1188,7 +1188,7 @@ static int vmw_create_bo_proxy(struct drm_device *dev, metadata.base_size.depth =1 ; metadata.scanout = true; - ret =vmw_gb_surface_define (vmw_priv (dev),0 , &metadata, srf_out); + ret =vmw_gb_surface_define (vmw_priv (dev), &metadata, srf_out);if (ret) {DRM_ERROR ("Failed to allocate proxy content buffer\n" );return ret;
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c +3 -4
@@ -413,10 +413,9 @@ struct vmw_mob *vmw_mob_create(unsigned long data_pages)* @mob: Pointer to the mob the pagetable of which we want to * populate. * -* This function allocates memory to be used for the pagetable, and -* adjusts TTM memory accounting accordingly. Returns ENOMEM if -* memory resources aren't sufficient and may cause TTM buffer objects -* to be swapped out by using the TTM memory accounting function. +* This function allocates memory to be used for the pagetable. +* Returns ENOMEM if memory resources aren't sufficient and may +* cause TTM buffer objects to be swapped out. */ static int vmw_mob_pt_populate (struct vmw_private *dev_priv,struct vmw_mob *mob)
drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c +1 -19
@@ -57,7 +57,6 @@ enum vmw_bo_dirty_method {* @ref_count: Reference count for this structure * @bitmap_size: The size of the bitmap in bits. Typically equal to the * nuber of pages in the bo. -* @size: The accounting size for this struct. * @bitmap: A bitmap where each bit represents a page. A set bit means a * dirty page. */
@@ -68,7 +67,6 @@ struct vmw_bo_dirty {unsigned int change_count;unsigned int ref_count;unsigned long bitmap_size; -size_t size;unsigned long bitmap[]; };
@@ -233,12 +231,8 @@ int vmw_bo_dirty_add(struct vmw_buffer_object *vbo) {struct vmw_bo_dirty *dirty = vbo->dirty;pgoff_t num_pages = vbo->base.resource->num_pages; -size_t size, acc_size; +size_t size;int ret; -static struct ttm_operation_ctx ctx = { - .interruptible = false, - .no_wait_gpu = false - };if (dirty) { dirty->ref_count++;
@@ -246,20 +240,12 @@ int vmw_bo_dirty_add(struct vmw_buffer_object *vbo) } size =sizeof (*dirty) +BITS_TO_LONGS (num_pages) *sizeof (long ); - acc_size =ttm_round_pot (size); - ret =ttm_mem_global_alloc (&ttm_mem_glob, acc_size, &ctx); -if (ret) { -VMW_DEBUG_USER ("Out of graphics memory for buffer object " -"dirty tracker.\n" ); -return ret; - } dirty =kvzalloc (size,GFP_KERNEL );if (!dirty) { ret = -ENOMEM ; goto out_no_dirty; } - dirty->size = acc_size; dirty->bitmap_size = num_pages; dirty->start = dirty->bitmap_size; dirty->end =0 ;
@@ -285,7 +271,6 @@ int vmw_bo_dirty_add(struct vmw_buffer_object *vbo)return 0 ; out_no_dirty: -ttm_mem_global_free (&ttm_mem_glob, acc_size);return ret; }
@@ -304,10 +289,7 @@ void vmw_bo_dirty_release(struct vmw_buffer_object *vbo)struct vmw_bo_dirty *dirty = vbo->dirty;if (dirty && --dirty->ref_count ==0 ) { -size_t acc_size = dirty->size; -kvfree (dirty); -ttm_mem_global_free (&ttm_mem_glob, acc_size); vbo->dirty =NULL ; } }
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +1 -73
147 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c +1 -26
@@ -32,12 +32,10 @@* struct vmw_user_simple_resource - User-space simple resource struct * * @base: The TTM base object implementing user-space visibility. -* @account_size: How much memory was accounted for this object. * @simple: The embedded struct vmw_simple_resource. */ struct vmw_user_simple_resource {struct ttm_base_object base; -size_t account_size;struct vmw_simple_resource simple;/* * Nothing to be placed after @simple, since size of @simple is
@@ -91,18 +89,15 @@ static int vmw_simple_resource_init(struct vmw_private *dev_priv,* * @res: The struct vmw_resource member of the simple resource object. * -* Frees memory and memory accounting for the object. +* Frees memory for the object. */ static void vmw_simple_resource_free (struct vmw_resource *res) {struct vmw_user_simple_resource *usimple = container_of(res, struct vmw_user_simple_resource, simple.res); -struct vmw_private *dev_priv = res->dev_priv; -size_t size = usimple->account_size;ttm_base_object_kfree (usimple, base); -ttm_mem_global_free (vmw_mem_glob (dev_priv), size); }/**
@@ -149,39 +144,19 @@ vmw_simple_resource_create_ioctl(struct drm_device *dev, void *data,struct vmw_resource *res;struct vmw_resource *tmp;struct ttm_object_file *tfile =vmw_fpriv (file_priv)->tfile; -struct ttm_operation_ctx ctx = { - .interruptible = true, - .no_wait_gpu = false - };size_t alloc_size; -size_t account_size;int ret; alloc_size = offsetof(struct vmw_user_simple_resource , simple) + func->size; - account_size =ttm_round_pot (alloc_size) +VMW_IDA_ACC_SIZE + -TTM_OBJ_EXTRA_SIZE ; - - ret =ttm_mem_global_alloc (vmw_mem_glob (dev_priv), account_size, - &ctx); -if (ret) { -if (ret != -ERESTARTSYS ) -DRM_ERROR ("Out of graphics memory for %s" -" creation.\n" , func->res_func.type_name); - - goto out_ret; - } usimple =kzalloc (alloc_size,GFP_KERNEL );if (!usimple) { -ttm_mem_global_free (vmw_mem_glob (dev_priv), - account_size); ret = -ENOMEM ; goto out_ret; } usimple->simple.func = func; - usimple->account_size = account_size; res = &usimple->simple.res; usimple->base.shareable = false; usimple->base.tfile =NULL ;
drivers/gpu/drm/vmwgfx/vmwgfx_so.c +1 -16
@@ -279,18 +279,15 @@ static bool vmw_view_id_ok(u32 user_key, enum vmw_view_type view_type)* * @res: Pointer to a struct vmw_resource * -* Frees memory and memory accounting held by a struct vmw_view. +* Frees memory held by the struct vmw_view. */ static void vmw_view_res_free (struct vmw_resource *res) {struct vmw_view *view =vmw_view (res); -size_t size = offsetof(struct vmw_view , cmd) + view->cmd_size; -struct vmw_private *dev_priv = res->dev_priv;vmw_resource_unreference (&view->cotable);vmw_resource_unreference (&view->srf);kfree_rcu (view, rcu); -ttm_mem_global_free (vmw_mem_glob (dev_priv), size); }/**
@@ -327,10 +324,6 @@ int vmw_view_add(struct vmw_cmdbuf_res_manager *man,struct vmw_private *dev_priv = ctx->dev_priv;struct vmw_resource *res;struct vmw_view *view; -struct ttm_operation_ctx ttm_opt_ctx = { - .interruptible = true, - .no_wait_gpu = false - };size_t size;int ret;
@@ -347,16 +340,8 @@ int vmw_view_add(struct vmw_cmdbuf_res_manager *man, size = offsetof(struct vmw_view , cmd) + cmd_size; - ret =ttm_mem_global_alloc (vmw_mem_glob (dev_priv), size, &ttm_opt_ctx); -if (ret) { -if (ret != -ERESTARTSYS ) -DRM_ERROR ("Out of graphics memory for view creation\n" ); -return ret; - } - view =kmalloc (size,GFP_KERNEL );if (!view) { -ttm_mem_global_free (vmw_mem_glob (dev_priv), size);return -ENOMEM ; }
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +1 -1
@@ -1123,7 +1123,7 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane, }if (!vps->surf) { - ret =vmw_gb_surface_define (dev_priv,0 , &metadata, + ret =vmw_gb_surface_define (dev_priv, &metadata, &vps->surf);if (ret !=0 ) {DRM_ERROR ("Couldn't allocate STDU surface.\n" );
drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c +0 -21
@@ -60,8 +60,6 @@ static int vmw_dx_streamoutput_unbind(struct vmw_resource *res, bool readback,static void vmw_dx_streamoutput_commit_notify (struct vmw_resource *res,enum vmw_cmdbuf_res_state state); -static size_t vmw_streamoutput_size; -static const struct vmw_res_func vmw_dx_streamoutput_func = { .res_type = vmw_res_streamoutput, .needs_backup = true,
@@ -254,12 +252,10 @@ vmw_dx_streamoutput_lookup(struct vmw_cmdbuf_res_manager *man,static void vmw_dx_streamoutput_res_free (struct vmw_resource *res) { -struct vmw_private *dev_priv = res->dev_priv;struct vmw_dx_streamoutput *so =vmw_res_to_dx_streamoutput (res);vmw_resource_unreference (&so->cotable);kfree (so); -ttm_mem_global_free (vmw_mem_glob (dev_priv), vmw_streamoutput_size); }static void vmw_dx_streamoutput_hw_destroy (struct vmw_resource *res)
@@ -284,27 +280,10 @@ int vmw_dx_streamoutput_add(struct vmw_cmdbuf_res_manager *man,struct vmw_dx_streamoutput *so;struct vmw_resource *res;struct vmw_private *dev_priv = ctx->dev_priv; -struct ttm_operation_ctx ttm_opt_ctx = { - .interruptible = true, - .no_wait_gpu = false - };int ret; -if (!vmw_streamoutput_size) - vmw_streamoutput_size =ttm_round_pot (sizeof (*so)); - - ret =ttm_mem_global_alloc (vmw_mem_glob (dev_priv), - vmw_streamoutput_size, &ttm_opt_ctx); -if (ret) { -if (ret != -ERESTARTSYS ) -DRM_ERROR ("Out of graphics memory for streamout.\n" ); -return ret; - } - so =kmalloc (sizeof (*so),GFP_KERNEL );if (!so) { -ttm_mem_global_free (vmw_mem_glob (dev_priv), - vmw_streamoutput_size);return -ENOMEM ; }
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +7 -83
268 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -50
115 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c +0 -35
@@ -99,38 +99,3 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma)return ret; } -/* struct vmw_validation_mem callback */ -static int vmw_vmt_reserve (struct vmw_validation_mem *m,size_t size) -{ -static struct ttm_operation_ctx ctx = {.interruptible = false, - .no_wait_gpu = false}; - struct vmw_private *dev_priv = container_of(m, struct vmw_private, vvm); - -return ttm_mem_global_alloc (vmw_mem_glob (dev_priv), size, &ctx); -} - -/* struct vmw_validation_mem callback */ -static void vmw_vmt_unreserve (struct vmw_validation_mem *m,size_t size) -{ - struct vmw_private *dev_priv = container_of(m, struct vmw_private, vvm); - -return ttm_mem_global_free (vmw_mem_glob (dev_priv), size); -} - -/** -* vmw_validation_mem_init_ttm - Interface the validation memory tracker -* to ttm. -* @dev_priv: Pointer to struct vmw_private. The reason we choose a vmw private -* rather than a struct vmw_validation_mem is to make sure assumption in the -* callbacks that struct vmw_private derives from struct vmw_validation_mem -* holds true. -* @gran: The recommended allocation granularity -*/ -void vmw_validation_mem_init_ttm (struct vmw_private *dev_priv,size_t gran) -{ -struct vmw_validation_mem *vvm = &dev_priv->vvm; - - vvm->reserve_mem = vmw_vmt_reserve; - vvm->unreserve_mem = vmw_vmt_unreserve; - vvm->gran = gran; -}
drivers/gpu/drm/vmwgfx/vmwgfx_validation.c +5 -8
@@ -29,6 +29,9 @@#include "vmwgfx_validation.h" #include "vmwgfx_drv.h" + +#define VMWGFX_VALIDATION_MEM_GRAN (16*PAGE_SIZE) +/** * struct vmw_validation_bo_node - Buffer object validation metadata. * @base: Metadata used for TTM reservation- and validation.
@@ -113,13 +116,8 @@ void *vmw_validation_mem_alloc(struct vmw_validation_context *ctx,struct page *page;if (ctx->vm && ctx->vm_size_left <PAGE_SIZE ) { -int ret = ctx->vm->reserve_mem (ctx->vm, ctx->vm->gran); - -if (ret) -return NULL ; - - ctx->vm_size_left += ctx->vm->gran; - ctx->total_mem += ctx->vm->gran; + ctx->vm_size_left +=VMWGFX_VALIDATION_MEM_GRAN ; + ctx->total_mem +=VMWGFX_VALIDATION_MEM_GRAN ; } page =alloc_page (GFP_KERNEL | __GFP_ZERO);
@@ -159,7 +157,6 @@ static void vmw_validation_mem_free(struct vmw_validation_context *ctx) ctx->mem_size_left =0 ;if (ctx->vm && ctx->total_mem) { - ctx->vm->unreserve_mem (ctx->vm, ctx->total_mem); ctx->total_mem =0 ; ctx->vm_size_left =0 ; }
drivers/gpu/drm/vmwgfx/vmwgfx_validation.h +0 -46
64 lines not on this page · raw message
Signature · 1 line
2.32.0
PATCH 2/12 drm/vmwgfx: Add a debug callback to mobid resource manager
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
Mob/GMR id resource manager was lacking the debug print callback which meant that during memory errors we weren't getting the details which are needed to fix those errors.
Kernel logs need to contain the information about used/max pages by the Mob/GMR id resource manager as well as the maximum number of id's they're allowed to allocate.
--- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +15 -1
@@ -42,6 +42,7 @@ struct vmwgfx_gmrid_man {uint32_t max_gmr_ids;uint32_t max_gmr_pages;uint32_t used_gmr_pages; +uint8_t type; };static struct vmwgfx_gmrid_man *to_gmrid_manager (struct ttm_resource_manager *man)
@@ -132,6 +133,18 @@ static void vmw_gmrid_man_put_node(struct ttm_resource_manager *man,kfree (res); } +static void vmw_gmrid_man_debug (struct ttm_resource_manager *man, +struct drm_printer *printer) +{ +struct vmwgfx_gmrid_man *gman =to_gmrid_manager (man); + +BUG_ON (gman->type !=VMW_PL_GMR && gman->type !=VMW_PL_MOB ); + +drm_printf (printer,"%s's used: %u pages, max: %u pages, %u id's\n" , + (gman->type ==VMW_PL_MOB ) ?"Mob" :"GMR" , + gman->used_gmr_pages, gman->max_gmr_pages, gman->max_gmr_ids); +} +static const struct ttm_resource_manager_func vmw_gmrid_manager_func;int vmw_gmrid_man_init (struct vmw_private *dev_priv,int type)
@@ -146,12 +159,12 @@ int vmw_gmrid_man_init(struct vmw_private *dev_priv, int type) man = &gman->manager; man->func = &vmw_gmrid_manager_func; -/* TODO: This is most likely not correct */ man->use_tt = true;ttm_resource_manager_init (man,0 );spin_lock_init (&gman->lock); gman->used_gmr_pages =0 ;ida_init (&gman->gmr_ida); + gman->type = type;switch (type) {case VMW_PL_GMR :
@@ -190,4 +203,5 @@ void vmw_gmrid_man_fini(struct vmw_private *dev_priv, int type)static const struct ttm_resource_manager_func vmw_gmrid_manager_func = { .alloc = vmw_gmrid_man_get_node, .free = vmw_gmrid_man_put_node, + .debug = vmw_gmrid_man_debug };
Signature · 1 line
2.32.0
PATCH 3/12 drm/vmwgfx: Stop hardcoding the PCI ID
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
Instead of hardcoding the VMware's PCI ID the code should be using the public define for it. There's no functional change, it just makes it obvious what we're dealing with.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +2 -2
@@ -254,8 +254,8 @@ static const struct drm_ioctl_desc vmw_ioctls[] = { };static const struct pci_device_id vmw_pci_id_list[] = { - {PCI_DEVICE (0x15ad ,VMWGFX_PCI_ID_SVGA2 ) }, - {PCI_DEVICE (0x15ad ,VMWGFX_PCI_ID_SVGA3 ) }, + {PCI_DEVICE (PCI_VENDOR_ID_VMWARE ,VMWGFX_PCI_ID_SVGA2 ) }, + {PCI_DEVICE (PCI_VENDOR_ID_VMWARE ,VMWGFX_PCI_ID_SVGA3 ) }, { } };MODULE_DEVICE_TABLE (pci, vmw_pci_id_list);
Signature · 1 line
2.32.0
PATCH 4/12 drm/vmwgfx: Implement DRIVER_GEM
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
This is initial change adding support for DRIVER_GEM to vmwgfx. vmwgfx was written before GEM and has always used TTM. Over the years the TTM buffers started inherting from GEM objects but vmwgfx never implemented GEM making it quite awkward. We were directly setting variables in GEM objects to not make DRM crash.
This change brings vmwgfx inline with other DRM drivers and allows us to use a lot of DRM helpers which have depended on drivers with GEM support.
Due to historical reasons vmwgfx splits the idea of a buffer and surface which makes it a littly tricky since either one can be used in most of our ioctl's which take user space handles. For now our BO's are GEM objects and our surfaces are opaque objects which are backed by GEM objects. In the future I'd like to combine those into a single BO but we don't want to break any of our existing ioctl's so it will take time to do it in a non-destructive way.
--- drivers/gpu/drm/vmwgfx/Kconfig | 1 + drivers/gpu/drm/vmwgfx/Makefile | 3 +- drivers/gpu/drm/vmwgfx/ttm_object.c | 114 +--- drivers/gpu/drm/vmwgfx/ttm_object.h | 44 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 517 ++++-------------- drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 8 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 20 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 78 +-- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 18 +- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 13 +- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 13 +- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 294 ++++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 32 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 17 +- .../gpu/drm/vmwgfx/vmwgfx_simple_resource.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 68 +-- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 15 +- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 39 +- drivers/gpu/drm/vmwgfx/vmwgfx_va.c | 2 +- 25 files changed, 588 insertions(+), 745 deletions(-) create mode 100644 drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
drivers/gpu/drm/vmwgfx/Kconfig +1 -0
@@ -4,6 +4,7 @@ config DRM_VMWGFX depends on DRM && PCI && MMU depends on X86 || ARM64 select DRM_TTM + select DRM_TTM_HELPER select MAPPING_DIRTY_HELPERS # Only needed for the transitional use of drm_crtc_init - can be removed # again once vmwgfx sets up the primary plane itself.
drivers/gpu/drm/vmwgfx/Makefile +2 -1
@@ -9,7 +9,8 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_hashtab.o vmwgfx_kms.o vmwgfx_d vmwgfx_cotable.o vmwgfx_so.o vmwgfx_binding.o vmwgfx_msg.o \ vmwgfx_simple_resource.o vmwgfx_va.o vmwgfx_blit.o \ vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \ - vmwgfx_devcaps.o ttm_object.o vmwgfx_system_manager.o + vmwgfx_devcaps.o ttm_object.o vmwgfx_system_manager.o \ + vmwgfx_gem.o vmwgfx-$(CONFIG_DRM_FBDEV_EMULATION) += vmwgfx_fb.o vmwgfx-$(CONFIG_TRANSPARENT_HUGEPAGE) += vmwgfx_thp.o
drivers/gpu/drm/vmwgfx/ttm_object.c +28 -86
253 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/ttm_object.h +4 -40
88 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +110 -407
715 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_context.c +2 -2
@@ -715,7 +715,7 @@ int vmw_context_destroy_ioctl(struct drm_device *dev, void *data,struct drm_vmw_context_arg *arg = (struct drm_vmw_context_arg *)data;struct ttm_object_file *tfile =vmw_fpriv (file_priv)->tfile; -return ttm_ref_object_base_unref (tfile, arg->cid,TTM_REF_USAGE ); +return ttm_ref_object_base_unref (tfile, arg->cid); } static int vmw_context_define(struct drm_device *dev, void *data,
@@ -754,7 +754,7 @@ static int vmw_context_define(struct drm_device *dev, void *data, tmp =vmw_resource_reference (&ctx->res); ret =ttm_base_object_init (tfile, &ctx->base, false,VMW_RES_CONTEXT , - &vmw_user_context_base_release,NULL ); + &vmw_user_context_base_release);if (unlikely (ret !=0 )) {vmw_resource_unreference (&tmp);
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c +2 -6
@@ -407,12 +407,8 @@ static int vmw_cotable_resize(struct vmw_resource *res, size_t new_size)* for the new COTable. Initially pin the buffer object to make sure * we can use tryreserve without failure. */ - buf =kzalloc (sizeof (*buf),GFP_KERNEL ); -if (!buf) -return -ENOMEM ; - - ret =vmw_bo_init (dev_priv, buf, new_size, &vmw_mob_placement, - true, true, vmw_bo_bo_free); + ret =vmw_bo_create (dev_priv, new_size, &vmw_mob_placement, + true, true, vmw_bo_bo_free, &buf);if (ret) {DRM_ERROR ("Failed initializing new cotable MOB.\n" );return ret;
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +9 -11
@@ -34,6 +34,7 @@#include <drm/drm_drv.h> #include <drm/drm_ioctl.h> #include <drm/drm_sysfs.h> +#include <drm/drm_gem_ttm_helper.h> #include <drm/ttm/ttm_bo_driver.h> #include <drm/ttm/ttm_range_manager.h> #include <drm/ttm/ttm_placement.h>
@@ -162,7 +163,7 @@static const struct drm_ioctl_desc vmw_ioctls[] = {DRM_IOCTL_DEF_DRV (VMW_GET_PARAM , vmw_getparam_ioctl,DRM_RENDER_ALLOW ), -DRM_IOCTL_DEF_DRV (VMW_ALLOC_DMABUF , vmw_bo_alloc_ioctl, +DRM_IOCTL_DEF_DRV (VMW_ALLOC_DMABUF , vmw_gem_object_create_ioctl,DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (VMW_UNREF_DMABUF , vmw_bo_unref_ioctl,DRM_RENDER_ALLOW ),
@@ -396,13 +397,9 @@ static int vmw_dummy_query_bo_create(struct vmw_private *dev_priv)* immediately succeed. This is because we're the only * user of the bo currently. */ - vbo =kzalloc (sizeof (*vbo),GFP_KERNEL ); -if (!vbo) -return -ENOMEM ; - - ret =vmw_bo_init (dev_priv, vbo,PAGE_SIZE , - &vmw_sys_placement, false, true, - &vmw_bo_bo_free); + ret =vmw_bo_create (dev_priv,PAGE_SIZE , + &vmw_sys_placement, false, true, + &vmw_bo_bo_free, &vbo);if (unlikely (ret !=0 ))return ret;
@@ -1578,7 +1575,7 @@ static const struct file_operations vmwgfx_driver_fops = {static const struct drm_driver driver = { .driver_features = -DRIVER_MODESET |DRIVER_RENDER |DRIVER_ATOMIC , +DRIVER_MODESET |DRIVER_RENDER |DRIVER_ATOMIC |DRIVER_GEM , .ioctls = vmw_ioctls, .num_ioctls =ARRAY_SIZE (vmw_ioctls), .master_set = vmw_master_set,
@@ -1587,8 +1584,7 @@ static const struct drm_driver driver = { .postclose = vmw_postclose, .dumb_create = vmw_dumb_create, - .dumb_map_offset = vmw_dumb_map_offset, - .dumb_destroy = vmw_dumb_destroy, + .dumb_map_offset = drm_gem_ttm_dumb_map_offset, .prime_fd_to_handle = vmw_prime_fd_to_handle, .prime_handle_to_fd = vmw_prime_handle_to_fd,
@@ -1642,6 +1638,8 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret) goto out_unload; +vmw_debugfs_gem_init (vmw); +return 0 ; out_unload:vmw_driver_unload (&vmw->drm);
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +43 -35
141 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +8 -10
@@ -1171,14 +1171,13 @@ static int vmw_translate_mob_ptr(struct vmw_private *dev_priv,int ret;vmw_validation_preload_bo (sw_context->ctx); - vmw_bo =vmw_user_bo_noref_lookup (sw_context->fp->tfile, handle); -if (IS_ERR (vmw_bo)) { + vmw_bo =vmw_user_bo_noref_lookup (sw_context->filp, handle); +if (IS_ERR_OR_NULL (vmw_bo)) {VMW_DEBUG_USER ("Could not find or use MOB buffer.\n" );return PTR_ERR (vmw_bo); } - ret =vmw_validation_add_bo (sw_context->ctx, vmw_bo, true, false); -vmw_user_bo_noref_release (); +ttm_bo_put (&vmw_bo->base);if (unlikely (ret !=0 ))return ret;
@@ -1226,14 +1225,13 @@ static int vmw_translate_guest_ptr(struct vmw_private *dev_priv,int ret;vmw_validation_preload_bo (sw_context->ctx); - vmw_bo =vmw_user_bo_noref_lookup (sw_context->fp->tfile, handle); -if (IS_ERR (vmw_bo)) { + vmw_bo =vmw_user_bo_noref_lookup (sw_context->filp, handle); +if (IS_ERR_OR_NULL (vmw_bo)) {VMW_DEBUG_USER ("Could not find or use GMR region.\n" );return PTR_ERR (vmw_bo); } - ret =vmw_validation_add_bo (sw_context->ctx, vmw_bo, false, false); -vmw_user_bo_noref_release (); +ttm_bo_put (&vmw_bo->base);if (unlikely (ret !=0 ))return ret;
@@ -3869,8 +3867,7 @@ vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv, fence_rep.fd =-1 ; } -ttm_ref_object_base_unref (vmw_fp->tfile, fence_handle, -TTM_REF_USAGE ); +ttm_ref_object_base_unref (vmw_fp->tfile, fence_handle);VMW_DEBUG_USER ("Fence copy error. Syncing.\n" ); (void )vmw_fence_obj_wait (fence, false, false,VMW_FENCE_WAIT_TIMEOUT );
@@ -4099,6 +4096,7 @@ int vmw_execbuf_process(struct drm_file *file_priv, sw_context->kernel = true; } + sw_context->filp = file_priv; sw_context->fp =vmw_fpriv (file_priv);INIT_LIST_HEAD (&sw_context->ctx_list); sw_context->cur_query_bo = dev_priv->pinned_bo;
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +3 -10
@@ -394,22 +394,15 @@ static int vmw_fb_create_bo(struct vmw_private *vmw_priv,struct vmw_buffer_object *vmw_bo;int ret; - vmw_bo =kmalloc (sizeof (*vmw_bo),GFP_KERNEL ); -if (!vmw_bo) { - ret = -ENOMEM ; - goto err_unlock; - } - - ret =vmw_bo_init (vmw_priv, vmw_bo, size, + ret =vmw_bo_create (vmw_priv, size, &vmw_sys_placement, false, false, - &vmw_bo_bo_free); + &vmw_bo_bo_free, &vmw_bo);if (unlikely (ret !=0 )) - goto err_unlock;/* init frees the buffer on failure */ +return ret; *out = vmw_bo; -err_unlock:return ret; }
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +6 -7
@@ -596,9 +596,10 @@ int vmw_user_fence_create(struct drm_file *file_priv,* vmw_user_fence_base_release. */ tmp =vmw_fence_obj_reference (&ufence->fence); + ret =ttm_base_object_init (tfile, &ufence->base, false,VMW_RES_FENCE , - &vmw_user_fence_base_release,NULL ); + &vmw_user_fence_base_release);if (unlikely (ret !=0 )) {
@@ -801,8 +802,7 @@ int vmw_fence_obj_wait_ioctl(struct drm_device *dev, void *data,*/ if (ret ==0 && (arg->wait_options &DRM_VMW_WAIT_OPTION_UNREF )) -return ttm_ref_object_base_unref (tfile, arg->handle, -TTM_REF_USAGE ); +return ttm_ref_object_base_unref (tfile, arg->handle);return ret; }
@@ -844,8 +844,7 @@ int vmw_fence_obj_unref_ioctl(struct drm_device *dev, void *data, (struct drm_vmw_fence_arg *) data;return ttm_ref_object_base_unref (vmw_fpriv (file_priv)->tfile, - arg->handle, -TTM_REF_USAGE ); + arg->handle); }/**
@@ -1091,7 +1090,7 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data,if (user_fence_rep !=NULL ) { ret =ttm_ref_object_add (vmw_fp->tfile, base, -TTM_REF_USAGE ,NULL , false); +NULL , false);if (unlikely (ret !=0 )) {DRM_ERROR ("Failed to reference a fence " "object.\n" );
@@ -1134,7 +1133,7 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data,return 0 ; out_no_create:if (user_fence_rep !=NULL ) -ttm_ref_object_base_unref (tfile, handle,TTM_REF_USAGE ); +ttm_ref_object_base_unref (tfile, handle); out_no_ref_obj:vmw_fence_obj_unreference (&fence);return ret;
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c new file +294 -0
294 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3 -29
@@ -843,8 +843,6 @@ static void vmw_framebuffer_surface_destroy(struct drm_framebuffer *framebuffer)drm_framebuffer_cleanup (framebuffer);vmw_surface_unreference (&vfbs->surface); -if (vfbs->base.user_obj) -ttm_base_object_unref (&vfbs->base.user_obj);kfree (vfbs); }
@@ -996,8 +994,6 @@ static void vmw_framebuffer_bo_destroy(struct drm_framebuffer *framebuffer)drm_framebuffer_cleanup (framebuffer);vmw_bo_unreference (&vfbd->buffer); -if (vfbd->base.user_obj) -ttm_base_object_unref (&vfbd->base.user_obj);kfree (vfbd); }
@@ -1251,6 +1247,7 @@ static int vmw_kms_new_framebuffer_bo(struct vmw_private *dev_priv, goto out_err1; } + vfbd->base.base.obj[0 ] = &bo->base.base;drm_helper_mode_fill_fb_struct (dev, &vfbd->base.base, mode_cmd); vfbd->base.bo = true; vfbd->buffer =vmw_bo_reference (bo);
@@ -1368,34 +1365,13 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd) {struct vmw_private *dev_priv =vmw_priv (dev); -struct ttm_object_file *tfile =vmw_fpriv (file_priv)->tfile;struct vmw_framebuffer *vfb =NULL ;struct vmw_surface *surface =NULL ;struct vmw_buffer_object *bo =NULL ; -struct ttm_base_object *user_obj;int ret; -/* -* Take a reference on the user object of the resource -* backing the kms fb. This ensures that user-space handle -* lookups on that resource will always work as long as -* it's registered with a kms framebuffer. This is important, -* since vmw_execbuf_process identifies resources in the -* command stream using user-space handles. -*/ - - user_obj =ttm_base_object_lookup (tfile, mode_cmd->handles[0 ]); -if (unlikely (user_obj ==NULL )) { -DRM_ERROR ("Could not locate requested kms frame buffer.\n" ); -return ERR_PTR (-ENOENT ); - } - -/** -* End conditioned code. -*/ -/* returns either a bo or surface */ - ret =vmw_user_lookup_handle (dev_priv, tfile, + ret =vmw_user_lookup_handle (dev_priv, file_priv, mode_cmd->handles[0 ], &surface, &bo);if (ret)
@@ -1428,10 +1404,8 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,if (ret) {DRM_ERROR ("failed to create vmw_framebuffer: %i\n" , ret); -ttm_base_object_unref (&user_obj);return ERR_PTR (ret); - }else - vfb->user_obj = user_obj; + }return &vfb->base; }
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +0 -1
@@ -219,7 +219,6 @@ struct vmw_framebuffer {int (*pin)(struct vmw_framebuffer *fb);int (*unpin)(struct vmw_framebuffer *fb);bool bo; -struct ttm_base_object *user_obj;uint32_t user_handle; };
drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +1 -1
@@ -451,7 +451,7 @@ int vmw_overlay_ioctl(struct drm_device *dev, void *data, goto out_unlock; } - ret =vmw_user_bo_lookup (tfile, arg->handle, &buf,NULL ); + ret =vmw_user_bo_lookup (file_priv, arg->handle, &buf);if (ret) goto out_unlock;
drivers/gpu/drm/vmwgfx/vmwgfx_prime.c +0 -1
@@ -85,6 +85,5 @@ int vmw_prime_handle_to_fd(struct drm_device *dev, int *prime_fd) {struct ttm_object_file *tfile =vmw_fpriv (file_priv)->tfile; -return ttm_prime_handle_to_fd (tfile, handle, flags, prime_fd); }
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +7 -10
@@ -320,11 +320,12 @@ vmw_user_resource_noref_lookup_handle(struct vmw_private *dev_priv,* The pointer this pointed at by out_surf and out_buf needs to be null. */ int vmw_user_lookup_handle (struct vmw_private *dev_priv, -struct ttm_object_file *tfile, +struct drm_file *filp,uint32_t handle,struct vmw_surface **out_surf,struct vmw_buffer_object **out_buf) { +struct ttm_object_file *tfile =vmw_fpriv (filp)->tfile;struct vmw_resource *res;int ret;
@@ -339,7 +340,7 @@ int vmw_user_lookup_handle(struct vmw_private *dev_priv, } *out_surf =NULL ; - ret =vmw_user_bo_lookup (tfile, handle, out_buf,NULL ); + ret =vmw_user_bo_lookup (filp, handle, out_buf);return ret; }
@@ -362,14 +363,10 @@ static int vmw_resource_buf_alloc(struct vmw_resource *res,return 0 ; } - backup =kzalloc (sizeof (*backup),GFP_KERNEL ); -if (unlikely (!backup)) -return -ENOMEM ; - - ret =vmw_bo_init (res->dev_priv, backup, res->backup_size, - res->func->backup_placement, - interruptible, false, - &vmw_bo_bo_free); + ret =vmw_bo_create (res->dev_priv, res->backup_size, + res->func->backup_placement, + interruptible, false, + &vmw_bo_bo_free, &backup);if (unlikely (ret !=0 )) goto out_no_bo;
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +3 -7
@@ -442,19 +442,15 @@ vmw_sou_primary_plane_prepare_fb(struct drm_plane *plane, vps->bo_size =0 ; } - vps->bo =kzalloc (sizeof (*vps->bo),GFP_KERNEL ); -if (!vps->bo) -return -ENOMEM ; -vmw_svga_enable (dev_priv);/* After we have alloced the backing store might not be able to * resume the overlays, this is preferred to failing to alloc. */ vmw_overlay_pause_all (dev_priv); - ret =vmw_bo_init (dev_priv, vps->bo, size, - &vmw_vram_placement, - false, true, &vmw_bo_bo_free); + ret =vmw_bo_create (dev_priv, size, + &vmw_vram_placement, + false, true, &vmw_bo_bo_free, &vps->bo);vmw_overlay_resume_all (dev_priv);if (ret) { vps->bo =NULL ;/* vmw_bo_init frees on error */
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +5 -12
@@ -676,8 +676,7 @@ int vmw_shader_destroy_ioctl(struct drm_device *dev, void *data,struct drm_vmw_shader_arg *arg = (struct drm_vmw_shader_arg *)data;struct ttm_object_file *tfile =vmw_fpriv (file_priv)->tfile; -return ttm_ref_object_base_unref (tfile, arg->handle, -TTM_REF_USAGE ); +return ttm_ref_object_base_unref (tfile, arg->handle); } static int vmw_user_shader_alloc(struct vmw_private *dev_priv,
@@ -718,7 +717,7 @@ static int vmw_user_shader_alloc(struct vmw_private *dev_priv, tmp =vmw_resource_reference (res); ret =ttm_base_object_init (tfile, &ushader->base, false,VMW_RES_SHADER , - &vmw_user_shader_base_release,NULL ); + &vmw_user_shader_base_release);if (unlikely (ret !=0 )) {vmw_resource_unreference (&tmp);
@@ -777,8 +776,7 @@ static int vmw_shader_define(struct drm_device *dev, struct drm_file *file_priv,int ret;if (buffer_handle !=SVGA3D_INVALID_ID ) { - ret =vmw_user_bo_lookup (tfile, buffer_handle, - &buffer,NULL ); + ret =vmw_user_bo_lookup (file_priv, buffer_handle, &buffer);if (unlikely (ret !=0 )) {VMW_DEBUG_USER ("Couldn't find buffer for shader creation.\n" );return ret;
@@ -894,13 +892,8 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv,if (!vmw_shader_id_ok (user_key, shader_type))return -EINVAL ; -/* Allocate and pin a DMA buffer */ - buf =kzalloc (sizeof (*buf),GFP_KERNEL ); -if (unlikely (!buf)) -return -ENOMEM ; - - ret =vmw_bo_init (dev_priv, buf, size, &vmw_sys_placement, - true, true, vmw_bo_bo_free); + ret =vmw_bo_create (dev_priv, size, &vmw_sys_placement, + true, true, vmw_bo_bo_free, &buf);if (unlikely (ret !=0 )) goto out;
drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c +1 -1
@@ -172,7 +172,7 @@ vmw_simple_resource_create_ioctl(struct drm_device *dev, void *data, tmp =vmw_resource_reference (res); ret =ttm_base_object_init (tfile, &usimple->base, false, func->ttm_res_type, - &vmw_simple_resource_base_release,NULL ); + &vmw_simple_resource_base_release);if (ret) {vmw_resource_unreference (&tmp);
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +29 -39
171 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +2 -13
@@ -167,18 +167,6 @@ struct ttm_placement vmw_nonfixed_placement = { .busy_placement = &sys_placement_flags }; -struct vmw_ttm_tt { -struct ttm_tt dma_ttm; -struct vmw_private *dev_priv; -int gmr_id; -struct vmw_mob *mob; -int mem_type; -struct sg_table sgt; -struct vmw_sg_table vsgt; -bool mapped; -bool bound; -}; -const size_t vmw_tt_size =sizeof (struct vmw_ttm_tt );/**
@@ -311,11 +299,12 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt) vsgt->pages = vmw_tt->dma_ttm.pages; vsgt->num_pages = vmw_tt->dma_ttm.num_pages; vsgt->addrs = vmw_tt->dma_ttm.dma_address; - vsgt->sgt = &vmw_tt->sgt; + vsgt->sgt =NULL ;switch (dev_priv->map_mode) {case vmw_dma_map_bind:case vmw_dma_map_populate: + vsgt->sgt = &vmw_tt->sgt; ret = sg_alloc_table_from_pages_segment( &vmw_tt->sgt, vsgt->pages, vsgt->num_pages, 0, (unsigned long)vsgt->num_pages << PAGE_SHIFT,
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c +24 -15
@@ -27,30 +27,44 @@#include "vmwgfx_drv.h" -static struct ttm_buffer_object *vmw_bo_vm_lookup (struct ttm_device *bdev, -unsigned long offset, -unsigned long pages) +static int vmw_bo_vm_lookup (struct ttm_device *bdev, +struct drm_file *filp, +unsigned long offset, +unsigned long pages, +struct ttm_buffer_object **p_bo) { struct vmw_private *dev_priv = container_of(bdev, struct vmw_private, bdev);struct drm_device *drm = &dev_priv->drm;struct drm_vma_offset_node *node; -struct ttm_buffer_object *bo =NULL ; +int ret; + + *p_bo =NULL ;drm_vma_offset_lock_lookup (bdev->vma_manager); node =drm_vma_offset_lookup_locked (bdev->vma_manager, offset, pages);if (likely (node)) { - bo = container_of(node, struct ttm_buffer_object, + *p_bo = container_of(node, struct ttm_buffer_object, base.vma_node); - bo =ttm_bo_get_unless_zero (bo); + *p_bo =ttm_bo_get_unless_zero (*p_bo); }drm_vma_offset_unlock_lookup (bdev->vma_manager); -if (!bo) +if (!*p_bo) {drm_err (drm,"Could not find buffer object to map\n" ); +return -EINVAL ; + } + +if (!drm_vma_node_is_allowed (node, filp)) { + ret = -EACCES ; + goto out_no_access; + } -return bo; +return 0 ; +out_no_access: +ttm_bo_put (*p_bo); +return ret; }int vmw_mmap (struct file *filp,struct vm_area_struct *vma)
@@ -64,7 +78,6 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma) };struct drm_file *file_priv = filp->private_data;struct vmw_private *dev_priv =vmw_priv (file_priv->minor->dev); -struct ttm_object_file *tfile =vmw_fpriv (file_priv)->tfile;struct ttm_device *bdev = &dev_priv->bdev;struct ttm_buffer_object *bo;int ret;
@@ -72,13 +85,9 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma)if (unlikely (vma->vm_pgoff <DRM_FILE_PAGE_OFFSET_START ))return -EINVAL ; - bo =vmw_bo_vm_lookup (bdev, vma->vm_pgoff,vma_pages (vma)); -if (unlikely (!bo)) -return -EINVAL ; - - ret =vmw_user_bo_verify_access (bo, tfile); + ret =vmw_bo_vm_lookup (bdev, file_priv, vma->vm_pgoff,vma_pages (vma), &bo);if (unlikely (ret !=0 )) - goto out_unref; +return ret; ret =ttm_bo_mmap_obj (vma, bo);if (unlikely (ret !=0 ))
drivers/gpu/drm/vmwgfx/vmwgfx_va.c +1 -1
@@ -117,7 +117,7 @@ int vmw_stream_unref_ioctl(struct drm_device *dev, void *data,struct drm_vmw_stream_arg *arg = (struct drm_vmw_stream_arg *)data;return ttm_ref_object_base_unref (vmw_fpriv (file_priv)->tfile, - arg->stream_id,TTM_REF_USAGE ); + arg->stream_id); }/**
Signature · 1 line
2.32.0
PATCH 5/12 drm/vmwgfx: Implement create_handle on drm_framebuffer_funcs
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
The fb handle code assumes it deals with GEM objects. Because vmwgfx buffer objects were not actually GEM objects we were not able to implement that interface. Now that vmwgfx supports GEM buffer objects we can trivially implement create_handle for buffer object backed framebuffers.
Among others this gets IGT's kms_getfb test passing.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +11 -0
@@ -987,6 +987,16 @@ static int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv,* Buffer-object framebuffer code */ +static int vmw_framebuffer_bo_create_handle (struct drm_framebuffer *fb, +struct drm_file *file_priv, +unsigned int *handle) +{ +struct vmw_framebuffer_bo *vfbd = +vmw_framebuffer_to_vfbd (fb); + +return drm_gem_handle_create (file_priv, &vfbd->buffer->base.base, handle); +} +static void vmw_framebuffer_bo_destroy (struct drm_framebuffer *framebuffer) { struct vmw_framebuffer_bo *vfbd =
@@ -1059,6 +1069,7 @@ static int vmw_framebuffer_bo_dirty_ext(struct drm_framebuffer *framebuffer, }static const struct drm_framebuffer_funcs vmw_framebuffer_bo_funcs = { + .create_handle = vmw_framebuffer_bo_create_handle, .destroy = vmw_framebuffer_bo_destroy, .dirty = vmw_framebuffer_bo_dirty_ext, };
Signature · 1 line
2.32.0
PATCH 6/12 drm/vmwgfx: Update device headers for GL43
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
Update the headers for GL43 userspace works that landed in Mesa3D. Also update the license headers to conform to the kernel guidelines.
For GL43 the virtual device got D3D11.1 support with some GL extensions.
--- drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h | 6 +++--- .../gpu/drm/vmwgfx/device_include/svga3d_devcaps.h | 10 +++++++--- drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h | 12 ++++++------ .../gpu/drm/vmwgfx/device_include/svga3d_limits.h | 8 +++++--- drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h | 6 +++--- .../gpu/drm/vmwgfx/device_include/svga3d_types.h | 7 +++---- .../gpu/drm/vmwgfx/device_include/svga_escape.h | 6 +++--- .../gpu/drm/vmwgfx/device_include/svga_overlay.h | 6 +++--- drivers/gpu/drm/vmwgfx/device_include/svga_reg.h | 14 ++++++++------ 9 files changed, 41 insertions(+), 34 deletions(-)
drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h +3 -3
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 2012-2021 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga3d_cmd.h --
drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h +7 -3
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 1998-2021 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga3d_devcaps.h --
@@ -347,6 +347,10 @@ typedef uint32 SVGA3dDevCapIndex;#define SVGA3D_DEVCAP_SM5 258#define SVGA3D_DEVCAP_MULTISAMPLE_8X 259 +#define SVGA3D_DEVCAP_MAX_FORCED_SAMPLE_COUNT 260 + +#define SVGA3D_DEVCAP_GL43 261 +#define SVGA3D_DEVCAP_MAX 262#define SVGA3D_DXFMT_SUPPORTED (1 << 0)
drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h +6 -6
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 2012-2021 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga3d_dx.h --
@@ -508,11 +508,11 @@ typedef struct SVGA3dCmdDXSetPredication {#pragma pack(pop)#pragma pack(push, 1) -typedef struct MKS3dDXSOState { +typedef struct SVGA3dDXSOState {uint32 offset;uint32 intOffset; -uint32 vertexCount; -uint32 dead; +uint32 dead1; +uint32 dead2; }SVGA3dDXSOState ;#pragma pack(pop)
drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h +5 -3
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 2012-2021 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga3d_limits.h --
@@ -82,4 +82,6 @@#define SVGA3D_MIN_SBX_DATA_SIZE (GBYTES_2_BYTES(1))#define SVGA3D_MAX_SBX_DATA_SIZE (GBYTES_2_BYTES(4)) +#define SVGA3D_MIN_SBX_DATA_SIZE_DVM (MBYTES_2_BYTES(900)) +#define SVGA3D_MAX_SBX_DATA_SIZE_DVM (MBYTES_2_BYTES(910))#endif
drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h +3 -3
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 1998-2015 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga3d_reg.h --
drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h +3 -4
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 2012-2021 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga3d_types.h --
@@ -370,7 +370,6 @@ typedef enum SVGA3dSurfaceFormat {#define SVGA3D_SURFACE_TRANSFER_FROM_BUFFER (CONST64U(1) << 30)#define SVGA3D_SURFACE_RESERVED1 (CONST64U(1) << 31) -#define SVGA3D_SURFACE_VADECODE SVGA3D_SURFACE_RESERVED1#define SVGA3D_SURFACE_MULTISAMPLE (CONST64U(1) << 32)
drivers/gpu/drm/vmwgfx/device_include/svga_escape.h +3 -3
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 2007,2020 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga_escape.h --
drivers/gpu/drm/vmwgfx/device_include/svga_overlay.h +3 -3
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 2007-2021 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga_overlay.h --
drivers/gpu/drm/vmwgfx/device_include/svga_reg.h +8 -6
@@ -1,6 +1,6 @@ -/********************************************************** +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* * Copyright 1998-2021 VMware, Inc. -* SPDX-License-Identifier: GPL-2.0 OR MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation
@@ -22,7 +22,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -**********************************************************/ +*/ /* * svga_reg.h --
@@ -442,6 +442,7 @@ typedef struct {#define SVGA_CAP2_TRACE_FULL_FB 0x00002000#define SVGA_CAP2_EXTRA_REGS 0x00004000#define SVGA_CAP2_LO_STAGING 0x00008000 +#define SVGA_CAP2_VIDEO_BLT 0x00010000#define SVGA_CAP2_RESERVED 0x80000000 typedef enum {
@@ -450,9 +451,10 @@ typedef enum { SVGABackdoorCap3dHWVersion =2 , SVGABackdoorCapDeviceCaps2 =3 , SVGABackdoorCapDevelCaps =4 , - SVGABackdoorDevelRenderer =5 , - SVGABackdoorDevelUsingISB =6 , - SVGABackdoorCapMax =7 , + SVGABackdoorCapDevCaps =5 , + SVGABackdoorDevelRenderer =6 , + SVGABackdoorDevelUsingISB =7 , + SVGABackdoorCapMax =8 , } SVGABackdoorCapType; enum {
Signature · 1 line
2.32.0
Re: [PATCH 06/12] drm/vmwgfx: Update device headers for GL43
Quoted 8 lines · Zack Rusin
From: Zack Rusin <[email protected]>
Update the headers for GL43 userspace works that landed in Mesa3D. Also update the license headers to conform to the kernel guidelines.
For GL43 the virtual device got D3D11.1 support with some GL extensions.
Signed-off-by Zack Rusin <[email protected]>
Quoted 11 lines
--- drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h | 6 +++--- .../gpu/drm/vmwgfx/device_include/svga3d_devcaps.h | 10 +++++++--- drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h | 12 ++++++------ .../gpu/drm/vmwgfx/device_include/svga3d_limits.h | 8 +++++--- drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h | 6 +++--- .../gpu/drm/vmwgfx/device_include/svga3d_types.h | 7 +++---- .../gpu/drm/vmwgfx/device_include/svga_escape.h | 6 +++--- .../gpu/drm/vmwgfx/device_include/svga_overlay.h | 6 +++--- drivers/gpu/drm/vmwgfx/device_include/svga_reg.h | 14 ++++++++------ 9 files changed, 41 insertions(+), 34 deletions(-)
PATCH 7/12 drm/vmwgfx: support SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2 command
In reply to Zack RusinFrom: Roland Scheidegger <[email protected]>
This is going to be required for setting the sample count when rendering with no attachments.
Also cleans up view handling (should fix depthstencil_v2).
--- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_so.c | 4 ++++ drivers/gpu/drm/vmwgfx/vmwgfx_so.h | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +2 -0
@@ -3559,6 +3559,8 @@ static const struct vmw_cmd_entry vmw_cmd_entries[SVGA_3D_CMD_MAX] = { &vmw_cmd_dx_define_streamoutput, true, false, true), VMW_CMD_DEF(SVGA_3D_CMD_DX_BIND_STREAMOUTPUT, &vmw_cmd_dx_bind_streamoutput, true, false, true), + VMW_CMD_DEF(SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2, + &vmw_cmd_dx_so_define, true, false, true), };bool vmw_cmd_describe (const void *buf,u32 *size,char const **cmd)
drivers/gpu/drm/vmwgfx/vmwgfx_so.c +4 -0
@@ -567,4 +567,8 @@ static void vmw_so_build_asserts(void) offsetof(SVGA3dCmdDXDefineRenderTargetView, sid));BUILD_BUG_ON (offsetof(struct vmw_view_define , sid) != offsetof(SVGA3dCmdDXDefineDepthStencilView , sid)); +BUILD_BUG_ON (offsetof(struct vmw_view_define , sid) != + offsetof(SVGA3dCmdDXDefineUAView , sid)); +BUILD_BUG_ON (offsetof(struct vmw_view_define , sid) != + offsetof(SVGA3dCmdDXDefineDepthStencilView_v2 , sid)); }
drivers/gpu/drm/vmwgfx/vmwgfx_so.h +5 -1
@@ -93,7 +93,10 @@ static inline enum vmw_view_type vmw_view_cmd_to_type(u32 id) id == SVGA_3D_CMD_DX_DESTROY_UA_VIEW)return vmw_view_ua; -if (tmp > (u32 )vmw_view_max) +if (id ==SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW_V2 ) +return vmw_view_ds; + +if (tmp > (u32 )vmw_view_ds)return vmw_view_max;return (enum vmw_view_type ) tmp;
@@ -123,6 +126,7 @@ static inline enum vmw_so_type vmw_so_cmd_to_type(u32 id)case SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE :return vmw_so_ds;case SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE : +case SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2 :case SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE :return vmw_so_rs;case SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE :
Signature · 1 line
2.32.0
PATCH 8/12 drm/vmwgfx: support 64 UAVs
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
If the host supports SVGA3D_DEVCAP_GL43, we can handle 64 instead of just 8 UAVs.
Based on a patch from Roland Scheidegger <[email protected]>.
--- drivers/gpu/drm/vmwgfx/vmwgfx_binding.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_binding.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++++- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 20 ++++++++++++++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 ++-- 5 files changed, 30 insertions(+), 6 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_binding.c +2 -2
@@ -1070,7 +1070,7 @@ static int vmw_emit_set_uav(struct vmw_ctx_binding_state *cbs)size_t cmd_size, view_id_size;const struct vmw_resource *ctx =vmw_cbs_context (cbs); -vmw_collect_view_ids (cbs, loc,SVGA3D_MAX_UAVIEWS ); +vmw_collect_view_ids (cbs, loc,vmw_max_num_uavs (cbs->dev_priv)); view_id_size = cbs->bind_cmd_count*sizeof (uint32); cmd_size =sizeof (*cmd) + view_id_size; cmd =VMW_CMD_CTX_RESERVE (ctx->dev_priv, cmd_size, ctx->id);
@@ -1100,7 +1100,7 @@ static int vmw_emit_set_cs_uav(struct vmw_ctx_binding_state *cbs)size_t cmd_size, view_id_size;const struct vmw_resource *ctx =vmw_cbs_context (cbs); -vmw_collect_view_ids (cbs, loc,SVGA3D_MAX_UAVIEWS ); +vmw_collect_view_ids (cbs, loc,vmw_max_num_uavs (cbs->dev_priv)); view_id_size = cbs->bind_cmd_count*sizeof (uint32); cmd_size =sizeof (*cmd) + view_id_size; cmd =VMW_CMD_CTX_RESERVE (ctx->dev_priv, cmd_size, ctx->id);
drivers/gpu/drm/vmwgfx/vmwgfx_binding.h +1 -1
@@ -200,7 +200,7 @@ struct vmw_dx_shader_bindings {* @splice_index: The device splice index set by user-space. */ struct vmw_ctx_bindinfo_uav { -struct vmw_ctx_bindinfo_view views[SVGA3D_MAX_UAVIEWS ]; +struct vmw_ctx_bindinfo_view views[SVGA3D_DX11_1_MAX_UAVIEWS ];uint32 index; };
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +5 -1
@@ -364,6 +364,7 @@ static void vmw_print_sm_type(struct vmw_private *dev_priv) [VMW_SM_4] = "SM4", [VMW_SM_4_1] = "SM4_1", [VMW_SM_5] = "SM_5", + [VMW_SM_5_1X] = "SM_5_1X", [VMW_SM_MAX ] ="Invalid" };BUILD_BUG_ON (ARRAY_SIZE (names) != (VMW_SM_MAX +1 ));
@@ -1083,8 +1084,11 @@ static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id) dev_priv->sm_type =VMW_SM_4_1 ;if (has_sm4_1_context (dev_priv) && (dev_priv->capabilities2 &SVGA_CAP2_DX3 )) { -if (vmw_devcap_get (dev_priv,SVGA3D_DEVCAP_SM5 )) +if (vmw_devcap_get (dev_priv,SVGA3D_DEVCAP_SM5 )) { dev_priv->sm_type =VMW_SM_5 ; +if (vmw_devcap_get (dev_priv,SVGA3D_DEVCAP_GL43 )) + dev_priv->sm_type =VMW_SM_5_1X ; + } } }
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +20 -0
@@ -488,6 +488,7 @@ enum {* @VMW_SM_4: Context support upto SM4. * @VMW_SM_4_1: Context support upto SM4_1. * @VMW_SM_5: Context support up to SM5. +* @VMW_SM_5_1X: Adds support for sm5_1 and gl43 extensions. * @VMW_SM_MAX: Should be the last. */ enum vmw_sm_type {
@@ -495,6 +496,7 @@ enum vmw_sm_type {VMW_SM_4 ,VMW_SM_4_1 ,VMW_SM_5 , +VMW_SM_5_1X , VMW_SM_MAX };
@@ -755,6 +757,24 @@ static inline bool has_sm5_context(const struct vmw_private *dev_priv)return (dev_priv->sm_type >=VMW_SM_5 ); } +/** +* has_gl43_context - Does the device support GL43 context. +* @dev_priv: Device private. +* +* Return: Bool value if device support SM5 context or not. +*/ +static inline bool has_gl43_context (const struct vmw_private *dev_priv) +{ +return (dev_priv->sm_type >=VMW_SM_5_1X ); +} + + +static inline u32 vmw_max_num_uavs (struct vmw_private *dev_priv) +{ +return (has_gl43_context (dev_priv) ? +SVGA3D_DX11_1_MAX_UAVIEWS :SVGA3D_MAX_UAVIEWS ); +} +extern void vmw_svga_enable (struct vmw_private *dev_priv);extern void vmw_svga_disable (struct vmw_private *dev_priv);
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +2 -2
@@ -2916,7 +2916,7 @@ static int vmw_cmd_set_uav(struct vmw_private *dev_priv,if (!has_sm5_context (dev_priv))return -EINVAL ; -if (num_uav >SVGA3D_MAX_UAVIEWS ) { +if (num_uav >vmw_max_num_uavs (dev_priv)) {VMW_DEBUG_USER ("Invalid UAV binding.\n" );return -EINVAL ; }
@@ -2948,7 +2948,7 @@ static int vmw_cmd_set_cs_uav(struct vmw_private *dev_priv,if (!has_sm5_context (dev_priv))return -EINVAL ; -if (num_uav >SVGA3D_MAX_UAVIEWS ) { +if (num_uav >vmw_max_num_uavs (dev_priv)) {VMW_DEBUG_USER ("Invalid UAV binding.\n" );return -EINVAL ; }
Signature · 1 line
2.32.0
Re: [PATCH 08/12] drm/vmwgfx: support 64 UAVs
Quoted 135 lines · Zack Rusin
From: Zack Rusin <[email protected]>
If the host supports
SVGA3D_DEVCAP_GL43, we can handle 64 instead of just 8 UAVs.
Based on a patch from Roland Scheidegger <[email protected]>.Signed-off-by Roland Scheidegger <[email protected]>Signed-off-by Zack Rusin <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_binding.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_binding.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++++- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 20 ++++++++++++++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 ++-- 5 files changed, 30 insertions(+), 6 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_binding.c +2
-2@@ -1070,7 +1070,7 @@ static int vmw_emit_set_uav(struct vmw_ctx_binding_state *cbs)size_t cmd_size, view_id_size;const struct vmw_resource *ctx =vmw_cbs_context (cbs); -vmw_collect_view_ids (cbs, loc,SVGA3D_MAX_UAVIEWS ); +vmw_collect_view_ids (cbs, loc,vmw_max_num_uavs (cbs->dev_priv)); view_id_size = cbs->bind_cmd_count*sizeof (uint32); cmd_size =sizeof (*cmd) + view_id_size; cmd =VMW_CMD_CTX_RESERVE (ctx->dev_priv, cmd_size, ctx->id);@@ -1100,7 +1100,7 @@ static int vmw_emit_set_cs_uav(struct vmw_ctx_binding_state *cbs)size_t cmd_size, view_id_size;const struct vmw_resource *ctx =vmw_cbs_context (cbs); -vmw_collect_view_ids (cbs, loc,SVGA3D_MAX_UAVIEWS ); +vmw_collect_view_ids (cbs, loc,vmw_max_num_uavs (cbs->dev_priv)); view_id_size = cbs->bind_cmd_count*sizeof (uint32); cmd_size =sizeof (*cmd) + view_id_size; cmd =VMW_CMD_CTX_RESERVE (ctx->dev_priv, cmd_size, ctx->id);drivers/gpu/drm/vmwgfx/vmwgfx_binding.h +1
-1@@ -200,7 +200,7 @@ struct vmw_dx_shader_bindings {* @splice_index: The device splice index set by user-space. */ struct vmw_ctx_bindinfo_uav { -struct vmw_ctx_bindinfo_view views[SVGA3D_MAX_UAVIEWS ]; +struct vmw_ctx_bindinfo_view views[SVGA3D_DX11_1_MAX_UAVIEWS ];uint32 index; };drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +5
-1@@ -364,6 +364,7 @@ static void vmw_print_sm_type(struct vmw_private *dev_priv) [VMW_SM_4] = "SM4", [VMW_SM_4_1] = "SM4_1", [VMW_SM_5] = "SM_5", + [VMW_SM_5_1X] = "SM_5_1X", [VMW_SM_MAX ] ="Invalid" };BUILD_BUG_ON (ARRAY_SIZE (names) != (VMW_SM_MAX +1 ));@@ -1083,8 +1084,11 @@ static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id) dev_priv->sm_type =VMW_SM_4_1 ;if (has_sm4_1_context (dev_priv) && (dev_priv->capabilities2 &SVGA_CAP2_DX3 )) { -if (vmw_devcap_get (dev_priv,SVGA3D_DEVCAP_SM5 )) +if (vmw_devcap_get (dev_priv,SVGA3D_DEVCAP_SM5 )) { dev_priv->sm_type =VMW_SM_5 ; +if (vmw_devcap_get (dev_priv,SVGA3D_DEVCAP_GL43 )) + dev_priv->sm_type =VMW_SM_5_1X ; + } } }drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +20
-0@@ -488,6 +488,7 @@ enum {* @VMW_SM_4: Context support upto SM4. * @VMW_SM_4_1: Context support upto SM4_1. * @VMW_SM_5: Context support up to SM5. +* @VMW_SM_5_1X: Adds support for sm5_1 and gl43 extensions. * @VMW_SM_MAX: Should be the last. */ enum vmw_sm_type {@@ -495,6 +496,7 @@ enum vmw_sm_type {VMW_SM_4 ,VMW_SM_4_1 ,VMW_SM_5 , +VMW_SM_5_1X , VMW_SM_MAX };@@ -755,6 +757,24 @@ static inline bool has_sm5_context(const struct vmw_private *dev_priv)return (dev_priv->sm_type >=VMW_SM_5 ); } +/** +* has_gl43_context - Does the device support GL43 context. +* @dev_priv: Device private. +* +* Return: Bool value if device support SM5 context or not. +*/ +static inline bool has_gl43_context (const struct vmw_private *dev_priv) +{ +return (dev_priv->sm_type >=VMW_SM_5_1X ); +} + + +static inline u32 vmw_max_num_uavs (struct vmw_private *dev_priv) +{ +return (has_gl43_context (dev_priv) ? +SVGA3D_DX11_1_MAX_UAVIEWS :SVGA3D_MAX_UAVIEWS ); +} +extern void vmw_svga_enable (struct vmw_private *dev_priv);extern void vmw_svga_disable (struct vmw_private *dev_priv);drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +1
-1@@ -2916,7 +2916,7 @@ static int vmw_cmd_set_uav(struct vmw_private *dev_priv,if (!has_sm5_context (dev_priv))return -EINVAL ; -if (num_uav >SVGA3D_MAX_UAVIEWS ) { +if (num_uav >vmw_max_num_uavs (dev_priv)) {VMW_DEBUG_USER ("Invalid UAV binding.\n" );return -EINVAL ; }
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c static int vmw_cmd_set_cs_uav(struct vmw_private *dev_priv, · line 2954
Quoted 8 lines
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +1
-1@@ -2948,7 +2948,7 @@ static int vmw_cmd_set_cs_uav(struct vmw_private *dev_priv,if (!has_sm5_context (dev_priv))return -EINVAL ; -if (num_uav >SVGA3D_MAX_UAVIEWS ) { +if (num_uav >vmw_max_num_uavs (dev_priv)) {VMW_DEBUG_USER ("Invalid UAV binding.\n" );return -EINVAL ; }
PATCH 9/12 drm/vmwgfx: Allow checking for gl43 contexts
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
To make sure we're running on top of hardware that can support GL4.3 we need to add a way of querying for those capabilities. DRM_VMW_PARAM_GL43 allows userspace to check for presence of GL4.3 capable contexts.
--- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 3 +++ include/uapi/drm/vmwgfx_drm.h | 1 + 2 files changed, 4 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +3 -0
@@ -105,6 +105,9 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data,case DRM_VMW_PARAM_SM5 : param->value =has_sm5_context (dev_priv);break ; +case DRM_VMW_PARAM_GL43 : + param->value =has_gl43_context (dev_priv); +break ;default :return -EINVAL ; }
include/uapi/drm/vmwgfx_drm.h +1 -0
@@ -110,6 +110,7 @@ extern "C" {#define DRM_VMW_PARAM_HW_CAPS2 13#define DRM_VMW_PARAM_SM4_1 14#define DRM_VMW_PARAM_SM5 15 +#define DRM_VMW_PARAM_GL43 16/** * enum drm_vmw_handle_type - handle type for ref ioctls
Signature · 1 line
2.32.0
PATCH 10/12 drm/vmwgfx: add support for updating only offsets of constant buffers
In reply to Zack RusinFrom: Roland Scheidegger <[email protected]>
This adds support for the SVGA_3D_CMD_DX_SET_VS/PS/GS/HS/DS/CS_CONSTANT_BUFFER_OFFSET commands (which only update the offset, but don't rebind the buffer), which saves some overhead.
--- drivers/gpu/drm/vmwgfx/vmwgfx_binding.c | 21 ++++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_binding.h | 2 + drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 56 +++++++++++++++++++++++++ 3 files changed, 79 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_binding.c +21 -0
@@ -353,6 +353,27 @@ void vmw_binding_add(struct vmw_ctx_binding_state *cbs,INIT_LIST_HEAD (&loc->res_list); } +/** +* vmw_binding_cb_offset_update: Update the offset of a cb binding +* +* @cbs: Pointer to the context binding state tracker. +* @shader_slot: The shader slot of the binding. +* @slot: The slot of the binding. +* @offsetInBytes: The new offset of the binding. +* +* Updates the offset of an existing cb binding in the context binding +* state structure @cbs. +*/ +void vmw_binding_cb_offset_update (struct vmw_ctx_binding_state *cbs, +u32 shader_slot,u32 slot,u32 offsetInBytes) +{ +struct vmw_ctx_bindinfo *loc = +vmw_binding_loc (cbs, vmw_ctx_binding_cb, shader_slot, slot); +struct vmw_ctx_bindinfo_cb *loc_cb = + (struct vmw_ctx_bindinfo_cb *)((u8 *) loc); + loc_cb->offset = offsetInBytes; +} +/** * vmw_binding_add_uav_index - Add UAV index for tracking. * @cbs: Pointer to the context binding state tracker.
drivers/gpu/drm/vmwgfx/vmwgfx_binding.h +2 -0
@@ -217,6 +217,8 @@ struct vmw_ctx_bindinfo_so {extern void vmw_binding_add (struct vmw_ctx_binding_state *cbs,const struct vmw_ctx_bindinfo *ci,u32 shader_slot,u32 slot); +extern void vmw_binding_cb_offset_update (struct vmw_ctx_binding_state *cbs, +u32 shader_slot,u32 slot,u32 offsetInBytes);extern void vmw_binding_add_uav_index (struct vmw_ctx_binding_state *cbs,uint32 slot,uint32 splice_index); extern void
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +56 -0
68 lines not on this page · raw message
Signature · 1 line
2.32.0
PATCH 11/12 drm/vmwgfx: Remove usage of MOBFMT_RANGE
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
Using MOBFMT_RANGE in the early days of guest backed objects was a major performance win but that has changed a lot since. There's no more a performance reason to use MOBFMT_RANGE. The device can/will still profit from the pages being contiguous but marking them as MOBFMT_RANGE no longer matters.
Benchmarks (e.g. heaven, valley) show that creating page tables for mob memory is actually faster than using mobfmt ranges.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 6 ------ drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 12 ------------ 3 files changed, 19 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0 -1
@@ -333,7 +333,6 @@ struct vmw_sg_table {struct page **pages;const dma_addr_t *addrs;struct sg_table *sgt; -unsigned long num_regions;unsigned long num_pages; };
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c +0 -6
@@ -146,9 +146,6 @@ static int vmw_setup_otable_base(struct vmw_private *dev_priv,if (otable->size <=PAGE_SIZE ) { mob->pt_level =VMW_MOBFMT_PTDEPTH_0 ; mob->pt_root_page =vmw_piter_dma_addr (&iter); - }else if (vsgt->num_regions ==1 ) { - mob->pt_level =SVGA3D_MOBFMT_RANGE ; - mob->pt_root_page =vmw_piter_dma_addr (&iter); }else { ret =vmw_mob_pt_populate (dev_priv, mob);if (unlikely (ret !=0 ))
@@ -623,9 +620,6 @@ int vmw_mob_bind(struct vmw_private *dev_priv,if (likely (num_data_pages ==1 )) { mob->pt_level =VMW_MOBFMT_PTDEPTH_0 ; mob->pt_root_page =vmw_piter_dma_addr (&data_iter); - }else if (vsgt->num_regions ==1 ) { - mob->pt_level =SVGA3D_MOBFMT_RANGE ; - mob->pt_root_page =vmw_piter_dma_addr (&data_iter); }else if (unlikely (mob->pt_bo ==NULL )) { ret =vmw_mob_pt_populate (dev_priv, mob);if (unlikely (ret !=0 ))
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -12
@@ -288,8 +288,6 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt) {struct vmw_private *dev_priv = vmw_tt->dev_priv;struct vmw_sg_table *vsgt = &vmw_tt->vsgt; -struct vmw_piter iter; -dma_addr_t old;int ret =0 ;if (vmw_tt->mapped)
@@ -321,16 +319,6 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt)break ; } - old = ~((dma_addr_t )0 ); - vmw_tt->vsgt.num_regions =0 ; -for (vmw_piter_start (&iter, vsgt,0 );vmw_piter_next (&iter);) { -dma_addr_t cur =vmw_piter_dma_addr (&iter); - -if (cur != old +PAGE_SIZE ) - vmw_tt->vsgt.num_regions++; - old = cur; - } - vmw_tt->mapped = true;return 0 ;
Signature · 1 line
2.32.0
Re: [PATCH 11/12] drm/vmwgfx: Remove usage of MOBFMT_RANGE
Quoted 73 lines · Zack Rusin
From: Zack Rusin <[email protected]>
Using
MOBFMT_RANGEin the early days of guest backed objects was a major performance win but that has changed a lot since. There's no more a performance reason to useMOBFMT_RANGE. The device can/will still profit from the pages being contiguous but marking them asMOBFMT_RANGEno longer matters.
Benchmarks (e.g. heaven, valley) show that creating page tables for mob memory is actually faster than using mobfmt ranges.Signed-off-by Zack Rusin <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 6 ------ drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 12 ------------ 3 files changed, 19 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0
-1@@ -333,7 +333,6 @@ struct vmw_sg_table {struct page **pages;const dma_addr_t *addrs;struct sg_table *sgt; -unsigned long num_regions;unsigned long num_pages; };drivers/gpu/drm/vmwgfx/vmwgfx_mob.c +0
-6@@ -146,9 +146,6 @@ static int vmw_setup_otable_base(struct vmw_private *dev_priv,if (otable->size <=PAGE_SIZE ) { mob->pt_level =VMW_MOBFMT_PTDEPTH_0 ; mob->pt_root_page =vmw_piter_dma_addr (&iter); - }else if (vsgt->num_regions ==1 ) { - mob->pt_level =SVGA3D_MOBFMT_RANGE ; - mob->pt_root_page =vmw_piter_dma_addr (&iter); }else { ret =vmw_mob_pt_populate (dev_priv, mob);if (unlikely (ret !=0 ))@@ -623,9 +620,6 @@ int vmw_mob_bind(struct vmw_private *dev_priv,if (likely (num_data_pages ==1 )) { mob->pt_level =VMW_MOBFMT_PTDEPTH_0 ; mob->pt_root_page =vmw_piter_dma_addr (&data_iter); - }else if (vsgt->num_regions ==1 ) { - mob->pt_level =SVGA3D_MOBFMT_RANGE ; - mob->pt_root_page =vmw_piter_dma_addr (&data_iter); }else if (unlikely (mob->pt_bo ==NULL )) { ret =vmw_mob_pt_populate (dev_priv, mob);if (unlikely (ret !=0 ))drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0
-5@@ -288,8 +288,6 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt) {struct vmw_private *dev_priv = vmw_tt->dev_priv;struct vmw_sg_table *vsgt = &vmw_tt->vsgt; -struct vmw_piter iter; -dma_addr_t old;int ret =0 ;if (vmw_tt->mapped)@@ -321,16 +319,6 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt)break ; } - old = ~((dma_addr_t )0 ); - vmw_tt->vsgt.num_regions =0 ; -for (vmw_piter_start (&iter, vsgt,0 );vmw_piter_next (&iter);) {
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt) · line 324
Quoted 10 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0
-7-dma_addr_t cur =vmw_piter_dma_addr (&iter); - -if (cur != old +PAGE_SIZE ) - vmw_tt->vsgt.num_regions++; - old = cur; - } - vmw_tt->mapped = true;return 0 ;
PATCH 12/12 drm/vmwgfx: Bump the major version
In reply to Zack RusinFrom: Zack Rusin <[email protected]>
With GEM, GL4.3, stats and removal of a lot of old code it's time to bump the major version of the driver. New major version gives us a fresh namespace on top of which more helpers can be GEM'ified and the driver can be brought more inline with the latest DRM changes.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +3 -3
@@ -54,9 +54,9 @@#define VMWGFX_DRIVER_NAME "vmwgfx" -#define VMWGFX_DRIVER_DATE "20210722" -#define VMWGFX_DRIVER_MAJOR 2 -#define VMWGFX_DRIVER_MINOR 19 +#define VMWGFX_DRIVER_DATE "20211206" +#define VMWGFX_DRIVER_MAJOR 3 +#define VMWGFX_DRIVER_MINOR 0#define VMWGFX_DRIVER_PATCHLEVEL 0#define VMWGFX_FIFO_STATIC_SIZE (1024*1024)#define VMWGFX_MAX_RELOCATIONS 2048
Signature · 1 line
2.32.0
PATCH v2 1/1 drm/vmwgfx: Bump the minor version
From: Zack Rusin <[email protected]>
v2: Old userspace doesn't like 3.x.x and we'd like to keep it working, so lets just bump the minor version until we have no choice.
With GEM, GL4.3, stats and removal of a lot of old code it's time to bump the minor version of the driver.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +2 -2
@@ -54,9 +54,9 @@#define VMWGFX_DRIVER_NAME "vmwgfx" -#define VMWGFX_DRIVER_DATE "20210722" +#define VMWGFX_DRIVER_DATE "20211206"#define VMWGFX_DRIVER_MAJOR 2 -#define VMWGFX_DRIVER_MINOR 19 +#define VMWGFX_DRIVER_MINOR 20#define VMWGFX_DRIVER_PATCHLEVEL 0#define VMWGFX_FIFO_STATIC_SIZE (1024*1024)#define VMWGFX_MAX_RELOCATIONS 2048
Signature · 1 line
2.32.0
Re: [PATCH v2] drm/vmwgfx: Bump the minor version
Quoted 27 lines · Zack Rusin
From: Zack Rusin <[email protected]>
v2: Old userspace doesn't like 3.x.x and we'd like to keep it working, so lets just bump the minor version until we have no choice.
With GEM, GL4.3, stats and removal of a lot of old code it's time to bump the minor version of the driver.
Signed-off-by Zack Rusin <[email protected]>---
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0
-0@@ -54,9 +54,9 @@
#defineVMWGFX_DRIVER_NAME"vmwgfx"drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +1
-1-#define VMWGFX_DRIVER_DATE "20210722" +#define VMWGFX_DRIVER_DATE "20211206"#define
VMWGFX_DRIVER_MAJOR2drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +1
-1-#define VMWGFX_DRIVER_MINOR 19 +#define VMWGFX_DRIVER_MINOR 20
Quoted 3 lines
#define
VMWGFX_DRIVER_PATCHLEVEL0
#defineVMWGFX_FIFO_STATIC_SIZE(1024*1024)
#defineVMWGFX_MAX_RELOCATIONS2048