Re: [PATCH v2 1/4] drm/gem-shmem-helper: Export drm_gem_shmem_funcs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 03.06.21 um 17:03 schrieb Daniel Vetter:
Drivers which need to overwrite the drm_driver->gem_create_object hook
need this. Specifically vgem, which wants wc mode, but everything else
is fine as-is.

Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
Cc: Maxime Ripard <mripard@xxxxxxxxxx>
Cc: Thomas Zimmermann <tzimmermann@xxxxxxx>
Cc: David Airlie <airlied@xxxxxxxx>
Cc: Daniel Vetter <daniel@xxxxxxxx>
---
  drivers/gpu/drm/drm_gem_shmem_helper.c | 3 ++-
  include/drm/drm_gem_shmem_helper.h     | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 6d625cee7a6a..4439004e62fe 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -24,7 +24,7 @@
   * allocated using anonymous pageable memory.
   */
-static const struct drm_gem_object_funcs drm_gem_shmem_funcs = {
+const struct drm_gem_object_funcs drm_gem_shmem_funcs = {
  	.free = drm_gem_shmem_free_object,
  	.print_info = drm_gem_shmem_print_info,
  	.pin = drm_gem_shmem_pin,
@@ -34,6 +34,7 @@ static const struct drm_gem_object_funcs drm_gem_shmem_funcs = {
  	.vunmap = drm_gem_shmem_vunmap,
  	.mmap = drm_gem_shmem_mmap,
  };
+EXPORT_SYMBOL(drm_gem_shmem_funcs);

No that's not needed. If you leave out the funcs pointer in your gem_create_object, __drm_gem_shmem_create() will set this default for you. [1] So please drop this patch.

Best regards
Thomas

[1] https://elixir.bootlin.com/linux/v5.12/source/drivers/gpu/drm/drm_gem_shmem_helper.c#L56

static struct drm_gem_shmem_object *
  __drm_gem_shmem_create(struct drm_device *dev, size_t size, bool private)
diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h
index 434328d8a0d9..b29667f2b8a3 100644
--- a/include/drm/drm_gem_shmem_helper.h
+++ b/include/drm/drm_gem_shmem_helper.h
@@ -106,6 +106,7 @@ struct drm_gem_shmem_object {
  #define to_drm_gem_shmem_obj(obj) \
  	container_of(obj, struct drm_gem_shmem_object, base)
+extern const struct drm_gem_object_funcs drm_gem_shmem_funcs;
  struct drm_gem_shmem_object *drm_gem_shmem_create(struct drm_device *dev, size_t size);
  void drm_gem_shmem_free_object(struct drm_gem_object *obj);

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux