drm: Convert most CMA-based drivers to GEM object functions
Subsystems (31)
Thomas Zimmermann
maintainercover drm: Convert most CMA-based drivers to GEM object functions
Most of the CMA-based drivers use the default implementation for the callbacks in struct drm_driver. With this patch, these interfaces are initialized with a common helper macro and GEM object functions replace several deprecated interfaces.
The first patch updates the existing macro to similar naming as with SHMEM and adds a helper for drivers that override the default implementation for .dumb_create(). The remaining patches convert the drivers. The aspeed driver already uses GEM object functions and only changes to the initializer macro.
I don't have much of the hardware, so compile-tested on aarch64, arm and x86-64 only.
Thomas Zimmermann (21):
drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro drm/arc: Use GEM CMA object functions
drm/arm: Use GEM CMA object functions
drm/aspeed: Set driver CMA functions with DRM_GEM_CMA_DRIVER_OPS drm/atmel-hlcdc: Use GEM CMA object functions drm/fsl-dcu: Use GEM CMA object functions drm/hisilicon/kirin: Use GEM CMA object functions drm/imx: Use GEM CMA object functions
drm/ingenic: Use GEM CMA object functions
drm/komeda: Use GEM CMA object functions
drm/malidp: Use GEM CMA object functions
drm/mcde: Use GEM CMA object functions
drm/meson: Use GEM CMA object functions
drm/mxsfb: Use GEM CMA object functions
drm/rcar-du: Use GEM CMA object functions drm/shmobile: Use GEM CMA object functions
drm/stm: Use GEM CMA object functions
drm/sti: Use GEM CMA object functions
drm/tilcdc: Use GEM CMA object functions
drm/tv200: Use GEM CMA object functions
drm/zte: Use GEM CMA object functions
drivers/gpu/drm/arc/arcpgu_drv.c | 12 +--------- .../gpu/drm/arm/display/komeda/komeda_kms.c | 11 +-------- drivers/gpu/drm/arm/hdlcd_drv.c | 12 +--------- drivers/gpu/drm/arm/malidp_drv.c | 11 +-------- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 7 +----- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 11 +-------- drivers/gpu/drm/drm_gem_cma_helper.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 11 +-------- .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 +--------- drivers/gpu/drm/imx/imx-drm-core.c | 12 +--------- drivers/gpu/drm/ingenic/ingenic-drm.c | 13 +--------- drivers/gpu/drm/mcde/mcde_drv.c | 12 +--------- drivers/gpu/drm/meson/meson_drv.c | 15 ++---------- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 11 +-------- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 11 +-------- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 11 +-------- drivers/gpu/drm/sti/sti_drv.c | 12 +--------- drivers/gpu/drm/stm/drv.c | 11 +-------- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +-- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 13 +--------- drivers/gpu/drm/tiny/hx8357d.c | 2 +- drivers/gpu/drm/tiny/ili9225.c | 2 +- drivers/gpu/drm/tiny/ili9341.c | 2 +- drivers/gpu/drm/tiny/ili9486.c | 2 +- drivers/gpu/drm/tiny/mi0283qt.c | 2 +- drivers/gpu/drm/tiny/repaper.c | 2 +- drivers/gpu/drm/tiny/st7586.c | 2 +- drivers/gpu/drm/tiny/st7735r.c | 2 +- drivers/gpu/drm/tve200/tve200_drv.c | 12 +--------- drivers/gpu/drm/zte/zx_drm_drv.c | 11 +-------- include/drm/drm_gem_cma_helper.h | 24 +++++++++++++++---- 32 files changed, 52 insertions(+), 226 deletions(-)
--
2.26.2
Thomas Zimmermann
maintainerPATCH 1/21 drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro
Rename the macro to DRM_GEM_CMA_DRIVER_OPS to align with SHMEM helpers. An internal version is provided for drivers that override the default .dumb_create callback. Adapt drivers to the changes.
--- drivers/gpu/drm/drm_gem_cma_helper.c | 2 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +-- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tiny/hx8357d.c | 2 +- drivers/gpu/drm/tiny/ili9225.c | 2 +- drivers/gpu/drm/tiny/ili9341.c | 2 +- drivers/gpu/drm/tiny/ili9486.c | 2 +- drivers/gpu/drm/tiny/mi0283qt.c | 2 +- drivers/gpu/drm/tiny/repaper.c | 2 +- drivers/gpu/drm/tiny/st7586.c | 2 +- drivers/gpu/drm/tiny/st7735r.c | 2 +- include/drm/drm_gem_cma_helper.h | 24 ++++++++++++++++++++---- 12 files changed, 31 insertions(+), 16 deletions(-)
drivers/gpu/drm/drm_gem_cma_helper.c +1 -1
@@ -620,7 +620,7 @@ EXPORT_SYMBOL(drm_cma_gem_create_object_default_funcs);* address set. This address is released when the object is freed. * * This function can be used as the &drm_driver.gem_prime_import_sg_table -* callback. The DRM_GEM_CMA_VMAP_DRIVER_OPS() macro provides a shortcut to set +* callback. The &DRM_GEM_CMA_DRIVER_OPS macro provides a shortcut to set * the necessary DRM driver operations. * * Returns:
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -2
@@ -52,8 +52,7 @@ static struct drm_driver sun4i_drv_driver = { .minor = 0,/* GEM Operations */ -DRM_GEM_CMA_VMAP_DRIVER_OPS , - .dumb_create = drm_sun4i_gem_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(drm_sun4i_gem_dumb_create), };static int sun4i_drv_bind (struct device *dev)
drivers/gpu/drm/tidss/tidss_drv.c +1 -1
@@ -112,7 +112,7 @@ static struct drm_driver tidss_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &tidss_fops, .release = tidss_release, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name = "tidss", .desc = "TI Keystone DSS", .date = "20180215",
drivers/gpu/drm/tiny/hx8357d.c +1 -1
@@ -196,7 +196,7 @@ DEFINE_DRM_GEM_CMA_FOPS(hx8357d_fops);static struct drm_driver hx8357d_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &hx8357d_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="hx8357d" , .desc ="HX8357D" ,
drivers/gpu/drm/tiny/ili9225.c +1 -1
@@ -346,7 +346,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9225_fops);static struct drm_driver ili9225_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9225_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name ="ili9225" , .desc ="Ilitek ILI9225" , .date ="20171106" ,
drivers/gpu/drm/tiny/ili9341.c +1 -1
@@ -152,7 +152,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9341_fops);static struct drm_driver ili9341_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9341_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="ili9341" , .desc ="Ilitek ILI9341" ,
drivers/gpu/drm/tiny/ili9486.c +1 -1
@@ -165,7 +165,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9486_fops);static struct drm_driver ili9486_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9486_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="ili9486" , .desc ="Ilitek ILI9486" ,
drivers/gpu/drm/tiny/mi0283qt.c +1 -1
@@ -156,7 +156,7 @@ DEFINE_DRM_GEM_CMA_FOPS(mi0283qt_fops);static struct drm_driver mi0283qt_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &mi0283qt_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="mi0283qt" , .desc ="Multi-Inno MI0283QT" ,
drivers/gpu/drm/tiny/repaper.c +1 -1
@@ -946,7 +946,7 @@ DEFINE_DRM_GEM_CMA_FOPS(repaper_fops);static struct drm_driver repaper_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &repaper_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name ="repaper" , .desc ="Pervasive Displays RePaper e-ink panels" , .date ="20170405" ,
drivers/gpu/drm/tiny/st7586.c +1 -1
@@ -285,7 +285,7 @@ DEFINE_DRM_GEM_CMA_FOPS(st7586_fops);static struct drm_driver st7586_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &st7586_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="st7586" , .desc ="Sitronix ST7586" ,
drivers/gpu/drm/tiny/st7735r.c +1 -1
@@ -157,7 +157,7 @@ DEFINE_DRM_GEM_CMA_FOPS(st7735r_fops);static struct drm_driver st7735r_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &st7735r_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="st7735r" , .desc ="Sitronix ST7735R" ,
include/drm/drm_gem_cma_helper.h +20 -4
@@ -110,21 +110,37 @@ struct drm_gem_object * drm_cma_gem_create_object_default_funcs(struct drm_device *dev, size_t size);/** -* DRM_GEM_CMA_VMAP_DRIVER_OPS - CMA GEM driver operations ensuring a virtual -* address on the buffer +* __DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations ensuring a +* virtual address on the buffer +* @__dumb_create: callback function for .dumb_create * * This macro provides a shortcut for setting the default GEM operations in the * &drm_driver structure for drivers that need the virtual address also on * imported buffers. +* +* This macro is a variant of DRM_GEM_CMA_DRIVER_OPS for drivers that +* override the default implementation of .dumb_create. Use +* DRM_GEM_CMA_DRIVER_OPS if possible. */ -#define DRM_GEM_CMA_VMAP_DRIVER_OPS \ +#define __DRM_GEM_CMA_DRIVER_OPS (__dumb_create) \ .gem_create_object = drm_cma_gem_create_object_default_funcs, \ - .dumb_create = drm_gem_cma_dumb_create, \ + .dumb_create = (__dumb_create), \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \ .gem_prime_mmap = drm_gem_prime_mmap +/** +* DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations ensuring a virtual +* address on the buffer +* +* This macro provides a shortcut for setting the default GEM operations in the +* &drm_driver structure for drivers that need the virtual address also on +* imported buffers. +*/ +#define DRM_GEM_CMA_DRIVER_OPS \ + __DRM_GEM_CMA_DRIVER_OPS(drm_gem_cma_dumb_create) +struct drm_gem_object * drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *drm, struct dma_buf_attachment *attach,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 2/21 drm/arc: Use GEM CMA object functions
In reply to Thomas ZimmermannThe arc driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/arc/arcpgu_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +1 -11
@@ -154,17 +154,7 @@ static struct drm_driver arcpgu_drm_driver = { .minor = 0, .patchlevel = 0, .fops = &arcpgu_drm_ops, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_print_info = drm_gem_cma_print_info, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , #ifdef CONFIG_DEBUG_FS .debugfs_init = arcpgu_debugfs_init, #endif
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 3/21 drm/arm: Use GEM CMA object functions
In reply to Thomas ZimmermannThe arm driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/arm/hdlcd_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/arm/hdlcd_drv.c +1 -11
@@ -240,17 +240,7 @@ static struct drm_driver hdlcd_driver = { .irq_preinstall = hdlcd_irq_preinstall, .irq_postinstall = hdlcd_irq_postinstall, .irq_uninstall = hdlcd_irq_uninstall, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_print_info = drm_gem_cma_print_info, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , #ifdef CONFIG_DEBUG_FS .debugfs_init = hdlcd_debugfs_init, #endif
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 4/21 drm/aspeed: Set driver CMA functions with DRM_GEM_CMA_DRIVER_OPS
In reply to Thomas ZimmermannDRM_GEM_CMA_DRIVER_OPS sets the functions in struct drm_driver to their defaults. No functional changes are made.
--- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1 -6
@@ -188,12 +188,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);static struct drm_driver aspeed_gfx_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_create_object = drm_cma_gem_create_object_default_funcs, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_mmap = drm_gem_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name ="aspeed-gfx-drm" , .desc ="ASPEED GFX DRM" ,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 5/21 drm/atmel-hlcdc: Use GEM CMA object functions
In reply to Thomas ZimmermannThe atmel-hlcdc driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1 -10
@@ -821,16 +821,7 @@ static struct drm_driver atmel_hlcdc_dc_driver = { .irq_preinstall = atmel_hlcdc_dc_irq_uninstall, .irq_postinstall = atmel_hlcdc_dc_irq_postinstall, .irq_uninstall = atmel_hlcdc_dc_irq_uninstall, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = drm_gem_cma_dumb_create, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name = "atmel-hlcdc", .desc = "Atmel HLCD Controller DRM",
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 6/21 drm/fsl-dcu: Use GEM CMA object functions
In reply to Thomas ZimmermannThe fsl-dcu driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -10
@@ -141,16 +141,7 @@ static struct drm_driver fsl_dcu_drm_driver = { .irq_handler = fsl_dcu_drm_irq, .irq_preinstall = fsl_dcu_irq_uninstall, .irq_uninstall = fsl_dcu_irq_uninstall, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = drm_gem_cma_dumb_create, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fsl_dcu_drm_fops, .name = "fsl-dcu-drm", .desc = "Freescale DCU DRM",
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 7/21 drm/hisilicon/kirin: Use GEM CMA object functions
In reply to Thomas ZimmermannThe kirin driver uses the default implementation for CMA functions; except for the .dumb_create callback. The __DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults and .dumb_create in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +1 -11
@@ -921,17 +921,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ade_fops);static struct drm_driver ade_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ade_fops, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create_internal, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - +__DRM_GEM_CMA_DRIVER_OPS (drm_gem_cma_dumb_create_internal), .name ="kirin" , .desc ="Hisilicon Kirin620 SoC DRM Driver" , .date ="20150718" ,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 8/21 drm/imx: Use GEM CMA object functions
In reply to Thomas ZimmermannThe imx driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/imx/imx-drm-core.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/imx/imx-drm-core.c +1 -11
@@ -146,17 +146,7 @@ static const struct drm_ioctl_desc imx_drm_ioctls[] = {static struct drm_driver imx_drm_driver = { .driver_features =DRIVER_MODESET |DRIVER_GEM |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, - - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , .ioctls = imx_drm_ioctls, .num_ioctls =ARRAY_SIZE (imx_drm_ioctls), .fops = &imx_drm_driver_fops,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 9/21 drm/ingenic: Use GEM CMA object functions
In reply to Thomas ZimmermannThe ingenic driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/ingenic/ingenic-drm.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/gpu/drm/ingenic/ingenic-drm.c +1 -12
@@ -519,18 +519,7 @@ static struct drm_driver ingenic_drm_driver_data = { .patchlevel = 0, .fops = &ingenic_drm_fops, - - .dumb_create = drm_gem_cma_dumb_create, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, + DRM_GEM_CMA_DRIVER_OPS, .irq_handler = ingenic_drm_irq_handler, };
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 10/21 drm/komeda: Use GEM CMA object functions
In reply to Thomas ZimmermannThe komeda driver uses the default implementation for CMA functions; except for the .dumb_create callback. The __DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults and .dumb_create in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_kms.c +1 -10
@@ -61,16 +61,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)static struct drm_driver komeda_kms_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .lastclose = drm_fb_helper_lastclose, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = komeda_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +__DRM_GEM_CMA_DRIVER_OPS (komeda_gem_cma_dumb_create), .fops = &komeda_cma_fops, .name ="komeda" , .desc ="Arm Komeda Display Processor driver" ,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 11/21 drm/malidp: Use GEM CMA object functions
In reply to Thomas ZimmermannThe malidp driver uses the default implementation for CMA functions; except for the .dumb_create callback. The __DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults and .dumb_create in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/arm/malidp_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/arm/malidp_drv.c +1 -10
@@ -563,16 +563,7 @@ static void malidp_debugfs_init(struct drm_minor *minor)static struct drm_driver malidp_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = malidp_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +__DRM_GEM_CMA_DRIVER_OPS (malidp_dumb_create), #ifdef CONFIG_DEBUG_FS .debugfs_init = malidp_debugfs_init, #endif
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 12/21 drm/mcde: Use GEM CMA object functions
In reply to Thomas ZimmermannThe mcde driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/mcde/mcde_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/mcde/mcde_drv.c +1 -11
@@ -228,17 +228,7 @@ static struct drm_driver mcde_drm_driver = { .major = 1, .minor = 0, .patchlevel = 0, - .dumb_create = drm_gem_cma_dumb_create, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, + DRM_GEM_CMA_DRIVER_OPS, };static int mcde_drm_bind (struct device *dev)
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 13/21 drm/meson: Use GEM CMA object functions
In reply to Thomas ZimmermannThe meson driver uses the default implementation for CMA functions; except for the .dumb_create callback. The __DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults and .dumb_create in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/meson/meson_drv.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/meson/meson_drv.c +2 -13
@@ -96,19 +96,8 @@ static struct drm_driver meson_driver = {/* IRQ */ .irq_handler = meson_irq, -/* PRIME Ops */ - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - -/* GEM Ops */ - .dumb_create = meson_dumb_create, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, +/* CMA Ops */ +__DRM_GEM_CMA_DRIVER_OPS (meson_dumb_create),/* Misc */ .fops = &fops,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 14/21 drm/mxsfb: Use GEM CMA object functions
In reply to Thomas ZimmermannThe mxsfb driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/mxsfb/mxsfb_drv.c +1 -10
@@ -356,16 +356,7 @@ static struct drm_driver mxsfb_driver = { .irq_handler = mxsfb_irq_handler, .irq_preinstall = mxsfb_irq_preinstall, .irq_uninstall = mxsfb_irq_preinstall, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name = "mxsfb-drm", .desc = "MXSFB Controller DRM",
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 15/21 drm/rcar-du: Use GEM CMA object functions
In reply to Thomas ZimmermannThe rcar-du driver uses the default implementation for CMA functions; except for the .dumb_create callback. The __DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults and .dumb_create in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1 -10
@@ -476,16 +476,7 @@ DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops);static struct drm_driver rcar_du_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = rcar_du_dumb_create, +__DRM_GEM_CMA_DRIVER_OPS (rcar_du_dumb_create), .fops = &rcar_du_fops, .name ="rcar-du" , .desc ="Renesas R-Car Display Unit" ,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 16/21 drm/shmobile: Use GEM CMA object functions
In reply to Thomas ZimmermannThe shmobile driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_drv.c +1 -10
@@ -131,16 +131,7 @@ DEFINE_DRM_GEM_CMA_FOPS(shmob_drm_fops);static struct drm_driver shmob_drm_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET , .irq_handler = shmob_drm_irq, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = drm_gem_cma_dumb_create, +DRM_GEM_CMA_DRIVER_OPS , .fops = &shmob_drm_fops, .name ="shmob-drm" , .desc ="Renesas SH Mobile DRM" ,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 17/21 drm/stm: Use GEM CMA object functions
In reply to Thomas ZimmermannThe stm driver uses the default implementation for CMA functions; except for the .dumb_create callback. The __DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults and .dumb_create in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/stm/drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/stm/drv.c +1 -10
@@ -62,16 +62,7 @@ static struct drm_driver drv_driver = { .minor = 0, .patchlevel = 0, .fops = &drv_driver_fops, - .dumb_create = stm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, + __DRM_GEM_CMA_DRIVER_OPS(stm_gem_cma_dumb_create), };static int drv_load (struct drm_device *ddev)
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 18/21 drm/sti: Use GEM CMA object functions
In reply to Thomas ZimmermannThe sti driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/sti/sti_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/sti/sti_drv.c +1 -11
@@ -132,19 +132,9 @@ DEFINE_DRM_GEM_CMA_FOPS(sti_driver_fops);static struct drm_driver sti_driver = { .driver_features =DRIVER_MODESET |DRIVER_GEM |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, +DRM_GEM_CMA_DRIVER_OPS , .fops = &sti_driver_fops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .debugfs_init = sti_drm_dbg_init, .name =DRIVER_NAME ,
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 19/21 drm/tilcdc: Use GEM CMA object functions
In reply to Thomas ZimmermannThe tilcdc driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +1 -12
@@ -496,18 +496,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);static struct drm_driver tilcdc_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .irq_handler = tilcdc_irq, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_print_info = drm_gem_cma_print_info, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, - - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , #ifdef CONFIG_DEBUG_FS .debugfs_init = tilcdc_debugfs_init, #endif
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 20/21 drm/tv200: Use GEM CMA object functions
In reply to Thomas ZimmermannThe tve200 driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/tve200/tve200_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/tve200/tve200_drv.c +1 -11
@@ -147,17 +147,7 @@ static struct drm_driver tve200_drm_driver = { .major = 1, .minor = 0, .patchlevel = 0, - .dumb_create = drm_gem_cma_dumb_create, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, + DRM_GEM_CMA_DRIVER_OPS, };static int tve200_probe (struct platform_device *pdev)
Signature · 1 line
2.26.2
Thomas Zimmermann
maintainerPATCH 21/21 drm/zte: Use GEM CMA object functions
In reply to Thomas ZimmermannThe zte driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. All remaining operations are provided by CMA GEM object functions.
--- drivers/gpu/drm/zte/zx_drm_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/zte/zx_drm_drv.c +1 -10
@@ -36,16 +36,7 @@ DEFINE_DRM_GEM_CMA_FOPS(zx_drm_fops);static struct drm_driver zx_drm_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +DRM_GEM_CMA_VMAP_DRIVER_OPS , .fops = &zx_drm_fops, .name ="zx-vou" , .desc ="ZTE VOU Controller DRM" ,
Signature · 1 line
2.26.2
Re: [PATCH 01/21] drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro
In reply to Thomas ZimmermannHi Thomas.
Quoted 2 lines · Thomas Zimmermann
Rename the macro to
DRM_GEM_CMA_DRIVER_OPSto align with SHMEM helpers.
This part is fine, I like that the naming is somehow consistent.
Quoted 2 lines
An internal version is provided for drivers that override the default .dumb_create callback. Adapt drivers to the changes.
I loathe anything named __foo or __FOO. This __ signals to me that the author was clueless in naming - or some sort.
I know that __ is used in some lib headers - but thats not the case here.
But I love that we have a variant that takes a create function. So we do not have to escape from the nice macro.
The macro is another way to tell me as rewiewer that this drivers uses all the default helpers for this.
So critizising the name I better suggest something that I personally like better:
DRM_GEM_CMA_DRIVER_OPS_CREATE()
It would look like this:
/* GEM Operations */
- DRM_GEM_CMA_VMAP_DRIVER_OPS,
- .dumb_create = drm_sun4i_gem_dumb_create,
+ DRM_GEM_CMA_DRIVER_OPS_CREATE(drm_sun4i_gem_dumb_create),
Please fix zte/zx_drm_drv.c which also uses DRM_GEM_CMA_VMAP_DRIVER_OPS.
The naming is a bikeshedding topic that we may not agree on, soo..
With zte fixed the patch is:
Sam
Quoted 209 lines
Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/drm_gem_cma_helper.c | 2 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +-- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tiny/hx8357d.c | 2 +- drivers/gpu/drm/tiny/ili9225.c | 2 +- drivers/gpu/drm/tiny/ili9341.c | 2 +- drivers/gpu/drm/tiny/ili9486.c | 2 +- drivers/gpu/drm/tiny/mi0283qt.c | 2 +- drivers/gpu/drm/tiny/repaper.c | 2 +- drivers/gpu/drm/tiny/st7586.c | 2 +- drivers/gpu/drm/tiny/st7735r.c | 2 +- include/drm/drm_gem_cma_helper.h | 24 ++++++++++++++++++++---- 12 files changed, 31 insertions(+), 16 deletions(-)drivers/gpu/drm/drm_gem_cma_helper.c +1
-1@@ -620,7 +620,7 @@ EXPORT_SYMBOL(drm_cma_gem_create_object_default_funcs);* address set. This address is released when the object is freed. * * This function can be used as the &drm_driver.gem_prime_import_sg_table -* callback. The DRM_GEM_CMA_VMAP_DRIVER_OPS() macro provides a shortcut to set +* callback. The &DRM_GEM_CMA_DRIVER_OPS macro provides a shortcut to set * the necessary DRM driver operations. * * Returns: drivers/gpu/drm/sun4i/sun4i_drv.c +1
-2@@ -52,8 +52,7 @@ static struct drm_driver sun4i_drv_driver = { .minor = 0,/* GEM Operations */ -DRM_GEM_CMA_VMAP_DRIVER_OPS , - .dumb_create = drm_sun4i_gem_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(drm_sun4i_gem_dumb_create), };static int sun4i_drv_bind (struct device *dev)drivers/gpu/drm/tidss/tidss_drv.c +1
-1@@ -112,7 +112,7 @@ static struct drm_driver tidss_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &tidss_fops, .release = tidss_release, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name = "tidss", .desc = "TI Keystone DSS", .date = "20180215",drivers/gpu/drm/tiny/hx8357d.c +1
-1@@ -196,7 +196,7 @@ DEFINE_DRM_GEM_CMA_FOPS(hx8357d_fops);static struct drm_driver hx8357d_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &hx8357d_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="hx8357d" , .desc ="HX8357D" ,drivers/gpu/drm/tiny/ili9225.c +1
-1@@ -346,7 +346,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9225_fops);static struct drm_driver ili9225_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9225_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name ="ili9225" , .desc ="Ilitek ILI9225" , .date ="20171106" ,drivers/gpu/drm/tiny/ili9341.c +1
-1@@ -152,7 +152,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9341_fops);static struct drm_driver ili9341_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9341_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="ili9341" , .desc ="Ilitek ILI9341" ,drivers/gpu/drm/tiny/ili9486.c +1
-1@@ -165,7 +165,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9486_fops);static struct drm_driver ili9486_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9486_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="ili9486" , .desc ="Ilitek ILI9486" ,drivers/gpu/drm/tiny/mi0283qt.c +1
-1@@ -156,7 +156,7 @@ DEFINE_DRM_GEM_CMA_FOPS(mi0283qt_fops);static struct drm_driver mi0283qt_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &mi0283qt_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="mi0283qt" , .desc ="Multi-Inno MI0283QT" ,drivers/gpu/drm/tiny/repaper.c +1
-1@@ -946,7 +946,7 @@ DEFINE_DRM_GEM_CMA_FOPS(repaper_fops);static struct drm_driver repaper_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &repaper_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name ="repaper" , .desc ="Pervasive Displays RePaper e-ink panels" , .date ="20170405" ,drivers/gpu/drm/tiny/st7586.c +1
-1@@ -285,7 +285,7 @@ DEFINE_DRM_GEM_CMA_FOPS(st7586_fops);static struct drm_driver st7586_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &st7586_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="st7586" , .desc ="Sitronix ST7586" ,drivers/gpu/drm/tiny/st7735r.c +1
-1@@ -157,7 +157,7 @@ DEFINE_DRM_GEM_CMA_FOPS(st7735r_fops);static struct drm_driver st7735r_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &st7735r_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="st7735r" , .desc ="Sitronix ST7735R" ,include/drm/drm_gem_cma_helper.h +20
-4@@ -110,21 +110,37 @@ struct drm_gem_object * drm_cma_gem_create_object_default_funcs(struct drm_device *dev, size_t size);/** -* DRM_GEM_CMA_VMAP_DRIVER_OPS - CMA GEM driver operations ensuring a virtual -* address on the buffer +* __DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations ensuring a +* virtual address on the buffer +* @__dumb_create: callback function for .dumb_create * * This macro provides a shortcut for setting the default GEM operations in the * &drm_driver structure for drivers that need the virtual address also on * imported buffers. +* +* This macro is a variant of DRM_GEM_CMA_DRIVER_OPS for drivers that +* override the default implementation of .dumb_create. Use +* DRM_GEM_CMA_DRIVER_OPS if possible. */ -#define DRM_GEM_CMA_VMAP_DRIVER_OPS \ +#define __DRM_GEM_CMA_DRIVER_OPS (__dumb_create) \ .gem_create_object = drm_cma_gem_create_object_default_funcs, \ - .dumb_create = drm_gem_cma_dumb_create, \ + .dumb_create = (__dumb_create), \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \ .gem_prime_mmap = drm_gem_prime_mmap +/** +* DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations ensuring a virtual +* address on the buffer +* +* This macro provides a shortcut for setting the default GEM operations in the +* &drm_driver structure for drivers that need the virtual address also on +* imported buffers. +*/ +#define DRM_GEM_CMA_DRIVER_OPS \ + __DRM_GEM_CMA_DRIVER_OPS(drm_gem_cma_dumb_create) +struct drm_gem_object * drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *drm, struct dma_buf_attachment *attach,Signature · 1 line
2.26.2
Re: [PATCH 05/21] drm/atmel-hlcdc: Use GEM CMA object functions
In reply to Thomas ZimmermannHi Thomas.
Quoted 3 lines · Thomas Zimmermann
The atmel-hlcdc driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.
A nice side-effect of introducing the defualt implementation of CMA functions is that this driver is now migrated over to use drm_gem_object_funcs, which is why we can replace all these helpers with a simple macro that defined only 6 helpers.
With an improved changelog:
And as I said in the other mail, this is really nice. It is now much more obvious that this drivers uses all the default helpers for CMA.
And I can drop one item from my TODO list on top of that.
Sam
Quoted 30 lines
Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1
-10@@ -821,16 +821,7 @@ static struct drm_driver atmel_hlcdc_dc_driver = { .irq_preinstall = atmel_hlcdc_dc_irq_uninstall, .irq_postinstall = atmel_hlcdc_dc_irq_postinstall, .irq_uninstall = atmel_hlcdc_dc_irq_uninstall, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = drm_gem_cma_dumb_create, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name = "atmel-hlcdc", .desc = "Atmel HLCD Controller DRM",Signature · 1 line
2.26.2
Re: [PATCH 07/21] drm/hisilicon/kirin: Use GEM CMA object functions
In reply to Thomas ZimmermannHi Thomas,
Quoted 16 lines · Thomas Zimmermann
The kirin driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0
-0
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c DEFINE_DRM_GEM_CMA_FOPS(ade_fops); · line 926
Quoted 6 lines
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0
-3@@ -921,17 +921,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ade_fops);static struct drm_driver ade_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ade_fops, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create_internal,
This doesn't seem right. The _internal documentation explicitly says that this should _not_ be used as .dumb_create. Instead drivers should use it to implement their callback.
Since it yields the same result as drm_gem_cma_dumb_create we can use the default macro below.
Weather to the .dumb_create in separate patch, or squash it here - I'll leave to you.
In case of the latter, please mentioned it in the commit message.
-Emil
Re: [PATCH 01/21] drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro
In reply to Sam RavnborgQuoted 15 lines · Sam Ravnborg
Hi Thomas.
Quoted 2 lines · Thomas Zimmermann
Rename the macro to
DRM_GEM_CMA_DRIVER_OPSto align with SHMEM helpers.This part is fine, I like that the naming is somehow consistent.
Quoted 2 lines
An internal version is provided for drivers that override the default .dumb_create callback. Adapt drivers to the changes.
I loathe anything named
__fooor__FOO. This __ signals to me that the author was clueless in naming - or some sort.
I know that __ is used in some lib headers - but thats not the case here.
Quoted 5 lines
But I love that we have a variant that takes a create function. So we do not have to escape from the nice macro.
The macro is another way to tell me as rewiewer that this drivers uses all the default helpers for this.
Fwiw I share the sentiment, although I fear we're a little late. __ prefixed functions are widely common in core drm and it's helpers.
Quoted 14 lines
So critizising the name I better suggest something that I personally like better:
DRM_GEM_CMA_DRIVER_OPS_CREATE()It would look like this:
/* GEM Operations */drivers/gpu/drm/sun4i/sun4i_drv.c +1
-2- DRM_GEM_CMA_VMAP_DRIVER_OPS, - .dumb_create = drm_sun4i_gem_dumb_create, + DRM_GEM_CMA_DRIVER_OPS_CREATE(drm_sun4i_gem_dumb_create),
Quoted 2 lines
Please fix
zte/zx_drm_drv.cwhich also usesDRM_GEM_CMA_VMAP_DRIVER_OPS.
Isn't DRM_GEM_CMA_VMAP_DRIVER_OPS introduced to zte with the last patch in the series?
-Emil
Hi Thomas,
Quoted 2 lines · Thomas Zimmermann
32 files changed, 52 insertions(+), 226 deletions(-)
We need more diffstat like this. With this series the .gem_print_info is no longer set.
Feel free to follow-up and nuke it, alongside the glue in drm_gem.c.
There's a small comment in the kirin patch - with that resolved the series is:
-Emil
Re: [PATCH 01/21] drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro
In reply to Emil VelikovHi Emil.
Quoted 4 lines
Quoted 2 lines
Please fix
zte/zx_drm_drv.cwhich also usesDRM_GEM_CMA_VMAP_DRIVER_OPS.Isn't
DRM_GEM_CMA_VMAP_DRIVER_OPSintroduced to zte with the last patch in the series?
You are right, I just applied all patches and throw them after my build script and zte failed.
Sam
Re: [PATCH 21/21] drm/zte: Use GEM CMA object functions
In reply to Thomas ZimmermannHi Thomas.
Quoted 18 lines · Thomas Zimmermann
The zte driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/zte/zx_drm_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/zte/zx_drm_drv.c +0
-1@@ -36,16 +36,7 @@ DEFINE_DRM_GEM_CMA_FOPS(zx_drm_fops);static struct drm_driver zx_drm_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/zte/zx_drm_drv.c DEFINE_DRM_GEM_CMA_FOPS(zx_drm_fops); · line 39
Quoted 10 lines
drivers/gpu/drm/zte/zx_drm_drv.c +1
-9- .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, + DRM_GEM_CMA_VMAP_DRIVER_OPS,
s/_VMAP// as pointed out by Emil.
Sam
Quoted 5 lines
drivers/gpu/drm/zte/zx_drm_drv.c +0
-0.fops = &zx_drm_fops, .name = "zx-vou", .desc = "ZTE VOU Controller DRM",Signature · 1 line
2.26.2
Re: [PATCH 05/21] drm/atmel-hlcdc: Use GEM CMA object functions
In reply to Thomas ZimmermannHi Thomas.
Quoted 17 lines · Thomas Zimmermann
The atmel-hlcdc driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0
-0@@ -821,16 +821,7 @@ static struct drm_driver atmel_hlcdc_dc_driver = { .irq_preinstall = atmel_hlcdc_dc_irq_uninstall, .irq_postinstall = atmel_hlcdc_dc_irq_postinstall, .irq_uninstall = atmel_hlcdc_dc_irq_uninstall,
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c static struct drm_driver atmel_hlcdc_dc_driver = { · line 833
Quoted 10 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0
-9- .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap,
When using DRM_GEM_CMA_DRIVER_OPS gem_prime_mmap is set to drm_gem_prime_mmap.
Why is this the same as drm_gem_cma_prime_mmap?
Maybe this is all obvious when you know all the CMA stuff, but this puzzeled me.
Sam
Quoted 7 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1
-1- .dumb_create = drm_gem_cma_dumb_create, + DRM_GEM_CMA_DRIVER_OPS, .fops = &fops, .name = "atmel-hlcdc",.desc = "Atmel HLCD Controller DRM",
Signature · 1 line
2.26.2
Laurent Pinchart
Reviewed-byRe: [PATCH 01/21] drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro
In reply to Sam RavnborgHello,
Quoted 26 lines · Sam Ravnborg
Quoted 2 lines · Thomas Zimmermann
Rename the macro to
DRM_GEM_CMA_DRIVER_OPSto align with SHMEM helpers.This part is fine, I like that the naming is somehow consistent.
Quoted 2 lines
An internal version is provided for drivers that override the default .dumb_create callback. Adapt drivers to the changes.
I loathe anything named
__fooor__FOO. This __ signals to me that the author was clueless in naming - or some sort.
I know that __ is used in some lib headers - but thats not the case here.But I love that we have a variant that takes a create function. So we do not have to escape from the nice macro.
The macro is another way to tell me as rewiewer that this drivers uses all the default helpers for this.So critizising the name I better suggest something that I personally like better:
DRM_GEM_CMA_DRIVER_OPS_CREATE()It would look like this:
/* GEM Operations */
drivers/gpu/drm/sun4i/sun4i_drv.c static struct drm_driver sun4i_drv_driver = {
Quoted 3 lines
drivers/gpu/drm/sun4i/sun4i_drv.c +1
-2- DRM_GEM_CMA_VMAP_DRIVER_OPS, - .dumb_create = drm_sun4i_gem_dumb_create, + DRM_GEM_CMA_DRIVER_OPS_CREATE(drm_sun4i_gem_dumb_create),
I agree with Sam here. With this change,
Quoted 213 lines
Please fix
zte/zx_drm_drv.cwhich also usesDRM_GEM_CMA_VMAP_DRIVER_OPS.The naming is a bikeshedding topic that we may not agree on, soo..
With zte fixed the patch is:
Reviewed-by Sam Ravnborg <[email protected]>Quoted 206 lines
Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/drm_gem_cma_helper.c | 2 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +-- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tiny/hx8357d.c | 2 +- drivers/gpu/drm/tiny/ili9225.c | 2 +- drivers/gpu/drm/tiny/ili9341.c | 2 +- drivers/gpu/drm/tiny/ili9486.c | 2 +- drivers/gpu/drm/tiny/mi0283qt.c | 2 +- drivers/gpu/drm/tiny/repaper.c | 2 +- drivers/gpu/drm/tiny/st7586.c | 2 +- drivers/gpu/drm/tiny/st7735r.c | 2 +- include/drm/drm_gem_cma_helper.h | 24 ++++++++++++++++++++---- 12 files changed, 31 insertions(+), 16 deletions(-)drivers/gpu/drm/drm_gem_cma_helper.c +1
-1@@ -620,7 +620,7 @@ EXPORT_SYMBOL(drm_cma_gem_create_object_default_funcs);* address set. This address is released when the object is freed. * * This function can be used as the &drm_driver.gem_prime_import_sg_table -* callback. The DRM_GEM_CMA_VMAP_DRIVER_OPS() macro provides a shortcut to set +* callback. The &DRM_GEM_CMA_DRIVER_OPS macro provides a shortcut to set * the necessary DRM driver operations. * * Returns: drivers/gpu/drm/sun4i/sun4i_drv.c +1
-2@@ -52,8 +52,7 @@ static struct drm_driver sun4i_drv_driver = { .minor = 0,/* GEM Operations */ -DRM_GEM_CMA_VMAP_DRIVER_OPS , - .dumb_create = drm_sun4i_gem_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(drm_sun4i_gem_dumb_create), };static int sun4i_drv_bind (struct device *dev)drivers/gpu/drm/tidss/tidss_drv.c +1
-1@@ -112,7 +112,7 @@ static struct drm_driver tidss_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &tidss_fops, .release = tidss_release, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name = "tidss", .desc = "TI Keystone DSS", .date = "20180215",drivers/gpu/drm/tiny/hx8357d.c +1
-1@@ -196,7 +196,7 @@ DEFINE_DRM_GEM_CMA_FOPS(hx8357d_fops);static struct drm_driver hx8357d_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &hx8357d_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="hx8357d" , .desc ="HX8357D" ,drivers/gpu/drm/tiny/ili9225.c +1
-1@@ -346,7 +346,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9225_fops);static struct drm_driver ili9225_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9225_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name ="ili9225" , .desc ="Ilitek ILI9225" , .date ="20171106" ,drivers/gpu/drm/tiny/ili9341.c +1
-1@@ -152,7 +152,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9341_fops);static struct drm_driver ili9341_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9341_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="ili9341" , .desc ="Ilitek ILI9341" ,drivers/gpu/drm/tiny/ili9486.c +1
-1@@ -165,7 +165,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9486_fops);static struct drm_driver ili9486_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9486_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="ili9486" , .desc ="Ilitek ILI9486" ,drivers/gpu/drm/tiny/mi0283qt.c +1
-1@@ -156,7 +156,7 @@ DEFINE_DRM_GEM_CMA_FOPS(mi0283qt_fops);static struct drm_driver mi0283qt_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &mi0283qt_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="mi0283qt" , .desc ="Multi-Inno MI0283QT" ,drivers/gpu/drm/tiny/repaper.c +1
-1@@ -946,7 +946,7 @@ DEFINE_DRM_GEM_CMA_FOPS(repaper_fops);static struct drm_driver repaper_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &repaper_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name ="repaper" , .desc ="Pervasive Displays RePaper e-ink panels" , .date ="20170405" ,drivers/gpu/drm/tiny/st7586.c +1
-1@@ -285,7 +285,7 @@ DEFINE_DRM_GEM_CMA_FOPS(st7586_fops);static struct drm_driver st7586_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &st7586_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="st7586" , .desc ="Sitronix ST7586" ,drivers/gpu/drm/tiny/st7735r.c +1
-1@@ -157,7 +157,7 @@ DEFINE_DRM_GEM_CMA_FOPS(st7735r_fops);static struct drm_driver st7735r_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &st7735r_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="st7735r" , .desc ="Sitronix ST7735R" ,include/drm/drm_gem_cma_helper.h +20
-4@@ -110,21 +110,37 @@ struct drm_gem_object * drm_cma_gem_create_object_default_funcs(struct drm_device *dev, size_t size);/** -* DRM_GEM_CMA_VMAP_DRIVER_OPS - CMA GEM driver operations ensuring a virtual -* address on the buffer +* __DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations ensuring a +* virtual address on the buffer +* @__dumb_create: callback function for .dumb_create * * This macro provides a shortcut for setting the default GEM operations in the * &drm_driver structure for drivers that need the virtual address also on * imported buffers. +* +* This macro is a variant of DRM_GEM_CMA_DRIVER_OPS for drivers that +* override the default implementation of .dumb_create. Use +* DRM_GEM_CMA_DRIVER_OPS if possible. */ -#define DRM_GEM_CMA_VMAP_DRIVER_OPS \ +#define __DRM_GEM_CMA_DRIVER_OPS (__dumb_create) \ .gem_create_object = drm_cma_gem_create_object_default_funcs, \ - .dumb_create = drm_gem_cma_dumb_create, \ + .dumb_create = (__dumb_create), \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \ .gem_prime_mmap = drm_gem_prime_mmap +/** +* DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations ensuring a virtual +* address on the buffer +* +* This macro provides a shortcut for setting the default GEM operations in the +* &drm_driver structure for drivers that need the virtual address also on +* imported buffers. +*/ +#define DRM_GEM_CMA_DRIVER_OPS \ + __DRM_GEM_CMA_DRIVER_OPS(drm_gem_cma_dumb_create) +struct drm_gem_object * drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *drm, struct dma_buf_attachment *attach,
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 15/21] drm/rcar-du: Use GEM CMA object functions
In reply to Thomas ZimmermannHi Thomas,
Thank you for the patch.
Quoted 19 lines · Thomas Zimmermann
The rcar-du driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-1@@ -476,16 +476,7 @@ DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops);static struct drm_driver rcar_du_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/rcar-du/rcar_du_drv.c DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops); · line 479
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1
-9- .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = rcar_du_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(rcar_du_dumb_create),
Your __DRM_GEM_CMA_DRIVER_OPS is defined as
#define __DRM_GEM_CMA_DRIVER_OPS(__dumb_create) \
.gem_create_object = drm_cma_gem_create_object_default_funcs, \
.dumb_create = (__dumb_create), \
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
.prime_fd_to_handle = drm_gem_prime_fd_to_handle, \
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \
.gem_prime_mmap = drm_gem_prime_mmapThe patch thus introduces several changes:
- drm_gem_cma_prime_import_sg_table_vmap() is used instead of drm_gem_cma_prime_import_sg_table() combined with .gem_prime_vmap() and .gem_prime_vunmap(). I believe that's fine, but splitting that change in a separate commit, or at the very least explaining it in details in the commit message, would make review easier.
- .gem_create_object() is now set. That seems to be OK, but I'm not sure to grasp all the implications. This should also be explained in the commit message, and ideally split to a separate patch.
- drm_gem_cma_prime_mmap() is replaced with drm_gem_prime_mmap(). Same comments :-)
This patch hides way too many changes in what is documented as just innocent refactoring. It seems other drivers are affected too.
Quoted 3 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-0.fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",
Signature · 3 lines
Regards, Laurent Pinchart
kbuild test robot
build botRe: [PATCH 21/21] drm/zte: Use GEM CMA object functions
In reply to Thomas ZimmermannI love your patch! Yet something to improve:
Hi Thomas,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20200519]
[cannot apply to sunxi/sunxi/for-next joel-aspeed/for-next shawnguo/for-next stm32/stm32-next linus/master pinchartl-media/drm/du/next v5.7-rc6 v5.7-rc5 v5.7-rc4 v5.7-rc6] [if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Convert-most-CMA-based-drivers-to-GEM-object-functions/20200522-215754 base: fb57b1fabcb28f358901b2df90abd2b48abc1ca8 config: arm64-randconfig-r032-20200524 (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/gpu/drm/zte/zx_drm_drv.c:39:2: error: use of undeclared identifier 'DRM_GEM_CMA_VMAP_DRIVER_OPS'
DRM_GEM_CMA_VMAP_DRIVER_OPS,
^
1 error generated.
vim +/DRM_GEM_CMA_VMAP_DRIVER_OPS +39 drivers/gpu/drm/zte/zx_drm_drv.c
36
37 static struct drm_driver zx_drm_driver = {
38 .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
> 39 DRM_GEM_CMA_VMAP_DRIVER_OPS,
40 .fops = &zx_drm_fops,
41 .name = "zx-vou",
42 .desc = "ZTE VOU Controller DRM",
43 .date = "20160811",
44 .major = 1,
45 .minor = 0,
46 };
47 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 41332 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200524/815e8167/attachment-0001.gz>
kbuild test robot
build botRe: [PATCH 21/21] drm/zte: Use GEM CMA object functions
In reply to Thomas ZimmermannI love your patch! Yet something to improve:
Hi Thomas,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20200519]
[cannot apply to sunxi/sunxi/for-next joel-aspeed/for-next shawnguo/for-next stm32/stm32-next linus/master pinchartl-media/drm/du/next v5.7-rc6 v5.7-rc5 v5.7-rc4 v5.7-rc6] [if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Convert-most-CMA-based-drivers-to-GEM-object-functions/20200522-215754 base: fb57b1fabcb28f358901b2df90abd2b48abc1ca8 config: arm-allyesconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/gpu/drm/zte/zx_drm_drv.c:39:2: error: 'DRM_GEM_CMA_VMAP_DRIVER_OPS' undeclared here (not in a function); did you mean 'DRM_GEM_CMA_DRIVER_OPS'? 39 | DRM_GEM_CMA_VMAP_DRIVER_OPS, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ | DRM_GEM_CMA_DRIVER_OPS
vim +39 drivers/gpu/drm/zte/zx_drm_drv.c
36
37 static struct drm_driver zx_drm_driver = {
38 .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
> 39 DRM_GEM_CMA_VMAP_DRIVER_OPS,
40 .fops = &zx_drm_fops,
41 .name = "zx-vou",
42 .desc = "ZTE VOU Controller DRM",
43 .date = "20160811",
44 .major = 1,
45 .minor = 0,
46 };
47 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 74772 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200525/e8300bee/attachment-0001.gz>
Re: [PATCH 12/21] drm/mcde: Use GEM CMA object functions
In reply to Thomas ZimmermannQuoted 5 lines · Thomas Zimmermann
The mcde driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>
Yours,
Linus Walleij
Re: [PATCH 20/21] drm/tv200: Use GEM CMA object functions
In reply to Thomas ZimmermannQuoted 5 lines · Thomas Zimmermann
The tve200 driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>
Yours,
Linus Walleij
Thomas Zimmermann
maintainerRe: [PATCH 01/21] drm/cma-helper: Rework DRM_GEM_CMA_VMAP_DRIVER_OPS macro
In reply to Sam RavnborgHi Sam
Am 22.05.20 um 19:48 schrieb Sam Ravnborg:
Quoted 5 lines
Hi Thomas.
Quoted 2 lines · Thomas Zimmermann
Rename the macro to
DRM_GEM_CMA_DRIVER_OPSto align with SHMEM helpers.
Quoted 8 lines
This part is fine, I like that the naming is somehow consistent.
Quoted 2 lines
An internal version is provided for drivers that override the default .dumb_create callback. Adapt drivers to the changes.
I loathe anything named
__fooor__FOO. This __ signals to me that the author was clueless in naming - or some sort.
I know that __ is used in some lib headers - but thats not the case here.
I agree with your comment and I've been trying to find a better name before posting the patchset. I considered something like DRM_GEM_CMA_DRIVER_OPS_INTERNAL(), but wasn't happy with that either. In the end, I uses the double underscore to push driver authors towards the other macro. This one's only for the special case of settings a separate implementation for .dumb_create().
Quoted 11 lines
But I love that we have a variant that takes a create function. So we do not have to escape from the nice macro.
The macro is another way to tell me as rewiewer that this drivers uses all the default helpers for this.So critizising the name I better suggest something that I personally like better:
DRM_GEM_CMA_DRIVER_OPS_CREATE()
Can we at least use DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE ? Because there's also gem_object_create.
I'll update the patches accordingly.
I noticed that most of the affected drivers do some kind of alignment calculation in their dumb_create code. IMHO in the long run, we should move such calculations into the default implementation and put the control paramters into struct drm_mode_config.
Best regards
Thomas
Quoted 234 lines
It would look like this:
/* GEM Operations */drivers/gpu/drm/sun4i/sun4i_drv.c +1
-2- DRM_GEM_CMA_VMAP_DRIVER_OPS, - .dumb_create = drm_sun4i_gem_dumb_create, + DRM_GEM_CMA_DRIVER_OPS_CREATE(drm_sun4i_gem_dumb_create),Please fix
zte/zx_drm_drv.cwhich also usesDRM_GEM_CMA_VMAP_DRIVER_OPS.The naming is a bikeshedding topic that we may not agree on, soo..
With zte fixed the patch is:
Reviewed-by Sam Ravnborg <[email protected]>Sam
Quoted 209 lines
Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/drm_gem_cma_helper.c | 2 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +-- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tiny/hx8357d.c | 2 +- drivers/gpu/drm/tiny/ili9225.c | 2 +- drivers/gpu/drm/tiny/ili9341.c | 2 +- drivers/gpu/drm/tiny/ili9486.c | 2 +- drivers/gpu/drm/tiny/mi0283qt.c | 2 +- drivers/gpu/drm/tiny/repaper.c | 2 +- drivers/gpu/drm/tiny/st7586.c | 2 +- drivers/gpu/drm/tiny/st7735r.c | 2 +- include/drm/drm_gem_cma_helper.h | 24 ++++++++++++++++++++---- 12 files changed, 31 insertions(+), 16 deletions(-)drivers/gpu/drm/drm_gem_cma_helper.c +1
-1@@ -620,7 +620,7 @@ EXPORT_SYMBOL(drm_cma_gem_create_object_default_funcs);* address set. This address is released when the object is freed. * * This function can be used as the &drm_driver.gem_prime_import_sg_table -* callback. The DRM_GEM_CMA_VMAP_DRIVER_OPS() macro provides a shortcut to set +* callback. The &DRM_GEM_CMA_DRIVER_OPS macro provides a shortcut to set * the necessary DRM driver operations. * * Returns: drivers/gpu/drm/sun4i/sun4i_drv.c +1
-2@@ -52,8 +52,7 @@ static struct drm_driver sun4i_drv_driver = { .minor = 0,/* GEM Operations */ -DRM_GEM_CMA_VMAP_DRIVER_OPS , - .dumb_create = drm_sun4i_gem_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(drm_sun4i_gem_dumb_create), };static int sun4i_drv_bind (struct device *dev)drivers/gpu/drm/tidss/tidss_drv.c +1
-1@@ -112,7 +112,7 @@ static struct drm_driver tidss_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &tidss_fops, .release = tidss_release, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name = "tidss", .desc = "TI Keystone DSS", .date = "20180215",drivers/gpu/drm/tiny/hx8357d.c +1
-1@@ -196,7 +196,7 @@ DEFINE_DRM_GEM_CMA_FOPS(hx8357d_fops);static struct drm_driver hx8357d_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &hx8357d_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="hx8357d" , .desc ="HX8357D" ,drivers/gpu/drm/tiny/ili9225.c +1
-1@@ -346,7 +346,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9225_fops);static struct drm_driver ili9225_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9225_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name ="ili9225" , .desc ="Ilitek ILI9225" , .date ="20171106" ,drivers/gpu/drm/tiny/ili9341.c +1
-1@@ -152,7 +152,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9341_fops);static struct drm_driver ili9341_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9341_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="ili9341" , .desc ="Ilitek ILI9341" ,drivers/gpu/drm/tiny/ili9486.c +1
-1@@ -165,7 +165,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9486_fops);static struct drm_driver ili9486_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ili9486_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="ili9486" , .desc ="Ilitek ILI9486" ,drivers/gpu/drm/tiny/mi0283qt.c +1
-1@@ -156,7 +156,7 @@ DEFINE_DRM_GEM_CMA_FOPS(mi0283qt_fops);static struct drm_driver mi0283qt_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &mi0283qt_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="mi0283qt" , .desc ="Multi-Inno MI0283QT" ,drivers/gpu/drm/tiny/repaper.c +1
-1@@ -946,7 +946,7 @@ DEFINE_DRM_GEM_CMA_FOPS(repaper_fops);static struct drm_driver repaper_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &repaper_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .name ="repaper" , .desc ="Pervasive Displays RePaper e-ink panels" , .date ="20170405" ,drivers/gpu/drm/tiny/st7586.c +1
-1@@ -285,7 +285,7 @@ DEFINE_DRM_GEM_CMA_FOPS(st7586_fops);static struct drm_driver st7586_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &st7586_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="st7586" , .desc ="Sitronix ST7586" ,drivers/gpu/drm/tiny/st7735r.c +1
-1@@ -157,7 +157,7 @@ DEFINE_DRM_GEM_CMA_FOPS(st7735r_fops);static struct drm_driver st7735r_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &st7735r_fops, -DRM_GEM_CMA_VMAP_DRIVER_OPS , +DRM_GEM_CMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name ="st7735r" , .desc ="Sitronix ST7735R" ,include/drm/drm_gem_cma_helper.h +20
-4@@ -110,21 +110,37 @@ struct drm_gem_object * drm_cma_gem_create_object_default_funcs(struct drm_device *dev, size_t size);/** -* DRM_GEM_CMA_VMAP_DRIVER_OPS - CMA GEM driver operations ensuring a virtual -* address on the buffer +* __DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations ensuring a +* virtual address on the buffer +* @__dumb_create: callback function for .dumb_create * * This macro provides a shortcut for setting the default GEM operations in the * &drm_driver structure for drivers that need the virtual address also on * imported buffers. +* +* This macro is a variant of DRM_GEM_CMA_DRIVER_OPS for drivers that +* override the default implementation of .dumb_create. Use +* DRM_GEM_CMA_DRIVER_OPS if possible. */ -#define DRM_GEM_CMA_VMAP_DRIVER_OPS \ +#define __DRM_GEM_CMA_DRIVER_OPS (__dumb_create) \ .gem_create_object = drm_cma_gem_create_object_default_funcs, \ - .dumb_create = drm_gem_cma_dumb_create, \ + .dumb_create = (__dumb_create), \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \ .gem_prime_mmap = drm_gem_prime_mmap +/** +* DRM_GEM_CMA_DRIVER_OPS - CMA GEM driver operations ensuring a virtual +* address on the buffer +* +* This macro provides a shortcut for setting the default GEM operations in the +* &drm_driver structure for drivers that need the virtual address also on +* imported buffers. +*/ +#define DRM_GEM_CMA_DRIVER_OPS \ + __DRM_GEM_CMA_DRIVER_OPS(drm_gem_cma_dumb_create) +struct drm_gem_object * drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *drm, struct dma_buf_attachment *attach,Signature · 1 line
2.26.2_______________________________________________
dri-devel mailing list
dri-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200525/d393bb4a/attachment-0001.sig>
Thomas Zimmermann
maintainerRe: [PATCH 05/21] drm/atmel-hlcdc: Use GEM CMA object functions
In reply to Sam RavnborgHi
Am 22.05.20 um 20:08 schrieb Sam Ravnborg:
Quoted 12 lines
Hi Thomas.
Quoted 3 lines · Thomas Zimmermann
The atmel-hlcdc driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.A nice side-effect of introducing the defualt implementation of CMA functions is that this driver is now migrated over to use
drm_gem_object_funcs, which is why we can replace all these helpers with a simple macro that defined only 6 helpers.
Quoted 8 lines
With an improved changelog:
Reviewed-by Sam Ravnborg <[email protected]>And as I said in the other mail, this is really nice. It is now much more obvious that this drivers uses all the default helpers for CMA.
And I can drop one item from my TODO list on top of that.
There's still more to do. The current macro still sets .gem_object_create to a CMA default. But that pointer is the interface where drivers can override some of the CMA object defaults, so it should not be set by CMA helpers.
After the other CMA drivers have been converted to GEM object functions, this setting can be kept to zero and __drm_gem_cma_create() can set the default object functions. SHMEM and VRAM helpers already work this way.
Best regards
Thomas
Quoted 38 lines
Sam
Quoted 30 lines
Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1
-10@@ -821,16 +821,7 @@ static struct drm_driver atmel_hlcdc_dc_driver = { .irq_preinstall = atmel_hlcdc_dc_irq_uninstall, .irq_postinstall = atmel_hlcdc_dc_irq_postinstall, .irq_uninstall = atmel_hlcdc_dc_irq_uninstall, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = drm_gem_cma_dumb_create, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name = "atmel-hlcdc", .desc = "Atmel HLCD Controller DRM",Signature · 1 line
2.26.2_______________________________________________
dri-devel mailing list
dri-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200525/5231eac0/attachment-0001.sig>
Thomas Zimmermann
maintainerRe: [PATCH 05/21] drm/atmel-hlcdc: Use GEM CMA object functions
In reply to Sam RavnborgHi
Am 22.05.20 um 21:25 schrieb Sam Ravnborg:
Quoted 29 lines
Hi Thomas.
Quoted 25 lines · Thomas Zimmermann
The atmel-hlcdc driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0
-8@@ -821,16 +821,7 @@ static struct drm_driver atmel_hlcdc_dc_driver = { .irq_preinstall = atmel_hlcdc_dc_irq_uninstall, .irq_postinstall = atmel_hlcdc_dc_irq_postinstall, .irq_uninstall = atmel_hlcdc_dc_irq_uninstall, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap,
Quoted 7 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c static struct drm_driver atmel_hlcdc_dc_driver = { · line 832
Quoted 1 line
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0
-1- .gem_prime_mmap = drm_gem_cma_prime_mmap,When using
DRM_GEM_CMA_DRIVER_OPSgem_prime_mmapis set todrm_gem_prime_mmap.
Why is this the same asdrm_gem_cma_prime_mmap?Maybe this is all obvious when you know all the CMA stuff, but this puzzeled me.
Following through the calls is far from easy.
I took the macro from the aspeed driver. I had some doubts about the mmap code, but expected the driver to be working correctly. Maybe we should set that field to drm_gem_cma_prime_mmap or implement the mmap object function.
Best regards
Thomas
Quoted 11 lines
Sam
Quoted 7 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1
-1- .dumb_create = drm_gem_cma_dumb_create, + DRM_GEM_CMA_DRIVER_OPS, .fops = &fops, .name = "atmel-hlcdc", .desc = "Atmel HLCD Controller DRM",Signature · 1 line
2.26.2
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200525/8d211b2a/attachment-0001.sig>
Thomas Zimmermann
maintainerRe: [PATCH 07/21] drm/hisilicon/kirin: Use GEM CMA object functions
In reply to Emil VelikovHi Emil
Am 22.05.20 um 20:11 schrieb Emil Velikov:
Quoted 30 lines
Hi Thomas,
Quoted 16 lines · Thomas Zimmermann
The kirin driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0
-0drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c DEFINE_DRM_GEM_CMA_FOPS(ade_fops); · line 926
Quoted 6 lines
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0
-3@@ -921,17 +921,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ade_fops);static struct drm_driver ade_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ade_fops, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create_internal,This doesn't seem right. The
_internaldocumentation explicitly says that this should _not_ be used as .dumb_create. Instead drivers should use it to implement their callback.
Quoted 2 lines
Since it yields the same result as
drm_gem_cma_dumb_createwe can use the default macro below.
I noticed this and thought that the driver authors probably had their reasons. Changing the driver to the default macro is probably still a good idea.
Best regards
Thomas
Quoted 11 lines
Weather to the .dumb_create in separate patch, or squash it here - I'll leave to you.
In case of the latter, please mentioned it in the commit message.-Emil
_______________________________________________
dri-devel mailing list
dri-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200525/b157fedc/attachment-0001.sig>
Thomas Zimmermann
maintainerRe: [PATCH 15/21] drm/rcar-du: Use GEM CMA object functions
In reply to Laurent PinchartHi
Am 22.05.20 um 22:12 schrieb Laurent Pinchart:
Quoted 53 lines
Hi Thomas,
Thank you for the patch.
Quoted 19 lines · Thomas Zimmermann
The rcar-du driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-1@@ -476,16 +476,7 @@ DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops);static struct drm_driver rcar_du_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object,drivers/gpu/drm/rcar-du/rcar_du_drv.c DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops); · line 479
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1
-9- .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = rcar_du_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(rcar_du_dumb_create),Your
__DRM_GEM_CMA_DRIVER_OPSis defined as#define __DRM_GEM_CMA_DRIVER_OPS(__dumb_create) \ .gem_create_object = drm_cma_gem_create_object_default_funcs, \ .dumb_create = (__dumb_create), \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \ .gem_prime_mmap = drm_gem_prime_mmapThe patch thus introduces several changes:
-
drm_gem_cma_prime_import_sg_table_vmap()is used instead ofdrm_gem_cma_prime_import_sg_table()combined with .gem_prime_vmap() and .gem_prime_vunmap(). I believe that's fine, but splitting that change in a separate commit, or at the very least explaining it in details in the commit message, would make review easier.
Quoted 3 lines
- .gem_create_object() is now set. That seems to be OK, but I'm not sure to grasp all the implications. This should also be explained in the commit message, and ideally split to a separate patch.
That's relevant during object creation and sets the object functions. See one of my other replies for how this can go away after all CMA drivers have been updated to GEM object functions.
Quoted 3 lines
-
drm_gem_cma_prime_mmap()is replaced withdrm_gem_prime_mmap(). Same comments :-)
I relied on the aspeed driver to be correct. After Sam's comment on that, I read the code once again several times. The original implementation clears VM_PFNMAP. And I cannot find that code any longer. Going back to the original function might be better.
Quoted 3 lines
This patch hides way too many changes in what is documented as just innocent refactoring. It seems other drivers are affected too.
Could you test the patchset? I don't have the HW.
Best regards
Thomas
Quoted 5 lines
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-0.fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200525/7c94f342/attachment-0001.sig>
Thomas Zimmermann
maintainerRe: [PATCH 12/21] drm/mcde: Use GEM CMA object functions
In reply to Linus WalleijHi
Am 25.05.20 um 13:36 schrieb Linus Walleij:
Quoted 9 lines · Thomas Zimmermann
Quoted 6 lines
The mcde driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>Reviewed-by Linus Walleij <[email protected]>
Could you boot-test with the patchset applied?
Best regards
Thomas
Quoted 4 lines
Yours,
Linus Walleij
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200525/8231d91f/attachment-0001.sig>
Re: [PATCH 12/21] drm/mcde: Use GEM CMA object functions
Quoted 7 lines · Thomas Zimmermann
Am 25.05.20 um 13:36 schrieb Linus Walleij:
Quoted 6 lines · Thomas Zimmermann
Quoted 5 lines
The mcde driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Thomas Zimmermann <[email protected]>Reviewed-by Linus Walleij <[email protected]>Could you boot-test with the patchset applied?
Yes, if you have a git branch I can just build and boot I can do it quickly!
I have no idea what this patch set is based on so it could be hard to figure out the dependencies otherwise. Also many patches.
Yours,
Linus Walleij
Thomas Zimmermann
maintainerRe: [PATCH 12/21] drm/mcde: Use GEM CMA object functions
Hi
Am 25.05.20 um 15:08 schrieb Linus Walleij:
Quoted 8 lines · Thomas Zimmermann
Quoted 7 lines
Am 25.05.20 um 13:36 schrieb Linus Walleij:
Quoted 6 lines · Thomas Zimmermann
Quoted 5 lines
The mcde driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Thomas Zimmermann <[email protected]>Reviewed-by Linus Walleij <[email protected]>Could you boot-test with the patchset applied?
Yes, if you have a git branch I can just build and boot I can do it quickly!
Fantastic! It's the cma-objfuncs branch of
https://gitlab.freedesktop.org/tzimmermann/linux.git
Here's the gitlab page:
https://gitlab.freedesktop.org/tzimmermann/linux/-/tree/cma-objfuncs
Best regards
Thomas
Quoted 12 lines
I have no idea what this patch set is based on so it could be hard to figure out the dependencies otherwise. Also many patches.
Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
dri-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200525/9a300c93/attachment-0001.sig>
Kieran Bingham
Tested-byRe: [PATCH 15/21] drm/rcar-du: Use GEM CMA object functions
In reply to Thomas ZimmermannQuoted 76 lines · Thomas Zimmermann
Hi
Am 22.05.20 um 22:12 schrieb Laurent Pinchart:
Quoted 53 lines
Hi Thomas,
Thank you for the patch.
Quoted 19 lines · Thomas Zimmermann
The rcar-du driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-1@@ -476,16 +476,7 @@ DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops);static struct drm_driver rcar_du_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object,drivers/gpu/drm/rcar-du/rcar_du_drv.c DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops); · line 479
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1
-9- .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = rcar_du_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(rcar_du_dumb_create),Your
__DRM_GEM_CMA_DRIVER_OPSis defined as#define __DRM_GEM_CMA_DRIVER_OPS(__dumb_create) \ .gem_create_object = drm_cma_gem_create_object_default_funcs, \ .dumb_create = (__dumb_create), \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \ .gem_prime_mmap = drm_gem_prime_mmapThe patch thus introduces several changes:
-
drm_gem_cma_prime_import_sg_table_vmap()is used instead ofdrm_gem_cma_prime_import_sg_table()combined with .gem_prime_vmap() and .gem_prime_vunmap(). I believe that's fine, but splitting that change in a separate commit, or at the very least explaining it in details in the commit message, would make review easier.Quoted 3 lines
- .gem_create_object() is now set. That seems to be OK, but I'm not sure to grasp all the implications. This should also be explained in the commit message, and ideally split to a separate patch.
That's relevant during object creation and sets the object functions. See one of my other replies for how this can go away after all CMA drivers have been updated to GEM object functions.
Quoted 3 lines
-
drm_gem_cma_prime_mmap()is replaced withdrm_gem_prime_mmap(). Same comments :-)I relied on the aspeed driver to be correct. After Sam's comment on that, I read the code once again several times. The original implementation clears
VM_PFNMAP. And I cannot find that code any longer. Going back to the original function might be better.Quoted 1 line
Quoted 4 lines
Quoted 2 lines
This patch hides way too many changes in what is documented as just innocent refactoring. It seems other drivers are affected too.
Could you test the patchset? I don't have the HW.
Digging out the branch you provided elsewhere in this thread:
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Could you boot-test with the patchset applied?
Yes, if you have a git branch I can just build and boot I can do it quickly!
Fantastic! It's the cma-objfuncs branch of
I have successfully run our display tests with your patches here on an R-Car H3 Salvator-XS(-es2).
Quoted 9 lines
Best regards
ThomasQuoted 5 lines
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-0.fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",
Re: [PATCH 15/21] drm/rcar-du: Use GEM CMA object functions
In reply to Thomas ZimmermannHi Thomas,
Quoted 50 lines · Thomas Zimmermann
Am 22.05.20 um 22:12 schrieb Laurent Pinchart:
Quoted 49 lines · Thomas Zimmermann
Quoted 19 lines
The rcar-du driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-1@@ -476,16 +476,7 @@ DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops);static struct drm_driver rcar_du_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object,drivers/gpu/drm/rcar-du/rcar_du_drv.c DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops); · line 479
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1
-9- .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = rcar_du_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(rcar_du_dumb_create),Your
__DRM_GEM_CMA_DRIVER_OPSis defined as#define __DRM_GEM_CMA_DRIVER_OPS(__dumb_create) \ .gem_create_object = drm_cma_gem_create_object_default_funcs, \ .dumb_create = (__dumb_create), \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \ .gem_prime_mmap = drm_gem_prime_mmapThe patch thus introduces several changes:
-
drm_gem_cma_prime_import_sg_table_vmap()is used instead ofdrm_gem_cma_prime_import_sg_table()combined with .gem_prime_vmap() and .gem_prime_vunmap(). I believe that's fine, but splitting that change in a separate commit, or at the very least explaining it in details in the commit message, would make review easier.
Quoted 7 lines
Quoted 3 lines
- .gem_create_object() is now set. That seems to be OK, but I'm not sure to grasp all the implications. This should also be explained in the commit message, and ideally split to a separate patch.
That's relevant during object creation and sets the object functions. See one of my other replies for how this can go away after all CMA drivers have been updated to GEM object functions.
I don't dispute that's fine, but I think it should really be explained in the commit message, and ideally split to a separate patch.
Quoted 8 lines
Quoted 2 lines
-
drm_gem_cma_prime_mmap()is replaced withdrm_gem_prime_mmap(). Same comments :-)I relied on the aspeed driver to be correct. After Sam's comment on that, I read the code once again several times. The original implementation clears
VM_PFNMAP. And I cannot find that code any longer. Going back to the original function might be better.
Quoted 4 lines
Quoted 2 lines
This patch hides way too many changes in what is documented as just innocent refactoring. It seems other drivers are affected too.
Could you test the patchset? I don't have the HW.
Kieran has beaten me to it :-)
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-0.fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 17/21] drm/stm: Use GEM CMA object functions
In reply to Thomas ZimmermannQuoted 23 lines · Thomas Zimmermann
The stm driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/stm/drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/stm/drv.c +0
-4@@ -62,16 +62,7 @@ static struct drm_driver drv_driver = { .minor = 0, .patchlevel = 0, .fops = &drv_driver_fops, - .dumb_create = stm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/stm/drv.c static struct drm_driver drv_driver = { · line 68
Quoted 10 lines
drivers/gpu/drm/stm/drv.c +1
-6- .gem_vm_ops = &drm_gem_cma_vm_ops, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, + __DRM_GEM_CMA_DRIVER_OPS(stm_gem_cma_dumb_create), };static int drv_load (struct drm_device *ddev)
Hi Thomas,
Thank you for the patch.
Philippe :-)
Re: [PATCH 03/21] drm/arm: Use GEM CMA object functions
In reply to Thomas ZimmermannQuoted 5 lines · Thomas Zimmermann
The arm driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>
Thanks!
Liviu
Quoted 30 lines
--- drivers/gpu/drm/arm/hdlcd_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)drivers/gpu/drm/arm/hdlcd_drv.c +1
-11@@ -240,17 +240,7 @@ static struct drm_driver hdlcd_driver = { .irq_preinstall = hdlcd_irq_preinstall, .irq_postinstall = hdlcd_irq_postinstall, .irq_uninstall = hdlcd_irq_uninstall, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_print_info = drm_gem_cma_print_info, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , #ifdef CONFIG_DEBUG_FS .debugfs_init = hdlcd_debugfs_init, #endifSignature · 1 line
2.26.2
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
?\_(?)_/?Re: [PATCH 10/21] drm/komeda: Use GEM CMA object functions
In reply to Thomas ZimmermannQuoted 6 lines · Thomas Zimmermann
The komeda driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>
Best regards,
Liviu
Quoted 29 lines
--- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/arm/display/komeda/komeda_kms.c +1
-10@@ -61,16 +61,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)static struct drm_driver komeda_kms_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .lastclose = drm_fb_helper_lastclose, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = komeda_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +__DRM_GEM_CMA_DRIVER_OPS (komeda_gem_cma_dumb_create), .fops = &komeda_cma_fops, .name ="komeda" , .desc ="Arm Komeda Display Processor driver" ,Signature · 1 line
2.26.2
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
?\_(?)_/?Re: [PATCH 11/21] drm/malidp: Use GEM CMA object functions
In reply to Thomas ZimmermannQuoted 6 lines · Thomas Zimmermann
The malidp driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>
Best regards,
Liviu
Quoted 29 lines
--- drivers/gpu/drm/arm/malidp_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/arm/malidp_drv.c +1
-10@@ -563,16 +563,7 @@ static void malidp_debugfs_init(struct drm_minor *minor)static struct drm_driver malidp_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = malidp_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +__DRM_GEM_CMA_DRIVER_OPS (malidp_dumb_create), #ifdef CONFIG_DEBUG_FS .debugfs_init = malidp_debugfs_init, #endifSignature · 1 line
2.26.2
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
?\_(?)_/?Re: [PATCH 09/21] drm/ingenic: Use GEM CMA object functions
In reply to Thomas ZimmermannHi Thomas,
Le ven. 22 mai 2020 ? 15:52, Thomas Zimmermann <[email protected]> a ?crit :
Quoted 7 lines
The ingenic driver uses the default implementation for CMA functions. The
DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults in structdrm_driver.
All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>
Cheers,
-Paul
Quoted 33 lines
--- drivers/gpu/drm/ingenic/ingenic-drm.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)drivers/gpu/drm/ingenic/ingenic-drm.c +1
-12@@ -519,18 +519,7 @@ static struct drm_driver ingenic_drm_driver_data = { .patchlevel = 0, .fops = &ingenic_drm_fops, - - .dumb_create = drm_gem_cma_dumb_create, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , .irq_handler = ingenic_drm_irq_handler,};
--
2.26.2
Re: [PATCH 07/21] drm/hisilicon/kirin: Use GEM CMA object functions
In reply to Thomas ZimmermannQuoted 34 lines · Thomas Zimmermann
Hi Emil
Am 22.05.20 um 20:11 schrieb Emil Velikov:
Quoted 30 lines
Hi Thomas,
Quoted 16 lines · Thomas Zimmermann
The kirin driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0
-0drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c DEFINE_DRM_GEM_CMA_FOPS(ade_fops); · line 926
Quoted 6 lines
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0
-3@@ -921,17 +921,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ade_fops);static struct drm_driver ade_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .fops = &ade_fops, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create_internal,This doesn't seem right. The
_internaldocumentation explicitly says that this should _not_ be used as .dumb_create. Instead drivers should use it to implement their callback.
Quoted 7 lines
Quoted 2 lines
Since it yields the same result as
drm_gem_cma_dumb_createwe can use the default macro below.I noticed this and thought that the driver authors probably had their reasons. Changing the driver to the default macro is probably still a good idea.
To be on the _extra_ safe side might want to keep that separate patch explicitly CC-ing the author/reviewers of the offending commit. Although as said before - it's your call, I'm fine either way.
HTH
Emil
Thomas Zimmermann
maintainerRe: [PATCH 15/21] drm/rcar-du: Use GEM CMA object functions
In reply to Kieran BinghamHi
Am 25.05.20 um 17:38 schrieb Kieran Bingham:
Quoted 89 lines · Thomas Zimmermann
Quoted 76 lines
Hi
Am 22.05.20 um 22:12 schrieb Laurent Pinchart:
Quoted 53 lines
Hi Thomas,
Thank you for the patch.
Quoted 19 lines · Thomas Zimmermann
The rcar-du driver uses the default implementation for CMA functions; except for the .dumb_create callback. The
__DRM_GEM_CMA_DRIVER_OPSmacro now sets these defaults and .dumb_create in structdrm_driver. All remaining operations are provided by CMA GEM object functions.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-1@@ -476,16 +476,7 @@ DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops);static struct drm_driver rcar_du_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_free_object_unlocked = drm_gem_cma_free_object,drivers/gpu/drm/rcar-du/rcar_du_drv.c DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops); · line 479
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1
-9- .gem_vm_ops = &drm_gem_cma_vm_ops, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, - .dumb_create = rcar_du_dumb_create, + __DRM_GEM_CMA_DRIVER_OPS(rcar_du_dumb_create),Your
__DRM_GEM_CMA_DRIVER_OPSis defined as#define __DRM_GEM_CMA_DRIVER_OPS(__dumb_create) \ .gem_create_object = drm_cma_gem_create_object_default_funcs, \ .dumb_create = (__dumb_create), \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \ .gem_prime_mmap = drm_gem_prime_mmapThe patch thus introduces several changes:
-
drm_gem_cma_prime_import_sg_table_vmap()is used instead ofdrm_gem_cma_prime_import_sg_table()combined with .gem_prime_vmap() and .gem_prime_vunmap(). I believe that's fine, but splitting that change in a separate commit, or at the very least explaining it in details in the commit message, would make review easier.Quoted 3 lines
- .gem_create_object() is now set. That seems to be OK, but I'm not sure to grasp all the implications. This should also be explained in the commit message, and ideally split to a separate patch.
That's relevant during object creation and sets the object functions. See one of my other replies for how this can go away after all CMA drivers have been updated to GEM object functions.
Quoted 3 lines
-
drm_gem_cma_prime_mmap()is replaced withdrm_gem_prime_mmap(). Same comments :-)I relied on the aspeed driver to be correct. After Sam's comment on that, I read the code once again several times. The original implementation clears
VM_PFNMAP. And I cannot find that code any longer. Going back to the original function might be better.Quoted 1 line
Quoted 4 lines
Quoted 2 lines
This patch hides way too many changes in what is documented as just innocent refactoring. It seems other drivers are affected too.
Could you test the patchset? I don't have the HW.
Digging out the branch you provided elsewhere in this thread:
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Could you boot-test with the patchset applied?
Yes, if you have a git branch I can just build and boot I can do it quickly!
Quoted 8 lines
Quoted 3 lines
Fantastic! It's the cma-objfuncs branch of
I have successfully run our display tests with your patches here on an R-Car H3 Salvator-XS(-es2).
Tested-by Kieran Bingham <[email protected]>
Thanks for testing.
Quoted 13 lines
Quoted 12 lines
Best regards
ThomasQuoted 5 lines
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-0.fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200603/6368b264/attachment-0001.sig>
Re: [PATCH 04/21] drm/aspeed: Set driver CMA functions with DRM_GEM_CMA_DRIVER_OPS
In reply to Thomas ZimmermannQuoted 5 lines · Thomas Zimmermann
DRM_GEM_CMA_DRIVER_OPSsets the functions in structdrm_driverto their defaults. No functional changes are made.Signed-off-by Thomas Zimmermann <[email protected]>
I just found this in my inbox. I assume it has not been applied as you were after a review.
I will apply it to drm-misc-next.
Cheers,
Joel
Quoted 25 lines
--- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1
-7@@ -188,12 +188,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);static struct drm_driver aspeed_gfx_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_create_object = drm_cma_gem_create_object_default_funcs, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_mmap = drm_gem_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name ="aspeed-gfx-drm" , .desc ="ASPEED GFX DRM" , --2.26.2
Thomas Zimmermann
maintainerRe: [PATCH 04/21] drm/aspeed: Set driver CMA functions with DRM_GEM_CMA_DRIVER_OPS
Hi
Am 09.10.20 um 09:54 schrieb Joel Stanley:
Quoted 9 lines · Thomas Zimmermann
Quoted 5 lines
DRM_GEM_CMA_DRIVER_OPSsets the functions in structdrm_driverto their defaults. No functional changes are made.Signed-off-by Thomas Zimmermann <[email protected]>I just found this in my inbox. I assume it has not been applied as you were after a review.
The patchset as a whole got an A-b and was merged a while ago.
Quoted 2 lines
Reviewed-by Joel Stanley <[email protected]>
Nevertheless thanks for taking a look at the patch.
Best regards
Thomas
Quoted 32 lines
I will apply it to drm-misc-next.
Cheers,
Joel
Quoted 25 lines
--- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1
-7@@ -188,12 +188,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);static struct drm_driver aspeed_gfx_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_create_object = drm_cma_gem_create_object_default_funcs, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_mmap = drm_gem_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name ="aspeed-gfx-drm" , .desc ="ASPEED GFX DRM" , --2.26.2
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 516 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20201009/7b879ce8/attachment-0001.sig>
Joel Stanley
maintainerRe: [PATCH 04/21] drm/aspeed: Set driver CMA functions with DRM_GEM_CMA_DRIVER_OPS
Quoted 9 lines · Thomas Zimmermann
Hi
Am 09.10.20 um 09:54 schrieb Joel Stanley:
Quoted 5 lines · Thomas Zimmermann
Quoted 4 lines
DRM_GEM_CMA_DRIVER_OPSsets the functions in structdrm_driverto their defaults. No functional changes are made.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Thomas Zimmermann <[email protected]>I just found this in my inbox. I assume it has not been applied as you were after a review.
The patchset as a whole got an A-b and was merged a while ago.
I'm a bit confused, I couldn't see it in any tree. The aspeed one seemed to have been skipped when applying the series.
I looked at today's linux-next and drm-misc-next.
Quoted 49 lines
Quoted 2 lines
Reviewed-by Joel Stanley <[email protected]>Nevertheless thanks for taking a look at the patch.
Best regards
ThomasQuoted 17 lines
I will apply it to drm-misc-next.
Cheers,
Joel
Quoted 10 lines
--- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +0
-0@@ -188,12 +188,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);Quoted 15 lines
Quoted 13 lines
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1
-7static struct drm_driver aspeed_gfx_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_create_object = drm_cma_gem_create_object_default_funcs, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_mmap = drm_gem_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name ="aspeed-gfx-drm" , .desc ="ASPEED GFX DRM" , --Quoted 2 lines
2.26.2
--
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
Re: [PATCH 04/21] drm/aspeed: Set driver CMA functions with DRM_GEM_CMA_DRIVER_OPS
Hi
Am 09.10.20 um 10:06 schrieb Joel Stanley:
Quoted 15 lines · Thomas Zimmermann
Quoted 14 lines
Hi
Am 09.10.20 um 09:54 schrieb Joel Stanley:
Quoted 9 lines · Thomas Zimmermann
Quoted 5 lines
DRM_GEM_CMA_DRIVER_OPSsets the functions in structdrm_driverto their defaults. No functional changes are made.Signed-off-by Thomas Zimmermann <[email protected]>I just found this in my inbox. I assume it has not been applied as you were after a review.
Quoted 6 lines
Quoted 1 line
The patchset as a whole got an A-b and was merged a while ago.
I'm a bit confused, I couldn't see it in any tree. The aspeed one seemed to have been skipped when applying the series.
I looked at today's linux-next and drm-misc-next.
Indeed. The other patches are in drm-misc-next, but not this one. I must have lost it during the merge process.
Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Reviewed-by Joel Stanley <[email protected]>Nevertheless thanks for taking a look at the patch.
Best regards
ThomasQuoted 2 lines
I will apply it to drm-misc-next.
So please ahead and apply it. There's also an ack by Emil, which you may want to add as well.
Sorry about missing the patch and thanks for taking care.
Best regards
Thomas
Quoted 44 lines
Quoted 31 lines
Quoted 15 lines
Cheers,
Joel
Quoted 10 lines
--- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +0
-0@@ -188,12 +188,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);Quoted 15 lines
Quoted 13 lines
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1
-7static struct drm_driver aspeed_gfx_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , - .gem_create_object = drm_cma_gem_create_object_default_funcs, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_mmap = drm_gem_prime_mmap, +DRM_GEM_CMA_DRIVER_OPS , .fops = &fops, .name ="aspeed-gfx-drm" , .desc ="ASPEED GFX DRM" , --Quoted 2 lines
2.26.2
Quoted 8 lines
--
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_______________________________________________
dri-devel mailing list
dri-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 14 lines
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 516 bytes Desc: OpenPGP digital signature URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20201009/dad9b509/attachment.sig>
Joel Stanley
maintainerRe: [PATCH 04/21] drm/aspeed: Set driver CMA functions with DRM_GEM_CMA_DRIVER_OPS
Quoted 39 lines · Thomas Zimmermann
Hi
Am 09.10.20 um 10:06 schrieb Joel Stanley:
Quoted 15 lines · Thomas Zimmermann
Quoted 14 lines
Hi
Am 09.10.20 um 09:54 schrieb Joel Stanley:
Quoted 9 lines · Thomas Zimmermann
Quoted 5 lines
DRM_GEM_CMA_DRIVER_OPSsets the functions in structdrm_driverto their defaults. No functional changes are made.Signed-off-by Thomas Zimmermann <[email protected]>I just found this in my inbox. I assume it has not been applied as you were after a review.
Quoted 6 lines
Quoted 1 line
The patchset as a whole got an A-b and was merged a while ago.
I'm a bit confused, I couldn't see it in any tree. The aspeed one seemed to have been skipped when applying the series.
I looked at today's linux-next and drm-misc-next.
Indeed. The other patches are in drm-misc-next, but not this one. I must have lost it during the merge process.
Quoted 10 lines
Quoted 10 lines
Quoted 3 lines
Reviewed-by Joel Stanley <[email protected]>Nevertheless thanks for taking a look at the patch.
Best regards
ThomasQuoted 1 line
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
I will apply it to drm-misc-next.
So please ahead and apply it. There's also an ack by Emil, which you may want to add as well.
Acked-by Emil Velikov <[email protected]>Sorry about missing the patch and thanks for taking care.
No problem. Thanks for the cleanup.
Cheers,
Joel