As pointed out by Jani, colorop pipelines are using a locally coded list system based on a 'next' pointer rather than official kernel list structures: https://lore.kernel.org/dri-devel/[email protected]/
This patch set fixes that up. The result is a little odd. There is no pipeline object as such - pipelines are just a sequence of colorop objects and defined by whatever arbitrary colorop object happens to be first in the sequence. Therefore, there is no clear place to put the list head object. It has to go inside the first colorop in the pipe. Which means there is a list head inside *every* colorop object, regardless of whether it is the head of a pipeline or not. Most of them are just empty lists. Hence this set is being posted as an RFC - is the end result actually better than the current version? Outside of open coding vs using kernel helpers when iterating the list, probably the biggest advantage is being able to assert that any given colorop is the head of a pipeline rather than somewhere in the middle (or not in a pipeline at all). It should not be possible to pass a non-head colorop into a function that works on pipelines, but extra sanity checks are generally a good thing. Signed-off-by: John Harrison <[email protected]> CC: Melissa Wen <[email protected]> CC: Suraj Kandpal <[email protected]> CC: Chaitanya Kumar Borah <[email protected]> CC: Jani Nikula <[email protected]> CC: Alex Hung <[email protected]> CC: Harry Wentland <[email protected]> CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] John Harrison (8): drm/colorop: Reduce scope of colorop helpers drm/colorop: Create pipelines via 'add to pipeline' instead of 'set next' drm/i915/colorop: Update to new pipeline API drm/amd/colorop: Update to new pipeline API drm/vkms/colorop: Update to new pipeline API drm/colorop: Remove old add-next API as no longer used drm/colorop: Convert pipline 'next' pointer to a list drm/colorop: Check that requested colorop is the root of a pipeline .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 60 ++++++++++--------- .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 16 ++--- drivers/gpu/drm/drm_atomic.c | 15 ++++- drivers/gpu/drm/drm_atomic_uapi.c | 30 +++++++--- drivers/gpu/drm/drm_colorop.c | 29 +++++---- .../drm/i915/display/intel_color_pipeline.c | 14 ++--- drivers/gpu/drm/i915/display/intel_plane.c | 14 +++-- drivers/gpu/drm/vkms/vkms_colorop.c | 8 ++- drivers/gpu/drm/vkms/vkms_composer.c | 9 +-- include/drm/drm_colorop.h | 40 +++++-------- 10 files changed, 135 insertions(+), 100 deletions(-) -- 2.43.0
