drm: Clean up plane helpers
Subsystems (53)
Thomas Zimmermann
maintainercover drm: Clean up plane helpers
The plane helpers are included by dozens of files without any need. Only a hand full of source files need anything from drm_plane_helper.h.
Untangle everything and tidy up the code a bit. The patches were built on x64-64, aarch64 and arm without issues.
Thomas Zimmermann (7):
drm/vmwgfx: Remove trailing whitespace
drm/atomic-helper: Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers drm/atomic-helper: Remove _HELPER_ infix from
DRM_PLANE_HELPER_NO_SCALING
drm: Remove unnecessary include statements of drm_plane_helper.h drm/plane-helper: Export individual helpers
drm/armada: Use drm_plane_helper_destroy()
drm/fsl-dcu: Use drm_plane_helper_destroy()
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 4 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 1 - .../gpu/drm/arm/display/komeda/komeda_plane.c | 1 - drivers/gpu/drm/arm/hdlcd_crtc.c | 5 +- drivers/gpu/drm/arm/malidp_planes.c | 1 - drivers/gpu/drm/armada/armada_crtc.c | 1 - drivers/gpu/drm/armada/armada_overlay.c | 8 +- drivers/gpu/drm/armada/armada_plane.c | 2 +- drivers/gpu/drm/ast/ast_mode.c | 9 +-- .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 1 - drivers/gpu/drm/drm_atomic_helper.c | 1 - drivers/gpu/drm/drm_crtc_helper.c | 1 - drivers/gpu/drm/drm_modeset_helper.c | 8 +- drivers/gpu/drm/drm_plane_helper.c | 74 +++++++++++++------ drivers/gpu/drm/drm_simple_kms_helper.c | 5 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 8 +- drivers/gpu/drm/gma500/psb_intel_display.c | 2 - .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 - drivers/gpu/drm/i915/display/i9xx_plane.c | 5 +- drivers/gpu/drm/i915/display/intel_atomic.c | 1 - .../gpu/drm/i915/display/intel_atomic_plane.c | 1 - drivers/gpu/drm/i915/display/intel_crtc.c | 1 - drivers/gpu/drm/i915/display/intel_cursor.c | 5 +- drivers/gpu/drm/i915/display/intel_display.c | 1 - drivers/gpu/drm/i915/display/intel_sprite.c | 9 +-- .../drm/i915/display/skl_universal_plane.c | 5 +- drivers/gpu/drm/i915/intel_pm.c | 1 - drivers/gpu/drm/imx/imx-drm-core.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 5 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 5 +- drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 - drivers/gpu/drm/kmb/kmb_plane.c | 5 +- drivers/gpu/drm/logicvc/logicvc_layer.c | 5 +- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_plane.c | 9 +-- drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 3 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 1 - drivers/gpu/drm/msm/msm_drv.h | 1 - drivers/gpu/drm/mxsfb/lcdif_kms.c | 5 +- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 5 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 8 +- drivers/gpu/drm/nouveau/dispnv50/base507c.c | 5 +- drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 5 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 1 - drivers/gpu/drm/nouveau/dispnv50/ovly507e.c | 5 +- drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c | 5 +- drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c | 1 - drivers/gpu/drm/omapdrm/omap_crtc.c | 1 - drivers/gpu/drm/omapdrm/omap_overlay.c | 1 - drivers/gpu/drm/omapdrm/omap_plane.c | 1 - drivers/gpu/drm/qxl/qxl_display.c | 4 +- drivers/gpu/drm/radeon/radeon_display.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_plane.c | 5 +- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 - drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 9 +-- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 1 - drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 1 - drivers/gpu/drm/sprd/sprd_dpu.c | 5 +- drivers/gpu/drm/sti/sti_crtc.c | 1 - drivers/gpu/drm/sti/sti_plane.h | 1 - drivers/gpu/drm/stm/ltdc.c | 1 - drivers/gpu/drm/sun4i/sun4i_backend.c | 1 - drivers/gpu/drm/sun4i/sun4i_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_mixer.c | 1 - drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 5 +- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 5 +- drivers/gpu/drm/tegra/dc.c | 1 - drivers/gpu/drm/tegra/plane.c | 1 - drivers/gpu/drm/tests/drm_plane_helper_test.c | 33 ++++----- drivers/gpu/drm/tidss/tidss_crtc.c | 1 - drivers/gpu/drm/tilcdc/tilcdc_plane.c | 1 - drivers/gpu/drm/vboxvideo/vbox_mode.c | 12 +-- drivers/gpu/drm/vc4/vc4_kms.c | 1 - drivers/gpu/drm/vc4/vc4_plane.c | 1 - drivers/gpu/drm/virtio/virtgpu_plane.c | 5 +- drivers/gpu/drm/vkms/vkms_plane.c | 5 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 11 ++- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 3 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 1 - drivers/gpu/drm/xlnx/zynqmp_disp.c | 5 +- include/drm/drm_atomic_helper.h | 9 +++ include/drm/drm_plane_helper.h | 29 ++++---- 88 files changed, 189 insertions(+), 223 deletions(-)
Signature · 1 line
2.36.1
Thomas Zimmermann
maintainerPATCH 1/7 drm/vmwgfx: Remove trailing whitespace
Fix coding style. No functional changes.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -1
@@ -2257,7 +2257,7 @@ static int vmw_du_update_layout(struct vmw_private *dev_priv,drm_modeset_drop_locks (&ctx);drm_modeset_acquire_fini (&ctx);mutex_unlock (&dev->mode_config.mutex); - +return 0 ; }
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +1 -1
@@ -1383,6 +1383,6 @@ int vmw_kms_sou_readback(struct vmw_private *dev_priv,vmw_validation_revert (&val_ctx); out_unref:vmw_validation_unref_lists (&val_ctx); - +return ret; }
Signature · 1 line
2.36.1
Re: [PATCH 1/7] drm/vmwgfx: Remove trailing whitespace
Quoted 3 lines · Thomas Zimmermann
Fix coding style. No functional changes.
Signed-off-by Thomas Zimmermann <[email protected]>
Thanks!
Thomas Zimmermann
maintainerPATCH 2/7 drm/atomic-helper: Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers
In reply to Thomas ZimmermannThe macro DRM_PLANE_HELPER_NO_SCALING is only useful with the interfaces in drm_atomic_helper.h, but defined in drm_plane_helper.h. So half of DRM includes the latter header file for using this macro. Move the macro and remove the include statements.
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 1 - drivers/gpu/drm/ast/ast_mode.c | 1 - drivers/gpu/drm/drm_simple_kms_helper.c | 1 - drivers/gpu/drm/i915/display/i9xx_plane.c | 1 - drivers/gpu/drm/i915/display/intel_cursor.c | 1 - drivers/gpu/drm/i915/display/intel_sprite.c | 1 - drivers/gpu/drm/i915/display/skl_universal_plane.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 - drivers/gpu/drm/kmb/kmb_plane.c | 1 - drivers/gpu/drm/logicvc/logicvc_layer.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 1 - drivers/gpu/drm/mxsfb/lcdif_kms.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 1 - drivers/gpu/drm/nouveau/dispnv50/base507c.c | 1 - drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 1 - drivers/gpu/drm/nouveau/dispnv50/ovly507e.c | 1 - drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_plane.c | 1 - drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 - drivers/gpu/drm/sprd/sprd_dpu.c | 1 - drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 1 - drivers/gpu/drm/tests/drm_plane_helper_test.c | 1 - drivers/gpu/drm/virtio/virtgpu_plane.c | 1 - drivers/gpu/drm/vkms/vkms_plane.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 1 - drivers/gpu/drm/xlnx/zynqmp_disp.c | 1 - include/drm/drm_atomic_helper.h | 9 +++++++++ include/drm/drm_plane_helper.h | 9 --------- 31 files changed, 9 insertions(+), 38 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +0 -1
@@ -23,7 +23,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_of.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/ast/ast_mode.c +0 -1
@@ -42,7 +42,6 @@#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_gem_vram_helper.h> #include <drm/drm_managed.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_simple_kms_helper.h>
drivers/gpu/drm/drm_simple_kms_helper.c +0 -1
@@ -12,7 +12,6 @@#include <drm/drm_drv.h> #include <drm/drm_gem_atomic_helper.h> #include <drm/drm_managed.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_simple_kms_helper.h>
drivers/gpu/drm/i915/display/i9xx_plane.c +0 -1
@@ -7,7 +7,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_blend.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include "intel_atomic.h" #include "intel_atomic_plane.h"
drivers/gpu/drm/i915/display/intel_cursor.c +0 -1
@@ -8,7 +8,6 @@#include <drm/drm_atomic_uapi.h> #include <drm/drm_blend.h> #include <drm/drm_damage_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_fourcc.h> #include "intel_atomic.h"
drivers/gpu/drm/i915/display/intel_sprite.c +0 -1
@@ -39,7 +39,6 @@#include <drm/drm_crtc.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_rect.h> #include "i915_drv.h"
drivers/gpu/drm/i915/display/skl_universal_plane.c +0 -1
@@ -7,7 +7,6 @@#include <drm/drm_blend.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include "i915_drv.h" #include "intel_atomic_plane.h"
drivers/gpu/drm/imx/ipuv3-plane.c +0 -1
@@ -14,7 +14,6 @@#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_managed.h> -#include <drm/drm_plane_helper.h> #include <video/imx-ipu-v3.h>
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0 -1
@@ -41,7 +41,6 @@#include <drm/drm_of.h> #include <drm/drm_panel.h> #include <drm/drm_plane.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/kmb/kmb_plane.c +0 -1
@@ -14,7 +14,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_managed.h> -#include <drm/drm_plane_helper.h> #include "kmb_drv.h" #include "kmb_plane.h"
drivers/gpu/drm/logicvc/logicvc_layer.c +0 -1
@@ -14,7 +14,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_plane.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include "logicvc_crtc.h"
drivers/gpu/drm/mediatek/mtk_drm_plane.c +0 -1
@@ -11,7 +11,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include "mtk_drm_crtc.h" #include "mtk_drm_ddp_comp.h"
drivers/gpu/drm/meson/meson_plane.c +0 -1
@@ -20,7 +20,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include "meson_plane.h" #include "meson_registers.h"
drivers/gpu/drm/mxsfb/lcdif_kms.c +0 -1
@@ -23,7 +23,6 @@#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_plane.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "lcdif_drv.h"
drivers/gpu/drm/mxsfb/mxsfb_kms.c +0 -1
@@ -26,7 +26,6 @@#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_plane.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "mxsfb_drv.h"
drivers/gpu/drm/nouveau/dispnv50/base507c.c +0 -1
@@ -30,7 +30,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include "nouveau_bo.h"
drivers/gpu/drm/nouveau/dispnv50/curs507a.c +0 -1
@@ -29,7 +29,6 @@#include <nvhw/class/cl507a.h> #include <drm/drm_atomic_helper.h> -#include <drm/drm_plane_helper.h> bool curs507a_space (struct nv50_wndw *wndw)
drivers/gpu/drm/nouveau/dispnv50/ovly507e.c +0 -1
@@ -24,7 +24,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include <nvif/cl507e.h> #include <nvif/event.h>
drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c +0 -1
@@ -23,7 +23,6 @@#include "atom.h" #include <drm/drm_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include <nouveau_bo.h> #include <nvif/clc37e.h>
drivers/gpu/drm/rcar-du/rcar_du_plane.c +0 -1
@@ -16,7 +16,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include "rcar_du_drv.h" #include "rcar_du_group.h"
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0 -1
@@ -27,7 +27,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_self_refresh_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/sprd/sprd_dpu.c +0 -1
@@ -23,7 +23,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_plane_helper.h> #include "sprd_drm.h" #include "sprd_dpu.h"
drivers/gpu/drm/sun4i/sun8i_ui_layer.c +0 -1
@@ -18,7 +18,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include "sun8i_mixer.h"
drivers/gpu/drm/sun4i/sun8i_vi_layer.c +0 -1
@@ -11,7 +11,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include "sun8i_csc.h"
drivers/gpu/drm/tests/drm_plane_helper_test.c +0 -1
@@ -9,7 +9,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_framebuffer.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_modes.h> static void set_src(struct drm_plane_state *plane_state,
drivers/gpu/drm/virtio/virtgpu_plane.c +0 -1
@@ -26,7 +26,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include "virtgpu_drv.h"
drivers/gpu/drm/vkms/vkms_plane.c +0 -1
@@ -7,7 +7,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_plane_helper.h> #include "vkms_drv.h"
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +0 -1
@@ -29,7 +29,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_rect.h> #include <drm/drm_sysfs.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/xlnx/zynqmp_disp.c +0 -1
@@ -20,7 +20,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_managed.h> #include <drm/drm_plane.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include <linux/clk.h>
include/drm/drm_atomic_helper.h +9 -0
@@ -34,6 +34,15 @@#include <drm/drm_atomic_state_helper.h> #include <drm/drm_util.h> +/* +* Drivers that don't allow primary plane scaling may pass this macro in place +* of the min/max scale parameters of the plane-state checker function. +* +* Due to src being in 16.16 fixed point and dest being in integer pixels, +* 1<<16 represents no scaling. +*/ +#define DRM_PLANE_HELPER_NO_SCALING (1<<16) +struct drm_atomic_state ;struct drm_private_obj ;struct drm_private_state ;
include/drm/drm_plane_helper.h +0 -9
@@ -29,15 +29,6 @@#include <drm/drm_modeset_helper_vtables.h> #include <drm/drm_modeset_helper.h> -/* -* Drivers that don't allow primary plane scaling may pass this macro in place -* of the min/max scale parameters of the update checker function. -* -* Due to src being in 16.16 fixed point and dest being in integer pixels, -* 1<<16 represents no scaling. -*/ -#define DRM_PLANE_HELPER_NO_SCALING (1<<16) -void drm_primary_helper_destroy (struct drm_plane *plane);extern const struct drm_plane_funcs drm_primary_helper_funcs;
Signature · 1 line
2.36.1
Thomas Zimmermann
maintainerPATCH 3/7 drm/atomic-helper: Remove _HELPER_ infix from DRM_PLANE_HELPER_NO_SCALING
In reply to Thomas ZimmermannRename DRM_PLANE_HELPER_NO_SCALING to DRM_PLANE_NO_SCALING. The constant is not really a helper, but rather a characteristic of the plane itself.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 4 +-- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +-- drivers/gpu/drm/ast/ast_mode.c | 8 ++--- drivers/gpu/drm/drm_plane_helper.c | 4 +-- drivers/gpu/drm/drm_simple_kms_helper.c | 4 +-- drivers/gpu/drm/i915/display/i9xx_plane.c | 4 +-- drivers/gpu/drm/i915/display/intel_cursor.c | 4 +-- drivers/gpu/drm/i915/display/intel_sprite.c | 8 ++--- .../drm/i915/display/skl_universal_plane.c | 4 +-- drivers/gpu/drm/imx/ipuv3-plane.c | 4 +-- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +-- drivers/gpu/drm/kmb/kmb_plane.c | 4 +-- drivers/gpu/drm/logicvc/logicvc_layer.c | 4 +-- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 ++--- drivers/gpu/drm/meson/meson_plane.c | 2 +- drivers/gpu/drm/mxsfb/lcdif_kms.c | 4 +-- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 4 +-- drivers/gpu/drm/nouveau/dispnv50/base507c.c | 4 +-- drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 4 +-- drivers/gpu/drm/nouveau/dispnv50/ovly507e.c | 4 +-- drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c | 4 +-- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 ++--- drivers/gpu/drm/sprd/sprd_dpu.c | 4 +-- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 4 +-- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 +-- drivers/gpu/drm/tests/drm_plane_helper_test.c | 32 +++++++++---------- drivers/gpu/drm/vboxvideo/vbox_mode.c | 8 ++--- drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +-- drivers/gpu/drm/vkms/vkms_plane.c | 4 +-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 ++--- drivers/gpu/drm/xlnx/zynqmp_disp.c | 4 +-- include/drm/drm_atomic_helper.h | 2 +- 33 files changed, 90 insertions(+), 90 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2 -2
@@ -282,8 +282,8 @@ static int amdgpu_vkms_plane_atomic_check(struct drm_plane *plane,return PTR_ERR (crtc_state); ret =drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true);if (ret !=0 )return ret;
drivers/gpu/drm/arm/hdlcd_crtc.c +2 -2
@@ -251,8 +251,8 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;return drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true); }
drivers/gpu/drm/ast/ast_mode.c +4 -4
@@ -554,8 +554,8 @@ static int ast_primary_plane_helper_atomic_check(struct drm_plane *plane, new_plane_state->crtc); ret =drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true);if (ret)return ret;
@@ -778,8 +778,8 @@ static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane, new_plane_state->crtc); ret =drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true);if (ret)return ret;
drivers/gpu/drm/drm_plane_helper.c +2 -2
@@ -179,8 +179,8 @@ static int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *c ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest,DRM_MODE_ROTATE_0 , -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false, &visible);if (ret)return ret;
drivers/gpu/drm/drm_simple_kms_helper.c +2 -2
@@ -222,8 +222,8 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, &pipe->crtc); ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false);if (ret)return ret;
drivers/gpu/drm/i915/display/i9xx_plane.c +2 -2
@@ -325,8 +325,8 @@ i9xx_plane_check(struct intel_crtc_state *crtc_state,return ret; ret =intel_atomic_plane_check_clipping (plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING ,i9xx_plane_has_windowing (plane));if (ret)return ret;
drivers/gpu/drm/i915/display/intel_cursor.c +2 -2
@@ -143,8 +143,8 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, } ret =intel_atomic_plane_check_clipping (plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true);if (ret)return ret;
drivers/gpu/drm/i915/display/intel_sprite.c +4 -4
@@ -1354,8 +1354,8 @@ g4x_sprite_check(struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -int min_scale =DRM_PLANE_HELPER_NO_SCALING ; -int max_scale =DRM_PLANE_HELPER_NO_SCALING ; +int min_scale =DRM_PLANE_NO_SCALING ; +int max_scale =DRM_PLANE_NO_SCALING ;int ret;if (g4x_fb_scalable (plane_state->hw.fb)) {
@@ -1425,8 +1425,8 @@ vlv_sprite_check(struct intel_crtc_state *crtc_state,return ret; ret =intel_atomic_plane_check_clipping (plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true);if (ret)return ret;
drivers/gpu/drm/i915/display/skl_universal_plane.c +2 -2
@@ -1855,8 +1855,8 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev);const struct drm_framebuffer *fb = plane_state->hw.fb; -int min_scale =DRM_PLANE_HELPER_NO_SCALING ; -int max_scale =DRM_PLANE_HELPER_NO_SCALING ; +int min_scale =DRM_PLANE_NO_SCALING ; +int max_scale =DRM_PLANE_NO_SCALING ;int ret; ret =skl_plane_check_fb (crtc_state, plane_state);
drivers/gpu/drm/imx/ipuv3-plane.c +2 -2
@@ -392,8 +392,8 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; ret =drm_atomic_helper_check_plane_state (new_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , can_position, true);if (ret)return ret;
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +2 -2
@@ -481,8 +481,8 @@ static int ingenic_drm_plane_atomic_check(struct drm_plane *plane,return PTR_ERR (priv_state); ret =drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , priv->soc_info->has_osd, true);if (ret)
drivers/gpu/drm/kmb/kmb_plane.c +2 -2
@@ -135,8 +135,8 @@ static int kmb_plane_atomic_check(struct drm_plane *plane, new_plane_state->crtc);return drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , can_position, true); }
drivers/gpu/drm/logicvc/logicvc_layer.c +2 -2
@@ -116,8 +116,8 @@ static int logicvc_plane_atomic_check(struct drm_plane *drm_plane, } } - min_scale =DRM_PLANE_HELPER_NO_SCALING ; - max_scale =DRM_PLANE_HELPER_NO_SCALING ; + min_scale =DRM_PLANE_NO_SCALING ; + max_scale =DRM_PLANE_NO_SCALING ; can_position = (drm_plane->type == DRM_PLANE_TYPE_OVERLAY && layer->index != (logicvc->config.layers_count - 1) &&
drivers/gpu/drm/mediatek/mtk_drm_plane.c +4 -4
@@ -107,8 +107,8 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane, crtc_state = new_plane_state->crtc->state;return drm_atomic_helper_check_plane_state (plane->state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true); }
@@ -201,8 +201,8 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,return drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true); }
drivers/gpu/drm/meson/meson_plane.c +1 -1
@@ -94,7 +94,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane,return drm_atomic_helper_check_plane_state (new_plane_state, crtc_state,FRAC_16_16 (1 ,5 ), -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true); }
drivers/gpu/drm/mxsfb/lcdif_kms.c +2 -2
@@ -392,8 +392,8 @@ static int lcdif_plane_atomic_check(struct drm_plane *plane, &lcdif->crtc);return drm_atomic_helper_check_plane_state (plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true); }
drivers/gpu/drm/mxsfb/mxsfb_kms.c +2 -2
@@ -530,8 +530,8 @@ static int mxsfb_plane_atomic_check(struct drm_plane *plane, &mxsfb->crtc);return drm_atomic_helper_check_plane_state (plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true); }
drivers/gpu/drm/nouveau/dispnv50/base507c.c +2 -2
@@ -237,8 +237,8 @@ base507c_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,int ret; ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true);if (ret)return ret;
drivers/gpu/drm/nouveau/dispnv50/curs507a.c +2 -2
@@ -102,8 +102,8 @@ curs507a_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,int ret; ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true); asyh->curs.visible = asyw->state.visible;if (ret || !asyh->curs.visible)
drivers/gpu/drm/nouveau/dispnv50/ovly507e.c +2 -2
@@ -106,8 +106,8 @@ ovly507e_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,int ret; ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true);if (ret)return ret;
drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c +2 -2
@@ -296,8 +296,8 @@ wndwc37e_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) {return drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true); }
drivers/gpu/drm/rcar-du/rcar_du_plane.c +2 -2
@@ -594,8 +594,8 @@ int __rcar_du_plane_atomic_check(struct drm_plane *plane,return PTR_ERR (crtc_state); ret =drm_atomic_helper_check_plane_state (state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true);if (ret <0 )return ret;
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +4 -4
@@ -808,9 +808,9 @@ static int vop_plane_atomic_check(struct drm_plane *plane,const struct vop_win_data *win = vop_win->data;int ret;int min_scale = win->phy->scl ?FRAC_16_16 (1 ,8 ) : -DRM_PLANE_HELPER_NO_SCALING ; +DRM_PLANE_NO_SCALING ;int max_scale = win->phy->scl ?FRAC_16_16 (8 ,1 ) : -DRM_PLANE_HELPER_NO_SCALING ; +DRM_PLANE_NO_SCALING ;if (!crtc ||WARN_ON (!fb))return 0 ;
@@ -1059,9 +1059,9 @@ static int vop_plane_atomic_async_check(struct drm_plane *plane,struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data;int min_scale = win->phy->scl ?FRAC_16_16 (1 ,8 ) : -DRM_PLANE_HELPER_NO_SCALING ; +DRM_PLANE_NO_SCALING ;int max_scale = win->phy->scl ?FRAC_16_16 (8 ,1 ) : -DRM_PLANE_HELPER_NO_SCALING ; +DRM_PLANE_NO_SCALING ;struct drm_crtc_state *crtc_state;if (plane != new_plane_state->crtc->cursor)
drivers/gpu/drm/sprd/sprd_dpu.c +2 -2
@@ -523,8 +523,8 @@ static int sprd_plane_atomic_check(struct drm_plane *plane,return PTR_ERR (crtc_state);return drm_atomic_helper_check_plane_state (plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true); }
drivers/gpu/drm/sun4i/sun8i_ui_layer.c +2 -2
@@ -245,8 +245,8 @@ static int sun8i_ui_layer_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; - min_scale =DRM_PLANE_HELPER_NO_SCALING ; - max_scale =DRM_PLANE_HELPER_NO_SCALING ; + min_scale =DRM_PLANE_NO_SCALING ; + max_scale =DRM_PLANE_NO_SCALING ;if (layer->mixer->cfg->scaler_mask &BIT (layer->channel)) { min_scale =SUN8I_UI_SCALER_SCALE_MIN ;
drivers/gpu/drm/sun4i/sun8i_vi_layer.c +2 -2
@@ -379,8 +379,8 @@ static int sun8i_vi_layer_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; - min_scale =DRM_PLANE_HELPER_NO_SCALING ; - max_scale =DRM_PLANE_HELPER_NO_SCALING ; + min_scale =DRM_PLANE_NO_SCALING ; + max_scale =DRM_PLANE_NO_SCALING ;if (layer->mixer->cfg->scaler_mask &BIT (layer->channel)) { min_scale =SUN8I_VI_SCALER_SCALE_MIN ;
drivers/gpu/drm/tests/drm_plane_helper_test.c +16 -16
@@ -104,8 +104,8 @@ static void igt_check_plane_state(struct kunit *test)set_src (&plane_state,0 ,0 , fb.width <<16 , fb.height <<16 );set_crtc (&plane_state,0 ,0 , fb.width, fb.height); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Simple clipping check should pass\n" );KUNIT_EXPECT_TRUE (test, plane_state.visible);
@@ -115,8 +115,8 @@ static void igt_check_plane_state(struct kunit *test)/* Rotated clipping + reflection, no scaling. */ plane_state.rotation =DRM_MODE_ROTATE_90 |DRM_MODE_REFLECT_X ; ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Rotated clipping check should pass\n" );KUNIT_EXPECT_TRUE (test, plane_state.visible);
@@ -128,15 +128,15 @@ static void igt_check_plane_state(struct kunit *test)set_src (&plane_state,0 ,0 ,1023 <<16 ,767 <<16 );set_crtc (&plane_state,0 ,0 ,1023 ,767 ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false);KUNIT_EXPECT_TRUE_MSG (test, ret,"Should not be able to position on the crtc with can_position=false\n" ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Simple positioning should work\n" );KUNIT_EXPECT_TRUE (test, plane_state.visible);
@@ -148,12 +148,12 @@ static void igt_check_plane_state(struct kunit *test)set_crtc (&plane_state,0 ,0 ,1024 ,768 ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state,0x8001 , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false);KUNIT_EXPECT_TRUE_MSG (test, ret,"Upscaling out of range should fail.\n" ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state,0x8000 , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Upscaling exactly 2x should work\n" );KUNIT_EXPECT_TRUE (test, plane_state.visible);
@@ -162,11 +162,11 @@ static void igt_check_plane_state(struct kunit *test)set_src (&plane_state,0 ,0 ,2048 <<16 ,1536 <<16 ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING ,0x1ffff , false, false);KUNIT_EXPECT_TRUE_MSG (test, ret,"Downscaling out of range should fail.\n" ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING ,0x20000 , false, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Should succeed with exact scaling limit\n" );KUNIT_EXPECT_TRUE (test, plane_state.visible);
@@ -177,7 +177,7 @@ static void igt_check_plane_state(struct kunit *test)set_src (&plane_state,0 ,0 ,0x40001 ,0x40001 );set_crtc (&plane_state,1022 ,766 ,4 ,4 ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING ,0x10001 , true, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Should succeed by clipping to exact multiple" );
@@ -188,7 +188,7 @@ static void igt_check_plane_state(struct kunit *test)set_src (&plane_state,0x20001 ,0x20001 ,0x4040001 ,0x3040001 );set_crtc (&plane_state,-2 ,-2 ,1028 ,772 ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING ,0x10001 , false, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Should succeed by clipping to exact multiple" );
@@ -201,7 +201,7 @@ static void igt_check_plane_state(struct kunit *test)set_crtc (&plane_state,1022 ,766 ,4 ,4 ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state,0xffff , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , true, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Should succeed by clipping to exact multiple" );KUNIT_EXPECT_TRUE (test, plane_state.visible);
@@ -213,7 +213,7 @@ static void igt_check_plane_state(struct kunit *test)set_crtc (&plane_state,-2 ,-2 ,1028 ,772 ); ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state,0xffff , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false);KUNIT_EXPECT_FALSE_MSG (test, ret,0 ,"Should succeed by clipping to exact multiple" );KUNIT_EXPECT_TRUE (test, plane_state.visible);
drivers/gpu/drm/vboxvideo/vbox_mode.c +4 -4
@@ -269,8 +269,8 @@ static int vbox_primary_atomic_check(struct drm_plane *plane, }return drm_atomic_helper_check_plane_state (new_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true); }
@@ -351,8 +351,8 @@ static int vbox_cursor_atomic_check(struct drm_plane *plane, } ret =drm_atomic_helper_check_plane_state (new_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true);if (ret)return ret;
drivers/gpu/drm/virtio/virtgpu_plane.c +2 -2
@@ -99,8 +99,8 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,return PTR_ERR (crtc_state); ret =drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , is_cursor, true);return ret; }
drivers/gpu/drm/vkms/vkms_plane.c +2 -2
@@ -138,8 +138,8 @@ static int vkms_plane_atomic_check(struct drm_plane *plane, can_position = true; ret =drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , can_position, true);if (ret !=0 )return ret;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4 -4
@@ -719,8 +719,8 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, new_state->crtc); ret =drm_atomic_helper_check_plane_state (new_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, true);if (!ret && new_fb) {
@@ -761,8 +761,8 @@ int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane, new_state->crtc); ret =drm_atomic_helper_check_plane_state (new_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , true, true);if (ret)return ret;
drivers/gpu/drm/xlnx/zynqmp_disp.c +2 -2
@@ -1150,8 +1150,8 @@ zynqmp_disp_plane_atomic_check(struct drm_plane *plane,return drm_atomic_helper_check_plane_state (new_plane_state, crtc_state, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_NO_SCALING , +DRM_PLANE_NO_SCALING , false, false); }
include/drm/drm_atomic_helper.h +1 -1
@@ -41,7 +41,7 @@* Due to src being in 16.16 fixed point and dest being in integer pixels, * 1<<16 represents no scaling. */ -#define DRM_PLANE_HELPER_NO_SCALING (1<<16) +#define DRM_PLANE_NO_SCALING (1<<16)struct drm_atomic_state ;struct drm_private_obj ;
Signature · 1 line
2.36.1
Thomas Zimmermann
maintainerPATCH 4/7 drm: Remove unnecessary include statements of drm_plane_helper.h
In reply to Thomas ZimmermannRemove the include statement for drm_plane_helper.h from all the files that don't need it. Althogh the header file is almost empty, many drivers include it somewhere.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 - drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 1 - drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 1 - drivers/gpu/drm/arm/malidp_planes.c | 1 - drivers/gpu/drm/armada/armada_crtc.c | 1 - drivers/gpu/drm/armada/armada_overlay.c | 1 - drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 1 - drivers/gpu/drm/drm_atomic_helper.c | 1 - drivers/gpu/drm/drm_crtc_helper.c | 1 - drivers/gpu/drm/exynos/exynos_drm_plane.c | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 1 - drivers/gpu/drm/gma500/psb_intel_display.c | 2 -- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 - drivers/gpu/drm/i915/display/intel_atomic.c | 1 - drivers/gpu/drm/i915/display/intel_atomic_plane.c | 1 - drivers/gpu/drm/i915/display/intel_crtc.c | 1 - drivers/gpu/drm/i915/display/intel_display.c | 1 - drivers/gpu/drm/i915/intel_pm.c | 1 - drivers/gpu/drm/imx/imx-drm-core.c | 1 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 1 - drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/mgag200/mgag200_mode.c | 1 - drivers/gpu/drm/msm/msm_drv.h | 1 - drivers/gpu/drm/nouveau/dispnv50/disp.c | 1 - drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c | 1 - drivers/gpu/drm/omapdrm/omap_crtc.c | 1 - drivers/gpu/drm/omapdrm/omap_overlay.c | 1 - drivers/gpu/drm/omapdrm/omap_plane.c | 1 - drivers/gpu/drm/radeon/radeon_display.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 - drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 1 - drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 1 - drivers/gpu/drm/sti/sti_crtc.c | 1 - drivers/gpu/drm/sti/sti_plane.h | 1 - drivers/gpu/drm/stm/ltdc.c | 1 - drivers/gpu/drm/sun4i/sun4i_backend.c | 1 - drivers/gpu/drm/sun4i/sun4i_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_mixer.c | 1 - drivers/gpu/drm/tegra/dc.c | 1 - drivers/gpu/drm/tegra/plane.c | 1 - drivers/gpu/drm/tidss/tidss_crtc.c | 1 - drivers/gpu/drm/tilcdc/tilcdc_plane.c | 1 - drivers/gpu/drm/vc4/vc4_kms.c | 1 - drivers/gpu/drm/vc4/vc4_plane.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 1 - 49 files changed, 50 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +0 -1
@@ -38,7 +38,6 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h> #include <drm/drm_framebuffer.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <linux/i2c.h> #include <linux/i2c-algo-bit.h>
drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +0 -1
@@ -11,7 +11,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/arm/display/komeda/komeda_plane.c +0 -1
@@ -7,7 +7,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_blend.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include "komeda_dev.h" #include "komeda_kms.h"
drivers/gpu/drm/arm/malidp_planes.c +0 -1
@@ -18,7 +18,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include "malidp_hw.h"
drivers/gpu/drm/armada/armada_crtc.c +0 -1
@@ -12,7 +12,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/armada/armada_overlay.c +0 -1
@@ -9,7 +9,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_uapi.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include "armada_crtc.h" #include "armada_drm.h"
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +0 -1
@@ -16,7 +16,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include "atmel_hlcdc_dc.h"
drivers/gpu/drm/drm_atomic_helper.c +0 -1
@@ -38,7 +38,6 @@#include <drm/drm_drv.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include <drm/drm_self_refresh_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/drm_crtc_helper.c +0 -1
@@ -45,7 +45,6 @@#include <drm/drm_fb_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/exynos/exynos_drm_plane.c +0 -1
@@ -9,7 +9,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_blend.h> #include <drm/drm_framebuffer.h> -#include <drm/drm_plane_helper.h> #include <drm/exynos_drm.h> #include "exynos_drm_crtc.h"
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +0 -1
@@ -14,7 +14,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include "fsl_dcu_drm_drv.h"
drivers/gpu/drm/gma500/psb_intel_display.c +0 -2
@@ -9,8 +9,6 @@#include <linux/delay.h> #include <linux/i2c.h> -#include <drm/drm_plane_helper.h> -#include "framebuffer.h" #include "gem.h" #include "gma_display.h"
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0 -1
@@ -28,7 +28,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h> #include <drm/drm_gem_framebuffer_helper.h>
drivers/gpu/drm/i915/display/intel_atomic.c +0 -1
@@ -32,7 +32,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include "i915_drv.h" #include "i915_reg.h"
drivers/gpu/drm/i915/display/intel_atomic_plane.c +0 -1
@@ -33,7 +33,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include "gt/intel_rps.h"
drivers/gpu/drm/i915/display/intel_crtc.c +0 -1
@@ -9,7 +9,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_plane.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank_work.h> #include "i915_irq.h"
drivers/gpu/drm/i915/display/intel_display.c +0 -1
@@ -42,7 +42,6 @@#include <drm/drm_damage_helper.h> #include <drm/drm_edid.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_privacy_screen_consumer.h> #include <drm/drm_probe_helper.h> #include <drm/drm_rect.h>
drivers/gpu/drm/i915/intel_pm.c +0 -1
@@ -32,7 +32,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_blend.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include "display/intel_atomic.h" #include "display/intel_atomic_plane.h"
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
@@ -22,7 +22,6 @@#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_managed.h> #include <drm/drm_of.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/ingenic/ingenic-ipu.c +0 -1
@@ -29,7 +29,6 @@#include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_plane.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_property.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/mediatek/mtk_drm_crtc.c +0 -1
@@ -15,7 +15,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/meson/meson_overlay.c +0 -1
@@ -16,7 +16,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include "meson_overlay.h" #include "meson_registers.h"
drivers/gpu/drm/mgag200/mgag200_mode.c +0 -1
@@ -20,7 +20,6 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include <drm/drm_probe_helper.h> #include <drm/drm_simple_kms_helper.h>
drivers/gpu/drm/msm/msm_drv.h +0 -1
@@ -27,7 +27,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_fb_helper.h> #include <drm/display/drm_dsc.h>
drivers/gpu/drm/nouveau/dispnv50/disp.c +0 -1
@@ -39,7 +39,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_edid.h> #include <drm/drm_fb_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c +0 -1
@@ -23,7 +23,6 @@#include "atom.h" #include <drm/drm_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include <nouveau_bo.h> #include <nvif/clc37e.h>
drivers/gpu/drm/omapdrm/omap_crtc.c +0 -1
@@ -10,7 +10,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_mode.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "omap_drv.h"
drivers/gpu/drm/omapdrm/omap_overlay.c +0 -1
@@ -6,7 +6,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include "omap_dmm_tiler.h" #include "omap_drv.h"
drivers/gpu/drm/omapdrm/omap_plane.c +0 -1
@@ -8,7 +8,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_blend.h> #include <drm/drm_gem_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h>
drivers/gpu/drm/radeon/radeon_display.c +0 -1
@@ -38,7 +38,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h> #include <drm/radeon_drm.h>
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +0 -1
@@ -19,7 +19,6 @@#include <drm/drm_device.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "rcar_cmm.h"
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0 -1
@@ -17,7 +17,6 @@#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_managed.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include <linux/bitops.h>
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +0 -1
@@ -29,7 +29,6 @@#include <drm/drm_debugfs.h> #include <drm/drm_flip_work.h> #include <drm/drm_framebuffer.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/shmobile/shmob_drm_crtc.c +0 -1
@@ -16,7 +16,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_simple_kms_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/sti/sti_crtc.c +0 -1
@@ -11,7 +11,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_device.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/sti/sti_plane.h +0 -1
@@ -8,7 +8,6 @@#define _STI_PLANE_H_#include <drm/drm_atomic_helper.h> -#include <drm/drm_plane_helper.h> #define to_sti_plane (x) container_of(x, struct sti_plane, drm_plane)
drivers/gpu/drm/stm/ltdc.c +0 -1
@@ -34,7 +34,6 @@#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_of.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_simple_kms_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/sun4i/sun4i_backend.c +0 -1
@@ -23,7 +23,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include "sun4i_backend.h"
drivers/gpu/drm/sun4i/sun4i_layer.c +0 -1
@@ -10,7 +10,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_blend.h> #include <drm/drm_gem_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include "sun4i_backend.h" #include "sun4i_frontend.h"
drivers/gpu/drm/sun4i/sun8i_mixer.c +0 -1
@@ -19,7 +19,6 @@#include <drm/drm_fb_cma_helper.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include "sun4i_drv.h"
drivers/gpu/drm/tegra/dc.c +0 -1
@@ -26,7 +26,6 @@#include <drm/drm_debugfs.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "dc.h"
drivers/gpu/drm/tegra/plane.c +0 -1
@@ -12,7 +12,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include "dc.h" #include "plane.h"
drivers/gpu/drm/tidss/tidss_crtc.c +0 -1
@@ -10,7 +10,6 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "tidss_crtc.h"
drivers/gpu/drm/tilcdc/tilcdc_plane.c +0 -1
@@ -5,7 +5,6 @@*/ #include <drm/drm_atomic.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h>
drivers/gpu/drm/vc4/vc4_kms.c +0 -1
@@ -18,7 +18,6 @@#include <drm/drm_crtc.h> #include <drm/drm_fourcc.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h>
drivers/gpu/drm/vc4/vc4_plane.c +0 -1
@@ -23,7 +23,6 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_atomic_helper.h> -#include <drm/drm_plane_helper.h> #include "uapi/drm/vc4_drm.h"
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +0 -1
@@ -28,7 +28,6 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "vmwgfx_kms.h"
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +0 -1
@@ -29,7 +29,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "vmwgfx_kms.h"
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +0 -1
@@ -29,7 +29,6 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_plane_helper.h> #include <drm/drm_vblank.h> #include "vmwgfx_kms.h"
Signature · 1 line
2.36.1
Thomas Zimmermann
maintainerPATCH 5/7 drm/plane-helper: Export individual helpers
In reply to Thomas ZimmermannExport the individual plane helpers that make up the plane functions and align the naming with other helpers. The plane helpers are for non-atomic modesetting and exporting them will simplify a later conversion of drivers to atomic modesetting.
With struct drm_plane_funcs removed from drm_plane_helper.h, also remove the include statements. It only needs linux/types.h for uint32_t and a number of forward declarations.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +- drivers/gpu/drm/armada/armada_plane.c | 2 +- drivers/gpu/drm/drm_modeset_helper.c | 8 ++- drivers/gpu/drm/drm_plane_helper.c | 70 ++++++++++++++----- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 8 ++- drivers/gpu/drm/qxl/qxl_display.c | 4 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 +- include/drm/drm_plane_helper.h | 22 ++++-- 8 files changed, 88 insertions(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -86,6 +86,7 @@#include <drm/drm_vblank.h> #include <drm/drm_audio_component.h> #include <drm/drm_gem_atomic_helper.h> +#include <drm/drm_plane_helper.h> #include "ivsrcid/dcn/irqsrcs_dcn_1_0.h"
@@ -7824,7 +7825,7 @@ static void dm_drm_plane_destroy_state(struct drm_plane *plane,static const struct drm_plane_funcs dm_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = dm_drm_plane_reset, .atomic_duplicate_state = dm_drm_plane_duplicate_state, .atomic_destroy_state = dm_drm_plane_destroy_state,
drivers/gpu/drm/armada/armada_plane.c +1 -1
@@ -288,7 +288,7 @@ struct drm_plane_state *armada_plane_duplicate_state(struct drm_plane *plane)static const struct drm_plane_funcs armada_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = armada_plane_reset, .atomic_duplicate_state = armada_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
drivers/gpu/drm/drm_modeset_helper.c +7 -1
@@ -108,6 +108,12 @@ static const uint32_t safe_modeset_formats[] = { DRM_FORMAT_ARGB8888, }; +static const struct drm_plane_funcs primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {struct drm_plane *primary;
@@ -127,7 +133,7 @@ static struct drm_plane *create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret = drm_universal_plane_init(dev, primary, 0, - &drm_primary_helper_funcs, + &primary_plane_funcs, safe_modeset_formats, ARRAY_SIZE(safe_modeset_formats), NULL,
drivers/gpu/drm/drm_plane_helper.c +51 -19
95 lines not on this page · raw message
drivers/gpu/drm/nouveau/dispnv04/crtc.c +7 -1
@@ -1275,6 +1275,12 @@ static const uint32_t modeset_formats[] = { DRM_FORMAT_XRGB1555, }; +static const struct drm_plane_funcs nv04_primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {
@@ -1289,7 +1295,7 @@ create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret =drm_universal_plane_init (dev, primary,0 , - &drm_primary_helper_funcs, + &nv04_primary_plane_funcs, modeset_formats,ARRAY_SIZE (modeset_formats),NULL ,DRM_PLANE_TYPE_PRIMARY ,NULL );
drivers/gpu/drm/qxl/qxl_display.c +2 -2
@@ -902,7 +902,7 @@ static const struct drm_plane_helper_funcs qxl_cursor_helper_funcs = {static const struct drm_plane_funcs qxl_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
@@ -924,7 +924,7 @@ static const struct drm_plane_helper_funcs primary_helper_funcs = {static const struct drm_plane_funcs qxl_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
drivers/gpu/drm/vboxvideo/vbox_mode.c +2 -2
@@ -477,7 +477,7 @@ static const struct drm_plane_helper_funcs vbox_cursor_helper_funcs = {static const struct drm_plane_funcs vbox_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy,DRM_GEM_SHADOW_PLANE_FUNCS , };
@@ -496,7 +496,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = {static const struct drm_plane_funcs vbox_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
include/drm/drm_plane_helper.h +16 -6
@@ -24,12 +24,22 @@#ifndef DRM_PLANE_HELPER_H #define DRM_PLANE_HELPER_H -#include <drm/drm_rect.h> -#include <drm/drm_crtc.h> -#include <drm/drm_modeset_helper_vtables.h> -#include <drm/drm_modeset_helper.h> +#include <linux/types.h> -void drm_primary_helper_destroy (struct drm_plane *plane); -extern const struct drm_plane_funcs drm_primary_helper_funcs; +struct drm_crtc ; +struct drm_framebuffer ; +struct drm_modeset_acquire_ctx ; +struct drm_plane ; + +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx); +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx); +void drm_plane_helper_destroy (struct drm_plane *plane);#endif
Signature · 1 line
2.36.1
Re: [PATCH 5/7] drm/plane-helper: Export individual helpers
Quoted 10 lines · Thomas Zimmermann
Export the individual plane helpers that make up the plane functions and align the naming with other helpers. The plane helpers are for non-atomic modesetting and exporting them will simplify a later conversion of drivers to atomic modesetting.
With struct
drm_plane_funcsremoved fromdrm_plane_helper.h, also remove the include statements. It only needslinux/types.hforuint32_tand a number of forward declarations.Signed-off-by Thomas Zimmermann <[email protected]>
So my commit message was maybe not super motivated, but I intentionally hid these because atomic drivers where using them, which is all bad no good. Now they're more exposed again, which sucks a bit. Exporting the complete function table for legacy helpers (and the one open-coded one in nouveau, not sure we could not move that back to drm_crtc_init) feels much safer against abuse to me.
I'm not entirely clear why we're doing this, because the include untangle could also have been achieved with a struct forward decl, which is what we're usually doing. Can we walk this back please, or am I missing something here?
Cheers, Daniel
Quoted 278 lines
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +- drivers/gpu/drm/armada/armada_plane.c | 2 +- drivers/gpu/drm/drm_modeset_helper.c | 8 ++- drivers/gpu/drm/drm_plane_helper.c | 70 ++++++++++++++----- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 8 ++- drivers/gpu/drm/qxl/qxl_display.c | 4 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 +- include/drm/drm_plane_helper.h | 22 ++++-- 8 files changed, 88 insertions(+), 33 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1@@ -86,6 +86,7 @@#include <drm/drm_vblank.h> #include <drm/drm_audio_component.h> #include <drm/drm_gem_atomic_helper.h> +#include <drm/drm_plane_helper.h> #include "ivsrcid/dcn/irqsrcs_dcn_1_0.h" @@ -7824,7 +7825,7 @@ static void dm_drm_plane_destroy_state(struct drm_plane *plane,static const struct drm_plane_funcs dm_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = dm_drm_plane_reset, .atomic_duplicate_state = dm_drm_plane_duplicate_state, .atomic_destroy_state = dm_drm_plane_destroy_state,drivers/gpu/drm/armada/armada_plane.c +1
-1@@ -288,7 +288,7 @@ struct drm_plane_state *armada_plane_duplicate_state(struct drm_plane *plane)static const struct drm_plane_funcs armada_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = armada_plane_reset, .atomic_duplicate_state = armada_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,drivers/gpu/drm/drm_modeset_helper.c +7
-1@@ -108,6 +108,12 @@ static const uint32_t safe_modeset_formats[] = { DRM_FORMAT_ARGB8888, }; +static const struct drm_plane_funcs primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {struct drm_plane *primary;@@ -127,7 +133,7 @@ static struct drm_plane *create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret = drm_universal_plane_init(dev, primary, 0, - &drm_primary_helper_funcs, + &primary_plane_funcs, safe_modeset_formats, ARRAY_SIZE(safe_modeset_formats), NULL,drivers/gpu/drm/drm_plane_helper.c +51
-19@@ -145,13 +145,36 @@ static int drm_plane_helper_check_update(struct drm_plane *plane,return 0 ; } -static int drm_primary_helper_update (struct drm_plane *plane,struct drm_crtc *crtc, -struct drm_framebuffer *fb, -int crtc_x,int crtc_y, -unsigned int crtc_w,unsigned int crtc_h, -uint32_t src_x,uint32_t src_y, -uint32_t src_w,uint32_t src_h, -struct drm_modeset_acquire_ctx *ctx) +/** +* drm_plane_helper_update_primary - Helper for updating primary planes +* @plane: plane to update +* @crtc: the plane's new CRTC +* @fb: the plane's new framebuffer +* @crtc_x: x coordinate within CRTC +* @crtc_y: y coordinate within CRTC +* @crtc_w: width coordinate within CRTC +* @crtc_h: height coordinate within CRTC +* @src_x: x coordinate within source +* @src_y: y coordinate within source +* @src_w: width coordinate within source +* @src_h: height coordinate within source +* @ctx: modeset locking context +* +* This helper validates the given parameters and updates the primary plane. +* +* This function is only useful for non-atomic modesetting. Don't use +* it in new drivers. +* +* Returns: +* Zero on success, or an errno code otherwise. +*/ +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx) {struct drm_mode_set set = { .crtc = crtc,@@ -218,31 +241,40 @@ static int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *ckfree (connector_list);return ret; } +EXPORT_SYMBOL (drm_plane_helper_update_primary); -static int drm_primary_helper_disable (struct drm_plane *plane, -struct drm_modeset_acquire_ctx *ctx) +/** +* drm_plane_helper_disable_primary - Helper for disabling primary planes +* @plane: plane to disable +* @ctx: modeset locking context +* +* This helper returns an error when trying to disable the primary +* plane. +* +* This function is only useful for non-atomic modesetting. Don't use +* it in new drivers. +* +* Returns: +* An errno code. +*/ +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx) {return -EINVAL ; } +EXPORT_SYMBOL (drm_plane_helper_disable_primary);/** -* drm_primary_helper_destroy() - Helper for primary plane destruction +* drm_plane_helper_destroy() - Helper for primary plane destruction * @plane: plane to destroy * * Provides a default plane destroy handler for primary planes. This handler * is called during CRTC destruction. We disable the primary plane, remove * it from the DRM plane list, and deallocate the plane structure. */ -void drm_primary_helper_destroy (struct drm_plane *plane) +void drm_plane_helper_destroy (struct drm_plane *plane) {drm_plane_cleanup (plane);kfree (plane); } -EXPORT_SYMBOL (drm_primary_helper_destroy); - -const struct drm_plane_funcs drm_primary_helper_funcs = { - .update_plane = drm_primary_helper_update, - .disable_plane = drm_primary_helper_disable, - .destroy = drm_primary_helper_destroy, -}; -EXPORT_SYMBOL (drm_primary_helper_funcs); +EXPORT_SYMBOL (drm_plane_helper_destroy);drivers/gpu/drm/nouveau/dispnv04/crtc.c +7
-1@@ -1275,6 +1275,12 @@ static const uint32_t modeset_formats[] = { DRM_FORMAT_XRGB1555, }; +static const struct drm_plane_funcs nv04_primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {@@ -1289,7 +1295,7 @@ create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret =drm_universal_plane_init (dev, primary,0 , - &drm_primary_helper_funcs, + &nv04_primary_plane_funcs, modeset_formats,ARRAY_SIZE (modeset_formats),NULL ,DRM_PLANE_TYPE_PRIMARY ,NULL );drivers/gpu/drm/qxl/qxl_display.c +2
-2@@ -902,7 +902,7 @@ static const struct drm_plane_helper_funcs qxl_cursor_helper_funcs = {static const struct drm_plane_funcs qxl_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,@@ -924,7 +924,7 @@ static const struct drm_plane_helper_funcs primary_helper_funcs = {static const struct drm_plane_funcs qxl_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,drivers/gpu/drm/vboxvideo/vbox_mode.c +2
-2@@ -477,7 +477,7 @@ static const struct drm_plane_helper_funcs vbox_cursor_helper_funcs = {static const struct drm_plane_funcs vbox_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy,DRM_GEM_SHADOW_PLANE_FUNCS , };@@ -496,7 +496,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = {static const struct drm_plane_funcs vbox_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,include/drm/drm_plane_helper.h +16
-6@@ -24,12 +24,22 @@#ifndef DRM_PLANE_HELPER_H #define DRM_PLANE_HELPER_H -#include <drm/drm_rect.h> -#include <drm/drm_crtc.h> -#include <drm/drm_modeset_helper_vtables.h> -#include <drm/drm_modeset_helper.h> +#include <linux/types.h> -void drm_primary_helper_destroy (struct drm_plane *plane); -extern const struct drm_plane_funcs drm_primary_helper_funcs; +struct drm_crtc ; +struct drm_framebuffer ; +struct drm_modeset_acquire_ctx ; +struct drm_plane ; + +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx); +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx); +void drm_plane_helper_destroy (struct drm_plane *plane);#endif Signature · 1 line
2.36.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Thomas Zimmermann
maintainerRe: [PATCH 5/7] drm/plane-helper: Export individual helpers
Hi
Am 11.08.22 um 18:41 schrieb Daniel Vetter:
Quoted 19 lines · Thomas Zimmermann
Quoted 10 lines
Export the individual plane helpers that make up the plane functions and align the naming with other helpers. The plane helpers are for non-atomic modesetting and exporting them will simplify a later conversion of drivers to atomic modesetting.
With struct
drm_plane_funcsremoved fromdrm_plane_helper.h, also remove the include statements. It only needslinux/types.hforuint32_tand a number of forward declarations.Signed-off-by Thomas Zimmermann <[email protected]>So my commit message was maybe not super motivated, but I intentionally hid these because atomic drivers where using them, which is all bad no good. Now they're more exposed again, which sucks a bit. Exporting the complete function table for legacy helpers (and the one open-coded one in nouveau, not sure we could not move that back to
drm_crtc_init) feels much safer against abuse to me.
Quoted 4 lines
I'm not entirely clear why we're doing this, because the include untangle could also have been achieved with a struct forward decl, which is what we're usually doing. Can we walk this back please, or am I missing something here?
I don't think you miss anything. It's just ugly to export the complete funcs table. If we roll that change back, let's add a comment that states the rational you wrote here.
Best regards
Thomas
Quoted 282 lines
Cheers, Daniel
Quoted 278 lines
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +- drivers/gpu/drm/armada/armada_plane.c | 2 +- drivers/gpu/drm/drm_modeset_helper.c | 8 ++- drivers/gpu/drm/drm_plane_helper.c | 70 ++++++++++++++----- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 8 ++- drivers/gpu/drm/qxl/qxl_display.c | 4 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 +- include/drm/drm_plane_helper.h | 22 ++++-- 8 files changed, 88 insertions(+), 33 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1@@ -86,6 +86,7 @@#include <drm/drm_vblank.h> #include <drm/drm_audio_component.h> #include <drm/drm_gem_atomic_helper.h> +#include <drm/drm_plane_helper.h> #include "ivsrcid/dcn/irqsrcs_dcn_1_0.h" @@ -7824,7 +7825,7 @@ static void dm_drm_plane_destroy_state(struct drm_plane *plane,static const struct drm_plane_funcs dm_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = dm_drm_plane_reset, .atomic_duplicate_state = dm_drm_plane_duplicate_state, .atomic_destroy_state = dm_drm_plane_destroy_state,drivers/gpu/drm/armada/armada_plane.c +1
-1@@ -288,7 +288,7 @@ struct drm_plane_state *armada_plane_duplicate_state(struct drm_plane *plane)static const struct drm_plane_funcs armada_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = armada_plane_reset, .atomic_duplicate_state = armada_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,drivers/gpu/drm/drm_modeset_helper.c +7
-1@@ -108,6 +108,12 @@ static const uint32_t safe_modeset_formats[] = { DRM_FORMAT_ARGB8888, }; +static const struct drm_plane_funcs primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {struct drm_plane *primary;@@ -127,7 +133,7 @@ static struct drm_plane *create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret = drm_universal_plane_init(dev, primary, 0, - &drm_primary_helper_funcs, + &primary_plane_funcs, safe_modeset_formats, ARRAY_SIZE(safe_modeset_formats), NULL,drivers/gpu/drm/drm_plane_helper.c +51
-19@@ -145,13 +145,36 @@ static int drm_plane_helper_check_update(struct drm_plane *plane,return 0 ; } -static int drm_primary_helper_update (struct drm_plane *plane,struct drm_crtc *crtc, -struct drm_framebuffer *fb, -int crtc_x,int crtc_y, -unsigned int crtc_w,unsigned int crtc_h, -uint32_t src_x,uint32_t src_y, -uint32_t src_w,uint32_t src_h, -struct drm_modeset_acquire_ctx *ctx) +/** +* drm_plane_helper_update_primary - Helper for updating primary planes +* @plane: plane to update +* @crtc: the plane's new CRTC +* @fb: the plane's new framebuffer +* @crtc_x: x coordinate within CRTC +* @crtc_y: y coordinate within CRTC +* @crtc_w: width coordinate within CRTC +* @crtc_h: height coordinate within CRTC +* @src_x: x coordinate within source +* @src_y: y coordinate within source +* @src_w: width coordinate within source +* @src_h: height coordinate within source +* @ctx: modeset locking context +* +* This helper validates the given parameters and updates the primary plane. +* +* This function is only useful for non-atomic modesetting. Don't use +* it in new drivers. +* +* Returns: +* Zero on success, or an errno code otherwise. +*/ +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx) {struct drm_mode_set set = { .crtc = crtc,@@ -218,31 +241,40 @@ static int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *ckfree (connector_list);return ret; } +EXPORT_SYMBOL (drm_plane_helper_update_primary); -static int drm_primary_helper_disable (struct drm_plane *plane, -struct drm_modeset_acquire_ctx *ctx) +/** +* drm_plane_helper_disable_primary - Helper for disabling primary planes +* @plane: plane to disable +* @ctx: modeset locking context +* +* This helper returns an error when trying to disable the primary +* plane. +* +* This function is only useful for non-atomic modesetting. Don't use +* it in new drivers. +* +* Returns: +* An errno code. +*/ +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx) {return -EINVAL ; } +EXPORT_SYMBOL (drm_plane_helper_disable_primary);/** -* drm_primary_helper_destroy() - Helper for primary plane destruction +* drm_plane_helper_destroy() - Helper for primary plane destruction * @plane: plane to destroy * * Provides a default plane destroy handler for primary planes. This handler * is called during CRTC destruction. We disable the primary plane, remove * it from the DRM plane list, and deallocate the plane structure. */ -void drm_primary_helper_destroy (struct drm_plane *plane) +void drm_plane_helper_destroy (struct drm_plane *plane) {drm_plane_cleanup (plane);kfree (plane); } -EXPORT_SYMBOL (drm_primary_helper_destroy); - -const struct drm_plane_funcs drm_primary_helper_funcs = { - .update_plane = drm_primary_helper_update, - .disable_plane = drm_primary_helper_disable, - .destroy = drm_primary_helper_destroy, -}; -EXPORT_SYMBOL (drm_primary_helper_funcs); +EXPORT_SYMBOL (drm_plane_helper_destroy);drivers/gpu/drm/nouveau/dispnv04/crtc.c +7
-1@@ -1275,6 +1275,12 @@ static const uint32_t modeset_formats[] = { DRM_FORMAT_XRGB1555, }; +static const struct drm_plane_funcs nv04_primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {@@ -1289,7 +1295,7 @@ create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret =drm_universal_plane_init (dev, primary,0 , - &drm_primary_helper_funcs, + &nv04_primary_plane_funcs, modeset_formats,ARRAY_SIZE (modeset_formats),NULL ,DRM_PLANE_TYPE_PRIMARY ,NULL );drivers/gpu/drm/qxl/qxl_display.c +2
-2@@ -902,7 +902,7 @@ static const struct drm_plane_helper_funcs qxl_cursor_helper_funcs = {static const struct drm_plane_funcs qxl_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,@@ -924,7 +924,7 @@ static const struct drm_plane_helper_funcs primary_helper_funcs = {static const struct drm_plane_funcs qxl_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,drivers/gpu/drm/vboxvideo/vbox_mode.c +2
-2@@ -477,7 +477,7 @@ static const struct drm_plane_helper_funcs vbox_cursor_helper_funcs = {static const struct drm_plane_funcs vbox_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy,DRM_GEM_SHADOW_PLANE_FUNCS , };@@ -496,7 +496,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = {static const struct drm_plane_funcs vbox_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,include/drm/drm_plane_helper.h +16
-6@@ -24,12 +24,22 @@#ifndef DRM_PLANE_HELPER_H #define DRM_PLANE_HELPER_H -#include <drm/drm_rect.h> -#include <drm/drm_crtc.h> -#include <drm/drm_modeset_helper_vtables.h> -#include <drm/drm_modeset_helper.h> +#include <linux/types.h> -void drm_primary_helper_destroy (struct drm_plane *plane); -extern const struct drm_plane_funcs drm_primary_helper_funcs; +struct drm_crtc ; +struct drm_framebuffer ; +struct drm_modeset_acquire_ctx ; +struct drm_plane ; + +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx); +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx); +void drm_plane_helper_destroy (struct drm_plane *plane);#endif Signature · 1 line
2.36.1
Signature · 6 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: Ivo Totev
Re: [PATCH 5/7] drm/plane-helper: Export individual helpers
Quoted 22 lines · Thomas Zimmermann
Hi
Am 11.08.22 um 18:41 schrieb Daniel Vetter:
Quoted 19 lines · Thomas Zimmermann
Quoted 10 lines
Export the individual plane helpers that make up the plane functions and align the naming with other helpers. The plane helpers are for non-atomic modesetting and exporting them will simplify a later conversion of drivers to atomic modesetting.
With struct
drm_plane_funcsremoved fromdrm_plane_helper.h, also remove the include statements. It only needslinux/types.hforuint32_tand a number of forward declarations.Signed-off-by Thomas Zimmermann <[email protected]>So my commit message was maybe not super motivated, but I intentionally hid these because atomic drivers where using them, which is all bad no good. Now they're more exposed again, which sucks a bit. Exporting the complete function table for legacy helpers (and the one open-coded one in nouveau, not sure we could not move that back to
drm_crtc_init) feels much safer against abuse to me.
Quoted 8 lines
Quoted 4 lines
I'm not entirely clear why we're doing this, because the include untangle could also have been achieved with a struct forward decl, which is what we're usually doing. Can we walk this back please, or am I missing something here?
I don't think you miss anything. It's just ugly to export the complete funcs table. If we roll that change back, let's add a comment that states the rational you wrote here.
So I'm way behind on everything, but maybe another option is to just check in these functions that it's not an atomic modeset driver (i.e. drm_drv_uses_atomic_modeset()). Or we just hope driver authors are smarter now and there wont be fallout.
I'm also not clear on why exporting the entire vfunc table is a bad idea?
Either way I'd say up to you.
-Daniel
Quoted 281 lines
Best regards
ThomasQuoted 269 lines
Cheers, Daniel
Quoted 265 lines
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +- drivers/gpu/drm/armada/armada_plane.c | 2 +- drivers/gpu/drm/drm_modeset_helper.c | 8 ++- drivers/gpu/drm/drm_plane_helper.c | 70 ++++++++++++++----- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 8 ++- drivers/gpu/drm/qxl/qxl_display.c | 4 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 +- include/drm/drm_plane_helper.h | 22 ++++-- 8 files changed, 88 insertions(+), 33 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1@@ -86,6 +86,7 @@#include <drm/drm_vblank.h> #include <drm/drm_audio_component.h> #include <drm/drm_gem_atomic_helper.h> +#include <drm/drm_plane_helper.h> #include "ivsrcid/dcn/irqsrcs_dcn_1_0.h" @@ -7824,7 +7825,7 @@ static void dm_drm_plane_destroy_state(struct drm_plane *plane,static const struct drm_plane_funcs dm_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = dm_drm_plane_reset, .atomic_duplicate_state = dm_drm_plane_duplicate_state, .atomic_destroy_state = dm_drm_plane_destroy_state,drivers/gpu/drm/armada/armada_plane.c +1
-1@@ -288,7 +288,7 @@ struct drm_plane_state *armada_plane_duplicate_state(struct drm_plane *plane)static const struct drm_plane_funcs armada_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = armada_plane_reset, .atomic_duplicate_state = armada_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,drivers/gpu/drm/drm_modeset_helper.c +7
-1@@ -108,6 +108,12 @@ static const uint32_t safe_modeset_formats[] = { DRM_FORMAT_ARGB8888, }; +static const struct drm_plane_funcs primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {struct drm_plane *primary;@@ -127,7 +133,7 @@ static struct drm_plane *create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret = drm_universal_plane_init(dev, primary, 0, - &drm_primary_helper_funcs, + &primary_plane_funcs, safe_modeset_formats, ARRAY_SIZE(safe_modeset_formats), NULL,drivers/gpu/drm/drm_plane_helper.c +51
-19@@ -145,13 +145,36 @@ static int drm_plane_helper_check_update(struct drm_plane *plane,return 0 ; } -static int drm_primary_helper_update (struct drm_plane *plane,struct drm_crtc *crtc, -struct drm_framebuffer *fb, -int crtc_x,int crtc_y, -unsigned int crtc_w,unsigned int crtc_h, -uint32_t src_x,uint32_t src_y, -uint32_t src_w,uint32_t src_h, -struct drm_modeset_acquire_ctx *ctx) +/** +* drm_plane_helper_update_primary - Helper for updating primary planes +* @plane: plane to update +* @crtc: the plane's new CRTC +* @fb: the plane's new framebuffer +* @crtc_x: x coordinate within CRTC +* @crtc_y: y coordinate within CRTC +* @crtc_w: width coordinate within CRTC +* @crtc_h: height coordinate within CRTC +* @src_x: x coordinate within source +* @src_y: y coordinate within source +* @src_w: width coordinate within source +* @src_h: height coordinate within source +* @ctx: modeset locking context +* +* This helper validates the given parameters and updates the primary plane. +* +* This function is only useful for non-atomic modesetting. Don't use +* it in new drivers. +* +* Returns: +* Zero on success, or an errno code otherwise. +*/ +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx) {struct drm_mode_set set = { .crtc = crtc,@@ -218,31 +241,40 @@ static int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *ckfree (connector_list);return ret; } +EXPORT_SYMBOL (drm_plane_helper_update_primary); -static int drm_primary_helper_disable (struct drm_plane *plane, -struct drm_modeset_acquire_ctx *ctx) +/** +* drm_plane_helper_disable_primary - Helper for disabling primary planes +* @plane: plane to disable +* @ctx: modeset locking context +* +* This helper returns an error when trying to disable the primary +* plane. +* +* This function is only useful for non-atomic modesetting. Don't use +* it in new drivers. +* +* Returns: +* An errno code. +*/ +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx) {return -EINVAL ; } +EXPORT_SYMBOL (drm_plane_helper_disable_primary);/** -* drm_primary_helper_destroy() - Helper for primary plane destruction +* drm_plane_helper_destroy() - Helper for primary plane destruction * @plane: plane to destroy * * Provides a default plane destroy handler for primary planes. This handler * is called during CRTC destruction. We disable the primary plane, remove * it from the DRM plane list, and deallocate the plane structure. */ -void drm_primary_helper_destroy (struct drm_plane *plane) +void drm_plane_helper_destroy (struct drm_plane *plane) {drm_plane_cleanup (plane);kfree (plane); } -EXPORT_SYMBOL (drm_primary_helper_destroy); - -const struct drm_plane_funcs drm_primary_helper_funcs = { - .update_plane = drm_primary_helper_update, - .disable_plane = drm_primary_helper_disable, - .destroy = drm_primary_helper_destroy, -}; -EXPORT_SYMBOL (drm_primary_helper_funcs); +EXPORT_SYMBOL (drm_plane_helper_destroy);drivers/gpu/drm/nouveau/dispnv04/crtc.c +7
-1@@ -1275,6 +1275,12 @@ static const uint32_t modeset_formats[] = { DRM_FORMAT_XRGB1555, }; +static const struct drm_plane_funcs nv04_primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {@@ -1289,7 +1295,7 @@ create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret =drm_universal_plane_init (dev, primary,0 , - &drm_primary_helper_funcs, + &nv04_primary_plane_funcs, modeset_formats,ARRAY_SIZE (modeset_formats),NULL ,DRM_PLANE_TYPE_PRIMARY ,NULL );drivers/gpu/drm/qxl/qxl_display.c +2
-2@@ -902,7 +902,7 @@ static const struct drm_plane_helper_funcs qxl_cursor_helper_funcs = {static const struct drm_plane_funcs qxl_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,@@ -924,7 +924,7 @@ static const struct drm_plane_helper_funcs primary_helper_funcs = {static const struct drm_plane_funcs qxl_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,drivers/gpu/drm/vboxvideo/vbox_mode.c +2
-2@@ -477,7 +477,7 @@ static const struct drm_plane_helper_funcs vbox_cursor_helper_funcs = {static const struct drm_plane_funcs vbox_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy,DRM_GEM_SHADOW_PLANE_FUNCS , };@@ -496,7 +496,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = {static const struct drm_plane_funcs vbox_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,include/drm/drm_plane_helper.h +16
-6@@ -24,12 +24,22 @@#ifndef DRM_PLANE_HELPER_H #define DRM_PLANE_HELPER_H -#include <drm/drm_rect.h> -#include <drm/drm_crtc.h> -#include <drm/drm_modeset_helper_vtables.h> -#include <drm/drm_modeset_helper.h> +#include <linux/types.h> -void drm_primary_helper_destroy (struct drm_plane *plane); -extern const struct drm_plane_funcs drm_primary_helper_funcs; +struct drm_crtc ; +struct drm_framebuffer ; +struct drm_modeset_acquire_ctx ; +struct drm_plane ; + +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx); +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx); +void drm_plane_helper_destroy (struct drm_plane *plane);#endif Signature · 1 line
2.36.1Signature · 6 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: Ivo Totev
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Thomas Zimmermann
maintainerRe: [PATCH 5/7] drm/plane-helper: Export individual helpers
Hi
Am 06.09.22 um 21:15 schrieb Daniel Vetter:
Quoted 28 lines · Thomas Zimmermann
Quoted 27 lines
Hi
Am 11.08.22 um 18:41 schrieb Daniel Vetter:
Quoted 23 lines · Thomas Zimmermann
Quoted 10 lines
Export the individual plane helpers that make up the plane functions and align the naming with other helpers. The plane helpers are for non-atomic modesetting and exporting them will simplify a later conversion of drivers to atomic modesetting.
With struct
drm_plane_funcsremoved fromdrm_plane_helper.h, also remove the include statements. It only needslinux/types.hforuint32_tand a number of forward declarations.Signed-off-by Thomas Zimmermann <[email protected]>So my commit message was maybe not super motivated, but I intentionally hid these because atomic drivers where using them, which is all bad no good. Now they're more exposed again, which sucks a bit. Exporting the complete function table for legacy helpers (and the one open-coded one in nouveau, not sure we could not move that back to
drm_crtc_init) feels much safer against abuse to me.I'm not entirely clear why we're doing this, because the include untangle could also have been achieved with a struct forward decl, which is what we're usually doing. Can we walk this back please, or am I missing something here?
Quoted 6 lines
Quoted 3 lines
I don't think you miss anything. It's just ugly to export the complete funcs table. If we roll that change back, let's add a comment that states the rational you wrote here.
So I'm way behind on everything, but maybe another option is to just check in these functions that it's not an atomic modeset driver (i.e.
I think I would prefer that.
Quoted 4 lines
drm_drv_uses_atomic_modeset()). Or we just hope driver authors are smarter now and there wont be fallout.I'm also not clear on why exporting the entire vfunc table is a bad idea?
My complain is that it's a blackbox. When reading the driver, you never know what it does. If there are defaults that match most vtables, it's better the export an init macro (like we do for many of the callbacks in struct drm_driver).
This problem gets worse when one of the driver needs a variant of the vtable. Here a number of default callback functions need to be exported in addition to the vtable itself. So my take is that it's better to export the functions plus an init macro in the first place.
Let me see if I can send an update to the patch.
Best regards
Thomas
Quoted 289 lines
Either way I'd say up to you.
-DanielQuoted 281 lines
Best regards
ThomasQuoted 269 lines
Cheers, Daniel
Quoted 265 lines
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +- drivers/gpu/drm/armada/armada_plane.c | 2 +- drivers/gpu/drm/drm_modeset_helper.c | 8 ++- drivers/gpu/drm/drm_plane_helper.c | 70 ++++++++++++++----- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 8 ++- drivers/gpu/drm/qxl/qxl_display.c | 4 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 +- include/drm/drm_plane_helper.h | 22 ++++-- 8 files changed, 88 insertions(+), 33 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1@@ -86,6 +86,7 @@#include <drm/drm_vblank.h> #include <drm/drm_audio_component.h> #include <drm/drm_gem_atomic_helper.h> +#include <drm/drm_plane_helper.h> #include "ivsrcid/dcn/irqsrcs_dcn_1_0.h" @@ -7824,7 +7825,7 @@ static void dm_drm_plane_destroy_state(struct drm_plane *plane,static const struct drm_plane_funcs dm_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = dm_drm_plane_reset, .atomic_duplicate_state = dm_drm_plane_duplicate_state, .atomic_destroy_state = dm_drm_plane_destroy_state,drivers/gpu/drm/armada/armada_plane.c +1
-1@@ -288,7 +288,7 @@ struct drm_plane_state *armada_plane_duplicate_state(struct drm_plane *plane)static const struct drm_plane_funcs armada_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = armada_plane_reset, .atomic_duplicate_state = armada_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,drivers/gpu/drm/drm_modeset_helper.c +7
-1@@ -108,6 +108,12 @@ static const uint32_t safe_modeset_formats[] = { DRM_FORMAT_ARGB8888, }; +static const struct drm_plane_funcs primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {struct drm_plane *primary;@@ -127,7 +133,7 @@ static struct drm_plane *create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret = drm_universal_plane_init(dev, primary, 0, - &drm_primary_helper_funcs, + &primary_plane_funcs, safe_modeset_formats, ARRAY_SIZE(safe_modeset_formats), NULL,drivers/gpu/drm/drm_plane_helper.c +51
-19@@ -145,13 +145,36 @@ static int drm_plane_helper_check_update(struct drm_plane *plane,return 0 ; } -static int drm_primary_helper_update (struct drm_plane *plane,struct drm_crtc *crtc, -struct drm_framebuffer *fb, -int crtc_x,int crtc_y, -unsigned int crtc_w,unsigned int crtc_h, -uint32_t src_x,uint32_t src_y, -uint32_t src_w,uint32_t src_h, -struct drm_modeset_acquire_ctx *ctx) +/** +* drm_plane_helper_update_primary - Helper for updating primary planes +* @plane: plane to update +* @crtc: the plane's new CRTC +* @fb: the plane's new framebuffer +* @crtc_x: x coordinate within CRTC +* @crtc_y: y coordinate within CRTC +* @crtc_w: width coordinate within CRTC +* @crtc_h: height coordinate within CRTC +* @src_x: x coordinate within source +* @src_y: y coordinate within source +* @src_w: width coordinate within source +* @src_h: height coordinate within source +* @ctx: modeset locking context +* +* This helper validates the given parameters and updates the primary plane. +* +* This function is only useful for non-atomic modesetting. Don't use +* it in new drivers. +* +* Returns: +* Zero on success, or an errno code otherwise. +*/ +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx) {struct drm_mode_set set = { .crtc = crtc,@@ -218,31 +241,40 @@ static int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *ckfree (connector_list);return ret; } +EXPORT_SYMBOL (drm_plane_helper_update_primary); -static int drm_primary_helper_disable (struct drm_plane *plane, -struct drm_modeset_acquire_ctx *ctx) +/** +* drm_plane_helper_disable_primary - Helper for disabling primary planes +* @plane: plane to disable +* @ctx: modeset locking context +* +* This helper returns an error when trying to disable the primary +* plane. +* +* This function is only useful for non-atomic modesetting. Don't use +* it in new drivers. +* +* Returns: +* An errno code. +*/ +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx) {return -EINVAL ; } +EXPORT_SYMBOL (drm_plane_helper_disable_primary);/** -* drm_primary_helper_destroy() - Helper for primary plane destruction +* drm_plane_helper_destroy() - Helper for primary plane destruction * @plane: plane to destroy * * Provides a default plane destroy handler for primary planes. This handler * is called during CRTC destruction. We disable the primary plane, remove * it from the DRM plane list, and deallocate the plane structure. */ -void drm_primary_helper_destroy (struct drm_plane *plane) +void drm_plane_helper_destroy (struct drm_plane *plane) {drm_plane_cleanup (plane);kfree (plane); } -EXPORT_SYMBOL (drm_primary_helper_destroy); - -const struct drm_plane_funcs drm_primary_helper_funcs = { - .update_plane = drm_primary_helper_update, - .disable_plane = drm_primary_helper_disable, - .destroy = drm_primary_helper_destroy, -}; -EXPORT_SYMBOL (drm_primary_helper_funcs); +EXPORT_SYMBOL (drm_plane_helper_destroy);drivers/gpu/drm/nouveau/dispnv04/crtc.c +7
-1@@ -1275,6 +1275,12 @@ static const uint32_t modeset_formats[] = { DRM_FORMAT_XRGB1555, }; +static const struct drm_plane_funcs nv04_primary_plane_funcs = { + .update_plane = drm_plane_helper_update_primary, + .disable_plane = drm_plane_helper_disable_primary, + .destroy = drm_plane_helper_destroy, +}; +static struct drm_plane *create_primary_plane (struct drm_device *dev) {@@ -1289,7 +1295,7 @@ create_primary_plane(struct drm_device *dev)/* possible_crtc's will be filled in later by crtc_init */ ret =drm_universal_plane_init (dev, primary,0 , - &drm_primary_helper_funcs, + &nv04_primary_plane_funcs, modeset_formats,ARRAY_SIZE (modeset_formats),NULL ,DRM_PLANE_TYPE_PRIMARY ,NULL );drivers/gpu/drm/qxl/qxl_display.c +2
-2@@ -902,7 +902,7 @@ static const struct drm_plane_helper_funcs qxl_cursor_helper_funcs = {static const struct drm_plane_funcs qxl_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,@@ -924,7 +924,7 @@ static const struct drm_plane_helper_funcs primary_helper_funcs = {static const struct drm_plane_funcs qxl_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,drivers/gpu/drm/vboxvideo/vbox_mode.c +2
-2@@ -477,7 +477,7 @@ static const struct drm_plane_helper_funcs vbox_cursor_helper_funcs = {static const struct drm_plane_funcs vbox_cursor_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy,DRM_GEM_SHADOW_PLANE_FUNCS , };@@ -496,7 +496,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = {static const struct drm_plane_funcs vbox_primary_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = drm_primary_helper_destroy, + .destroy = drm_plane_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,include/drm/drm_plane_helper.h +16
-6@@ -24,12 +24,22 @@#ifndef DRM_PLANE_HELPER_H #define DRM_PLANE_HELPER_H -#include <drm/drm_rect.h> -#include <drm/drm_crtc.h> -#include <drm/drm_modeset_helper_vtables.h> -#include <drm/drm_modeset_helper.h> +#include <linux/types.h> -void drm_primary_helper_destroy (struct drm_plane *plane); -extern const struct drm_plane_funcs drm_primary_helper_funcs; +struct drm_crtc ; +struct drm_framebuffer ; +struct drm_modeset_acquire_ctx ; +struct drm_plane ; + +int drm_plane_helper_update_primary (struct drm_plane *plane,struct drm_crtc *crtc, +struct drm_framebuffer *fb, +int crtc_x,int crtc_y, +unsigned int crtc_w,unsigned int crtc_h, +uint32_t src_x,uint32_t src_y, +uint32_t src_w,uint32_t src_h, +struct drm_modeset_acquire_ctx *ctx); +int drm_plane_helper_disable_primary (struct drm_plane *plane, +struct drm_modeset_acquire_ctx *ctx); +void drm_plane_helper_destroy (struct drm_plane *plane);#endif Signature · 1 line
2.36.1Signature · 6 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: Ivo Totev
Signature · 6 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: Ivo Totev
Thomas Zimmermann
maintainerPATCH 6/7 drm/armada: Use drm_plane_helper_destroy()
In reply to Thomas ZimmermannReplace the driver's own function with drm_plane_helper_destroy(). No functional changes.
--- drivers/gpu/drm/armada/armada_overlay.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/armada/armada_overlay.c +2 -7
@@ -9,6 +9,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_uapi.h> #include <drm/drm_fourcc.h> +#include <drm/drm_plane_helper.h> #include "armada_crtc.h" #include "armada_drm.h"
@@ -297,12 +298,6 @@ armada_overlay_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,return ret; } -static void armada_ovl_plane_destroy (struct drm_plane *plane) -{ -drm_plane_cleanup (plane); -kfree (plane); -} -static void armada_overlay_reset (struct drm_plane *plane) {struct armada_overlay_state *state;
@@ -467,7 +462,7 @@ static int armada_overlay_get_property(struct drm_plane *plane,static const struct drm_plane_funcs armada_ovl_plane_funcs = { .update_plane = armada_overlay_plane_update, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = armada_ovl_plane_destroy, + .destroy = drm_plane_helper_destroy, .reset = armada_overlay_reset, .atomic_duplicate_state = armada_overlay_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
Signature · 1 line
2.36.1
Thomas Zimmermann
maintainerPATCH 7/7 drm/fsl-dcu: Use drm_plane_helper_destroy()
In reply to Thomas ZimmermannReplace the driver's own function with drm_plane_helper_destroy(). No functional changes.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +2 -7
@@ -14,6 +14,7 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include "fsl_dcu_drm_drv.h"
@@ -170,16 +171,10 @@ static const struct drm_plane_helper_funcs fsl_dcu_drm_plane_helper_funcs = { .atomic_update = fsl_dcu_drm_plane_atomic_update, }; -static void fsl_dcu_drm_plane_destroy (struct drm_plane *plane) -{ -drm_plane_cleanup (plane); -kfree (plane); -} -static const struct drm_plane_funcs fsl_dcu_drm_plane_funcs = { .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, - .destroy = fsl_dcu_drm_plane_destroy, + .destroy = drm_plane_helper_destroy, .disable_plane = drm_atomic_helper_disable_plane, .reset = drm_atomic_helper_plane_reset, .update_plane = drm_atomic_helper_update_plane,
Signature · 1 line
2.36.1
Re: [PATCH 7/7] drm/fsl-dcu: Use drm_plane_helper_destroy()
Quoted 4 lines · Thomas Zimmermann
Replace the driver's own function with
drm_plane_helper_destroy(). No functional changes.Signed-off-by Thomas Zimmermann <[email protected]>
Somewhat aside, but the real fix here is switching over to the drmm versions of this. As long as all you're doing is cleanup+kfree those should be safe, even if the driver overall is not converted at all.
Well ok I think you need to minimally convert over to drmm_mode_config_init(), otherwise things go boom.
Quick grep says we don't have _destroy() helpers for anything else, so this plane helper here is very much the odd one out, not sure spreading it is a good idea. Maybe some todo at least?
-Daniel
Quoted 37 lines
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +2
-7@@ -14,6 +14,7 @@#include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include "fsl_dcu_drm_drv.h" @@ -170,16 +171,10 @@ static const struct drm_plane_helper_funcs fsl_dcu_drm_plane_helper_funcs = { .atomic_update = fsl_dcu_drm_plane_atomic_update, }; -static void fsl_dcu_drm_plane_destroy (struct drm_plane *plane) -{ -drm_plane_cleanup (plane); -kfree (plane); -} -static const struct drm_plane_funcs fsl_dcu_drm_plane_funcs = { .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, - .destroy = fsl_dcu_drm_plane_destroy, + .destroy = drm_plane_helper_destroy, .disable_plane = drm_atomic_helper_disable_plane, .reset = drm_atomic_helper_plane_reset, .update_plane = drm_atomic_helper_update_plane,Signature · 1 line
2.36.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Hi Thomas,
Quoted 5 lines · Thomas Zimmermann
The plane helpers are included by dozens of files without any need. Only a hand full of source files need anything from
drm_plane_helper.h.Untangle everything and tidy up the code a bit. The patches were built on x64-64, aarch64 and arm without issues.
Build tested the final result here on a few more archs without any issues. I like the removal of the include statements and the simpler header file.
I did not really get what is gained by pushing out drm_plane_funcs to the drivers but trust this is in the end a better solution.
Series is:
Sam
Thomas Zimmermann
maintainerHi Sam
Am 20.07.22 um 17:08 schrieb Sam Ravnborg:
Quoted 6 lines
Hi Thomas,
Quoted 3 lines · Thomas Zimmermann
The plane helpers are included by dozens of files without any need. Only a hand full of source files need anything from
drm_plane_helper.h.
Quoted 6 lines
Quoted 2 lines
Untangle everything and tidy up the code a bit. The patches were built on x64-64, aarch64 and arm without issues.
Build tested the final result here on a few more archs without any issues. I like the removal of the include statements and the simpler header file.
Thanks for testing. I was surprised that nothing really needed drm_plane_helper.h.
Quoted 3 lines
I did not really get what is gained by pushing out
drm_plane_funcsto the drivers but trust this is in the end a better solution.
On one hand, I think it's not possible to declare the symbol without including drm_plane.h. So removing it reduces the number of include statements.
In terms of software design, these exported, pre-initialized data structures are like blackboxes and with little flexibility. But DRM helpers should rather be like a construction kit, where drivers can pick individual pieces from.
Quoted 3 lines
Series is:
Reviewed-by Sam Ravnborg <[email protected]>
Thank you
Best regards
Thomas
Quoted 2 lines
Sam
Signature · 6 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: Ivo Totev