drm: Fill in default values for plane properties
Subsystems (20)
cover drm: Fill in default values for plane properties
Hi,
We have a bunch of functions that create planes properties that will take a default value, but it isn't actually enforced in the plane state.
This leads to drivers having multiple strategies to work around that issue, most of them being a variation of forcing a value at plane state reset time. Others work fine by luck, or have entirely ignored the issue.
This series aims at making sure the default value set by the call to the function isn't ignored, and then making sure all drivers behave consistently.
Let me know what you think,
Maxime
Dave Stevenson (3):
drm/object: Add drm_object_property_get_default_value() function drm/object: Add default zpos value at reset drm/object: Add default color encoding and range value at reset
Maxime Ripard (20):
drm/komeda: plane: switch to plane reset helper drm/tegra: plane: switch to plane reset helper drm/tegra: hub: Fix zpos initial value mismatch drm/msm/mdp5: Fix zpos initial value mismatch drm/amd/display: Fix color encoding mismatch drm/tegra: plane: Remove redundant zpos initialisation drm/komeda: plane: Remove redundant zpos initialisation drm/exynos: plane: Remove redundant zpos initialisation drm/imx: ipuv3-plane: Remove redundant zpos initialisation drm/msm/mdp5: Remove redundant zpos initialisation drm/nouveau/kms: Remove redundant zpos initialisation drm/omap: plane: Fix zpos initial value mismatch drm/omap: plane: Remove redundant zpos initialisation drm/rcar: plane: Remove redundant zpos initialisation drm/sti: plane: Remove redundant zpos initialisation drm/sun4i: layer: Remove redundant zpos initialisation drm/komeda: plane: Remove redundant color encoding and range
initialisation
drm/armada: overlay: Remove redundant color encoding and range
initialisation
drm/imx: ipuv3-plane: Remove redundant color encoding and range
initialisation
drm/omap: plane: Remove redundant color encoding and range
initialisation
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- .../gpu/drm/arm/display/komeda/komeda_plane.c | 13 +---- drivers/gpu/drm/armada/armada_overlay.c | 2 - drivers/gpu/drm/drm_atomic_state_helper.c | 25 +++++++++ drivers/gpu/drm/drm_mode_object.c | 53 +++++++++++++++---- drivers/gpu/drm/exynos/exynos_drm_plane.c | 5 +- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +-- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 16 +++--- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 2 - drivers/gpu/drm/omapdrm/omap_plane.c | 22 ++++---- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 - drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sti/sti_plane.c | 6 --- drivers/gpu/drm/sti/sti_plane.h | 1 - drivers/gpu/drm/sun4i/sun4i_layer.c | 16 +++--- drivers/gpu/drm/tegra/hub.c | 2 +- drivers/gpu/drm/tegra/plane.c | 6 +-- include/drm/drm_mode_object.h | 7 +++ 21 files changed, 111 insertions(+), 83 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/23 drm/komeda: plane: switch to plane reset helper
komeda_plane_reset() does the state initialisation by copying a lot of the code found in the __drm_atomic_helper_plane_reset(). Let's switch to that helper and reduce the boilerplate.
--- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_plane.c +1 -5
@@ -145,14 +145,10 @@ static void komeda_plane_reset(struct drm_plane *plane) state =kzalloc (sizeof (*state),GFP_KERNEL );if (state) { - state->base.rotation =DRM_MODE_ROTATE_0 ; - state->base.pixel_blend_mode =DRM_MODE_BLEND_PREMULTI ; - state->base.alpha =DRM_BLEND_ALPHA_OPAQUE ; +__drm_atomic_helper_plane_reset (plane, &state->base); state->base.zpos = kplane->layer->base.id; state->base.color_encoding =DRM_COLOR_YCBCR_BT601 ; state->base.color_range =DRM_COLOR_YCBCR_LIMITED_RANGE ; - plane->state = &state->base; - plane->state->plane = plane; } }
Signature · 1 line
2.34.1
PATCH 2/23 drm/tegra: plane: switch to plane reset helper
In reply to Maxime Ripardtegra_plane_reset() does the state initialisation by copying a lot of the code found in the __drm_atomic_helper_plane_reset(). Let's switch to that helper and reduce the boilerplate.
--- drivers/gpu/drm/tegra/plane.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/tegra/plane.c +1 -2
@@ -37,8 +37,7 @@ static void tegra_plane_reset(struct drm_plane *plane) state =kzalloc (sizeof (*state),GFP_KERNEL );if (state) { - plane->state = &state->base; - plane->state->plane = plane; +__drm_atomic_helper_plane_reset (plane, &state->base); plane->state->zpos = p->index; plane->state->normalized_zpos = p->index;
Signature · 1 line
2.34.1
PATCH 3/23 drm/tegra: hub: Fix zpos initial value mismatch
In reply to Maxime RipardWhile the tegra_shared_plane_create() function calls drm_plane_create_zpos_property() with an initial value of 0, tegra_plane_reset() will force it to the plane index.
Fix the discrepancy by setting the initial zpos value to the plane index in the function call.
--- drivers/gpu/drm/tegra/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/hub.c +1 -1
@@ -788,7 +788,7 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm, }drm_plane_helper_add (p, &tegra_shared_plane_helper_funcs); -drm_plane_create_zpos_property (p,0 ,0 ,255 ); +drm_plane_create_zpos_property (p, index,0 ,255 );return p; }
Signature · 1 line
2.34.1
PATCH 4/23 drm/msm/mdp5: Fix zpos initial value mismatch
In reply to Maxime RipardWhile the mdp5_plane_install_properties() function calls drm_plane_create_zpos_property() with an initial value of 1, mdp5_plane_reset() will force it to another value depending on the plane type.
Fix the discrepancy by setting the initial zpos value to the same value in the drm_plane_create_zpos_property() call.
--- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +8 -1
@@ -48,6 +48,8 @@ static void mdp5_plane_destroy(struct drm_plane *plane)static void mdp5_plane_install_properties (struct drm_plane *plane,struct drm_mode_object *obj) { +unsigned int zpos; + drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 |
@@ -59,7 +61,12 @@ static void mdp5_plane_install_properties(struct drm_plane *plane,BIT (DRM_MODE_BLEND_PIXEL_NONE ) |BIT (DRM_MODE_BLEND_PREMULTI ) | BIT(DRM_MODE_BLEND_COVERAGE)); -drm_plane_create_zpos_property (plane,1 ,1 ,255 ); + +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) + zpos =STAGE_BASE ; +else + zpos =STAGE0 +drm_plane_index (plane); +drm_plane_create_zpos_property (plane, zpos,1 ,255 ); } static void
Signature · 1 line
2.34.1
Re: [PATCH 04/23] drm/msm/mdp5: Fix zpos initial value mismatch
Quoted 8 lines · Maxime Ripard
While the
mdp5_plane_install_properties()function callsdrm_plane_create_zpos_property()with an initial value of 1,mdp5_plane_reset()will force it to another value depending on the plane type.Fix the discrepancy by setting the initial zpos value to the same value in the
drm_plane_create_zpos_property()call.
Could you please squash two msm/mdp5 patches into a single patch, making it clear that the code is moved.
Also please add:
With that in place:
Quoted 41 lines
Cc Abhinav Kumar <[email protected]>Cc Rob Clark <[email protected]>Cc Sean Paul <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +8
-2@@ -48,6 +48,8 @@ static void mdp5_plane_destroy(struct drm_plane *plane)static void mdp5_plane_install_properties (struct drm_plane *plane,struct drm_mode_object *obj) { +unsigned int zpos; + drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 |@@ -59,7 +61,12 @@ static void mdp5_plane_install_properties(struct drm_plane *plane,BIT (DRM_MODE_BLEND_PIXEL_NONE ) |BIT (DRM_MODE_BLEND_PREMULTI ) | BIT(DRM_MODE_BLEND_COVERAGE)); -drm_plane_create_zpos_property (plane,1 ,1 ,255 ); + +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) + zpos =STAGE_BASE ; +else + zpos =STAGE0 +drm_plane_index (plane); +drm_plane_create_zpos_property (plane, zpos,1 ,255 ); } static void --2.34.1
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 04/23] drm/msm/mdp5: Fix zpos initial value mismatch
Hi,
Quoted 7 lines · Dmitry Baryshkov
Quoted 6 lines · Maxime Ripard
While the
mdp5_plane_install_properties()function callsdrm_plane_create_zpos_property()with an initial value of 1,mdp5_plane_reset()will force it to another value depending on the plane type.
Quoted 8 lines
Quoted 2 lines
Fix the discrepancy by setting the initial zpos value to the same value in the
drm_plane_create_zpos_property()call.Could you please squash two msm/mdp5 patches into a single patch, making it clear that the code is moved.
Also please add:
Fixes 7d36db0be3b9 ("drm/msm/mdp5: switch to standard zpos property")
If we are to merge both patches, we can't have a fixes tag, since it relies on the other framework patches that won't get backported.
Maxime
PATCH 5/23 drm/amd/display: Fix color encoding mismatch
In reply to Maxime RipardThe amdgpu KMS driver calls drm_plane_create_color_properties() with a default encoding set to BT709.
However, the core will ignore it and the driver doesn't force it in its plane state reset hook, so the initial value will be 0, which represents BT601.
Fix the mismatch by using an initial value of BT601 in drm_plane_create_color_properties().
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -7914,7 +7914,7 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,BIT (DRM_COLOR_YCBCR_BT2020 ),BIT (DRM_COLOR_YCBCR_LIMITED_RANGE ) |BIT (DRM_COLOR_YCBCR_FULL_RANGE ), - DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE); + DRM_COLOR_YCBCR_BT601, DRM_COLOR_YCBCR_LIMITED_RANGE); } supported_rotations =
Signature · 1 line
2.34.1
Harry Wentland
maintainerRe: [PATCH 05/23] drm/amd/display: Fix color encoding mismatch
Quoted 7 lines · Maxime Ripard
The amdgpu KMS driver calls
drm_plane_create_color_properties()with a default encoding set to BT709.However, the core will ignore it and the driver doesn't force it in its plane state reset hook, so the initial value will be 0, which represents BT601.
Isn't this a core issue? Should __drm_atomic_helper_plane_state_reset reset all plane_state members to their properties' default values?
The amdgpu KMS driver currently doesn't respect the color_encoding property but I would expect that a call to drm_plane_create_color_properties with a default of BT709 means we're getting BT709 as color_encoding as part of atomic commits.
Harry
Quoted 28 lines
Fix the mismatch by using an initial value of BT601 in
drm_plane_create_color_properties().Cc Alex Deucher <[email protected]>Cc "Christian König" <[email protected]>Cc Harry Wentland <[email protected]>Cc Leo Li <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc Rodrigo Siqueira <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-1@@ -7914,7 +7914,7 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,BIT (DRM_COLOR_YCBCR_BT2020 ),BIT (DRM_COLOR_YCBCR_LIMITED_RANGE ) |BIT (DRM_COLOR_YCBCR_FULL_RANGE ), - DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE); + DRM_COLOR_YCBCR_BT601, DRM_COLOR_YCBCR_LIMITED_RANGE); } supported_rotations =
Harry Wentland
maintainerRe: [PATCH 05/23] drm/amd/display: Fix color encoding mismatch
Quoted 4 lines · Harry Wentland
Quoted 3 lines · Maxime Ripard
The amdgpu KMS driver calls
drm_plane_create_color_properties()with a default encoding set to BT709.
Quoted 8 lines
Quoted 4 lines
However, the core will ignore it and the driver doesn't force it in its plane state reset hook, so the initial value will be 0, which represents BT601.
Isn't this a core issue? Should
__drm_atomic_helper_plane_state_resetreset allplane_statemembers to their properties' default values?
Ah, looks like that's exactly what you do in the later patches, which is perfect. With that, I don't think you'll need this patch anymore.
Harry
Quoted 36 lines
The amdgpu KMS driver currently doesn't respect the
color_encodingproperty but I would expect that a call todrm_plane_create_color_propertieswith a default of BT709 means we're getting BT709 ascolor_encodingas part of atomic commits.Harry
Quoted 28 lines
Fix the mismatch by using an initial value of BT601 in
drm_plane_create_color_properties().Cc Alex Deucher <[email protected]>Cc "Christian König" <[email protected]>Cc Harry Wentland <[email protected]>Cc Leo Li <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc Rodrigo Siqueira <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-1@@ -7914,7 +7914,7 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,BIT (DRM_COLOR_YCBCR_BT2020 ),BIT (DRM_COLOR_YCBCR_LIMITED_RANGE ) |BIT (DRM_COLOR_YCBCR_FULL_RANGE ), - DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE); + DRM_COLOR_YCBCR_BT601, DRM_COLOR_YCBCR_LIMITED_RANGE); } supported_rotations =
Re: [PATCH 05/23] drm/amd/display: Fix color encoding mismatch
Hi Harry,
Quoted 10 lines · Harry Wentland
Quoted 9 lines · Harry Wentland
Quoted 7 lines · Maxime Ripard
The amdgpu KMS driver calls
drm_plane_create_color_properties()with a default encoding set to BT709.However, the core will ignore it and the driver doesn't force it in its plane state reset hook, so the initial value will be 0, which represents BT601.
Quoted 6 lines
Quoted 3 lines
Isn't this a core issue? Should
__drm_atomic_helper_plane_state_resetreset allplane_statemembers to their properties' default values?Ah, looks like that's exactly what you do in the later patches, which is perfect. With that, I don't think you'll need this patch anymore.
Ok, I'll squash it into the patch that removes the reset code.
Thanks!
Maxime
Harry Wentland
maintainerRe: [PATCH 05/23] drm/amd/display: Fix color encoding mismatch
Quoted 13 lines · Maxime Ripard
Hi Harry,
Quoted 10 lines · Harry Wentland
Quoted 9 lines · Harry Wentland
Quoted 7 lines · Maxime Ripard
The amdgpu KMS driver calls
drm_plane_create_color_properties()with a default encoding set to BT709.However, the core will ignore it and the driver doesn't force it in its plane state reset hook, so the initial value will be 0, which represents BT601.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Isn't this a core issue? Should
__drm_atomic_helper_plane_state_resetreset allplane_statemembers to their properties' default values?Ah, looks like that's exactly what you do in the later patches, which is perfect. With that, I don't think you'll need this patch anymore.
Ok, I'll squash it into the patch that removes the reset code.
I don't think that's right. I think we can just drop this patch. The amdgpu display driver is not doing BT601 by default.
Harry
Quoted 2 lines
Thanks!
Maxime
Re: [PATCH 05/23] drm/amd/display: Fix color encoding mismatch
Hi Harry,
Quoted 16 lines · Harry Wentland
Quoted 15 lines · Maxime Ripard
Quoted 14 lines · Harry Wentland
Quoted 12 lines · Harry Wentland
Quoted 7 lines · Maxime Ripard
The amdgpu KMS driver calls
drm_plane_create_color_properties()with a default encoding set to BT709.However, the core will ignore it and the driver doesn't force it in its plane state reset hook, so the initial value will be 0, which represents BT601.
Isn't this a core issue? Should
__drm_atomic_helper_plane_state_resetreset allplane_statemembers to their properties' default values?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Ah, looks like that's exactly what you do in the later patches, which is perfect. With that, I don't think you'll need this patch anymore.
Ok, I'll squash it into the patch that removes the reset code.
I don't think that's right. I think we can just drop this patch. The amdgpu display driver is not doing BT601 by default.
My understanding from the code currently in tree is that:
1) amdgpu_dm_plane_init() will call drm_plane_create_color_properties() with an initial value set to BT709.
2) dm_drm_plane_reset() will use kzalloc and then just rely on __drm_atomic_helper_plane_reset(), which will not set the color encoding at all. It's thus 0 in the initial state.
3) the drm_color_encoding enum will have BT601 associated to 0
So it does look like the default for amdgpu at the moment is BT601?
Maxime
PATCH 6/23 drm/object: Add drm_object_property_get_default_value() function
In reply to Maxime RipardFrom: Dave Stevenson <[email protected]>
Some functions to create properties (drm_plane_create_zpos_property or drm_plane_create_color_properties for example) will ask for a range of acceptable value and an initial one.
This initial value is then stored in the values array for that property.
Let's provide an helper to access this property.
--- drivers/gpu/drm/drm_mode_object.c | 53 +++++++++++++++++++++++++------ include/drm/drm_mode_object.h | 7 ++++ 2 files changed, 50 insertions(+), 10 deletions(-)
drivers/gpu/drm/drm_mode_object.c +43 -10
@@ -297,11 +297,26 @@ int drm_object_property_set_value(struct drm_mode_object *obj, }EXPORT_SYMBOL (drm_object_property_set_value); +static int __drm_object_property_get_prop_value (struct drm_mode_object *obj, +struct drm_property *property, +uint64_t *val) +{ +int i; + +for (i =0 ; i < obj->properties->count; i++) { +if (obj->properties->properties[i] == property) { + *val = obj->properties->values[i]; +return 0 ; + } + } + +return -EINVAL ; +} +static int __drm_object_property_get_value (struct drm_mode_object *obj,struct drm_property *property,uint64_t *val) { -int i;/* read-only properties bypass atomic mechanism and still store * their value in obj->properties->values[].. mostly to avoid
@@ -311,15 +326,7 @@ static int __drm_object_property_get_value(struct drm_mode_object *obj, !(property->flags & DRM_MODE_PROP_IMMUTABLE))return drm_atomic_get_property (obj, property, val); -for (i =0 ; i < obj->properties->count; i++) { -if (obj->properties->properties[i] == property) { - *val = obj->properties->values[i]; -return 0 ; - } - - } - -return -EINVAL ; +return __drm_object_property_get_prop_value (obj, property, val); }/**
@@ -348,6 +355,32 @@ int drm_object_property_get_value(struct drm_mode_object *obj, }EXPORT_SYMBOL (drm_object_property_get_value); +/** +* drm_object_property_get_default_value - retrieve the default value of a +* property when in atomic mode. +* @obj: drm mode object to get property value from +* @property: property to retrieve +* @val: storage for the property value +* +* This function retrieves the default state of the given property as passed in +* to drm_object_attach_property +* +* Only atomic drivers should call this function directly, as for non-atomic +* drivers it will return the current value. +* +* Returns: +* Zero on success, error code on failure. +*/ +int drm_object_property_get_default_value (struct drm_mode_object *obj, +struct drm_property *property, +uint64_t *val) +{ +WARN_ON (!drm_drv_uses_atomic_modeset (property->dev)); + +return __drm_object_property_get_prop_value (obj, property, val); +} +EXPORT_SYMBOL (drm_object_property_get_default_value); +/* helper for getconnector and getproperties ioctls */ int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic, uint32_t __user *prop_ptr,
include/drm/drm_mode_object.h +7 -0
@@ -98,6 +98,10 @@ struct drm_object_properties {* Hence atomic drivers should not use drm_object_property_set_value() * and drm_object_property_get_value() on mutable objects, i.e. those * without the DRM_MODE_PROP_IMMUTABLE flag set. +* +* For atomic drivers the default value of properties is stored in this +* array, so drm_object_property_get_default_value can be used to +* retrieve it. */ uint64_t values[DRM_OBJECT_MAX_PROPERTY ]; };
@@ -126,6 +130,9 @@ int drm_object_property_set_value(struct drm_mode_object *obj,int drm_object_property_get_value (struct drm_mode_object *obj,struct drm_property *property,uint64_t *value); +int drm_object_property_get_default_value (struct drm_mode_object *obj, +struct drm_property *property, +uint64_t *val); void drm_object_attach_property(struct drm_mode_object *obj, struct drm_property *property,
Signature · 1 line
2.34.1
Re: [PATCH 06/23] drm/object: Add drm_object_property_get_default_value() function
Hi Maxime and Dave,
Thank you for the patch.
Quoted 6 lines · Maxime Ripard
From: Dave Stevenson <[email protected]>
Some functions to create properties (
drm_plane_create_zpos_propertyordrm_plane_create_color_propertiesfor example) will ask for a range of acceptable value and an initial one.
Quoted 6 lines
This initial value is then stored in the values array for that property.
Let's provide an helper to access this property.
Signed-off-by Dave Stevenson <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 115 lines
--- drivers/gpu/drm/drm_mode_object.c | 53 +++++++++++++++++++++++++------ include/drm/drm_mode_object.h | 7 ++++ 2 files changed, 50 insertions(+), 10 deletions(-)drivers/gpu/drm/drm_mode_object.c +43
-10@@ -297,11 +297,26 @@ int drm_object_property_set_value(struct drm_mode_object *obj, }EXPORT_SYMBOL (drm_object_property_set_value); +static int __drm_object_property_get_prop_value (struct drm_mode_object *obj, +struct drm_property *property, +uint64_t *val) +{ +int i; + +for (i =0 ; i < obj->properties->count; i++) { +if (obj->properties->properties[i] == property) { + *val = obj->properties->values[i]; +return 0 ; + } + } + +return -EINVAL ; +} +static int __drm_object_property_get_value (struct drm_mode_object *obj,struct drm_property *property,uint64_t *val) { -int i;/* read-only properties bypass atomic mechanism and still store * their value in obj->properties->values[].. mostly to avoid @@ -311,15 +326,7 @@ static int __drm_object_property_get_value(struct drm_mode_object *obj, !(property->flags & DRM_MODE_PROP_IMMUTABLE))return drm_atomic_get_property (obj, property, val); -for (i =0 ; i < obj->properties->count; i++) { -if (obj->properties->properties[i] == property) { - *val = obj->properties->values[i]; -return 0 ; - } - - } - -return -EINVAL ; +return __drm_object_property_get_prop_value (obj, property, val); }/** @@ -348,6 +355,32 @@ int drm_object_property_get_value(struct drm_mode_object *obj, }EXPORT_SYMBOL (drm_object_property_get_value); +/** +* drm_object_property_get_default_value - retrieve the default value of a +* property when in atomic mode. +* @obj: drm mode object to get property value from +* @property: property to retrieve +* @val: storage for the property value +* +* This function retrieves the default state of the given property as passed in +* to drm_object_attach_property +* +* Only atomic drivers should call this function directly, as for non-atomic +* drivers it will return the current value. +* +* Returns: +* Zero on success, error code on failure. +*/ +int drm_object_property_get_default_value (struct drm_mode_object *obj, +struct drm_property *property, +uint64_t *val) +{ +WARN_ON (!drm_drv_uses_atomic_modeset (property->dev)); + +return __drm_object_property_get_prop_value (obj, property, val); +} +EXPORT_SYMBOL (drm_object_property_get_default_value); +/* helper for getconnector and getproperties ioctls */ int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic, uint32_t __user *prop_ptr,include/drm/drm_mode_object.h +7
-0@@ -98,6 +98,10 @@ struct drm_object_properties {* Hence atomic drivers should not use drm_object_property_set_value() * and drm_object_property_get_value() on mutable objects, i.e. those * without the DRM_MODE_PROP_IMMUTABLE flag set. +* +* For atomic drivers the default value of properties is stored in this +* array, so drm_object_property_get_default_value can be used to +* retrieve it. */ uint64_t values[DRM_OBJECT_MAX_PROPERTY ]; };@@ -126,6 +130,9 @@ int drm_object_property_set_value(struct drm_mode_object *obj,int drm_object_property_get_value (struct drm_mode_object *obj,struct drm_property *property,uint64_t *value); +int drm_object_property_get_default_value (struct drm_mode_object *obj, +struct drm_property *property, +uint64_t *val); void drm_object_attach_property(struct drm_mode_object *obj, struct drm_property *property,Signature · 1 line
2.34.1
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 7/23 drm/object: Add default zpos value at reset
In reply to Maxime RipardFrom: Dave Stevenson <[email protected]>
The drm_plane_create_zpos_property() function asks for an initial value, and will set the associated plane state variable with that value if a state is present.
However, that function is usually called at a time where there's no state yet. Since the drm_plane_state reset helper doesn't take care of reading that value when it's called, it means that in most cases the initial value will be 0, or the drivers will have to work around it.
Let's add some code in __drm_atomic_helper_plane_state_reset() to get the initial zpos value if the property has been attached in order to fix this.
--- drivers/gpu/drm/drm_atomic_state_helper.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/drm_atomic_state_helper.c +11 -0
@@ -243,11 +243,22 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);void __drm_atomic_helper_plane_state_reset (struct drm_plane_state *plane_state,struct drm_plane *plane) { +u64 val; + plane_state->plane = plane; plane_state->rotation =DRM_MODE_ROTATE_0 ; plane_state->alpha =DRM_BLEND_ALPHA_OPAQUE ; plane_state->pixel_blend_mode =DRM_MODE_BLEND_PREMULTI ; + +if (plane->zpos_property) { +if (!drm_object_property_get_default_value (&plane->base, + plane->zpos_property, + &val)) { + plane_state->zpos = val; + plane_state->normalized_zpos = val; + } + } }EXPORT_SYMBOL (__drm_atomic_helper_plane_state_reset);
Signature · 1 line
2.34.1
Re: [PATCH 07/23] drm/object: Add default zpos value at reset
Quoted 11 lines · Maxime Ripard
From: Dave Stevenson <[email protected]>
The
drm_plane_create_zpos_property()function asks for an initial value, and will set the associated plane state variable with that value if a state is present.However, that function is usually called at a time where there's no state yet. Since the
drm_plane_statereset helper doesn't take care of reading that value when it's called, it means that in most cases the initial value will be 0, or the drivers will have to work around it.
Quoted 6 lines
Let's add some code in
__drm_atomic_helper_plane_state_reset()to get the initial zpos value if the property has been attached in order to fix this.Signed-off-by Dave Stevenson <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Harry
Quoted 31 lines
--- drivers/gpu/drm/drm_atomic_state_helper.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/gpu/drm/drm_atomic_state_helper.c +11
-0@@ -243,11 +243,22 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);void __drm_atomic_helper_plane_state_reset (struct drm_plane_state *plane_state,struct drm_plane *plane) { +u64 val; + plane_state->plane = plane; plane_state->rotation =DRM_MODE_ROTATE_0 ; plane_state->alpha =DRM_BLEND_ALPHA_OPAQUE ; plane_state->pixel_blend_mode =DRM_MODE_BLEND_PREMULTI ; + +if (plane->zpos_property) { +if (!drm_object_property_get_default_value (&plane->base, + plane->zpos_property, + &val)) { + plane_state->zpos = val; + plane_state->normalized_zpos = val; + } + } }EXPORT_SYMBOL (__drm_atomic_helper_plane_state_reset);
Re: [PATCH 07/23] drm/object: Add default zpos value at reset
In reply to Maxime RipardHi Maxime and Dave,
Thank you for the patch.
Quoted 11 lines · Maxime Ripard
From: Dave Stevenson <[email protected]>
The
drm_plane_create_zpos_property()function asks for an initial value, and will set the associated plane state variable with that value if a state is present.However, that function is usually called at a time where there's no state yet. Since the
drm_plane_statereset helper doesn't take care of reading that value when it's called, it means that in most cases the initial value will be 0, or the drivers will have to work around it.
Quoted 6 lines
Let's add some code in
__drm_atomic_helper_plane_state_reset()to get the initial zpos value if the property has been attached in order to fix this.Signed-off-by Dave Stevenson <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Looks reasonable.
Quoted 31 lines
--- drivers/gpu/drm/drm_atomic_state_helper.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/gpu/drm/drm_atomic_state_helper.c +11
-0@@ -243,11 +243,22 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);void __drm_atomic_helper_plane_state_reset (struct drm_plane_state *plane_state,struct drm_plane *plane) { +u64 val; + plane_state->plane = plane; plane_state->rotation =DRM_MODE_ROTATE_0 ; plane_state->alpha =DRM_BLEND_ALPHA_OPAQUE ; plane_state->pixel_blend_mode =DRM_MODE_BLEND_PREMULTI ; + +if (plane->zpos_property) { +if (!drm_object_property_get_default_value (&plane->base, + plane->zpos_property, + &val)) { + plane_state->zpos = val; + plane_state->normalized_zpos = val; + } + } }EXPORT_SYMBOL (__drm_atomic_helper_plane_state_reset);
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 8/23 drm/tegra: plane: Remove redundant zpos initialisation
In reply to Maxime RipardThe tegra KMS driver will call drm_plane_create_zpos_property() with an init value of the plane index.
Since the initial value wasn't carried over in the state, the driver had to set it again in tegra_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/tegra/plane.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/tegra/plane.c +0 -3
@@ -25,7 +25,6 @@ static void tegra_plane_destroy(struct drm_plane *plane)static void tegra_plane_reset (struct drm_plane *plane) { -struct tegra_plane *p =to_tegra_plane (plane);struct tegra_plane_state *state;unsigned int i;
@@ -38,8 +37,6 @@ static void tegra_plane_reset(struct drm_plane *plane) state =kzalloc (sizeof (*state),GFP_KERNEL );if (state) {__drm_atomic_helper_plane_reset (plane, &state->base); - plane->state->zpos = p->index; - plane->state->normalized_zpos = p->index;for (i =0 ; i <3 ; i++) state->iova[i] =DMA_MAPPING_ERROR ;
Signature · 1 line
2.34.1
PATCH 9/23 drm/komeda: plane: Remove redundant zpos initialisation
In reply to Maxime RipardThe komeda KMS driver will call drm_plane_create_zpos_property() with an init value of the plane index.
Since the initial value wasn't carried over in the state, the driver had to set it again in komeda_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_plane.c +0 -2
@@ -135,7 +135,6 @@ static void komeda_plane_destroy(struct drm_plane *plane)static void komeda_plane_reset (struct drm_plane *plane) {struct komeda_plane_state *state; -struct komeda_plane *kplane =to_kplane (plane);if (plane->state)__drm_atomic_helper_plane_destroy_state (plane->state);
@@ -146,7 +145,6 @@ static void komeda_plane_reset(struct drm_plane *plane) state =kzalloc (sizeof (*state),GFP_KERNEL );if (state) {__drm_atomic_helper_plane_reset (plane, &state->base); - state->base.zpos = kplane->layer->base.id; state->base.color_encoding =DRM_COLOR_YCBCR_BT601 ; state->base.color_range =DRM_COLOR_YCBCR_LIMITED_RANGE ; }
Signature · 1 line
2.34.1
PATCH 10/23 drm/exynos: plane: Remove redundant zpos initialisation
In reply to Maxime RipardThe exynos KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane purpose.
Since the initial value wasn't carried over in the state, the driver had to set it again in exynos_drm_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/exynos/exynos_drm_plane.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_plane.c +1 -4
@@ -122,7 +122,6 @@ static void exynos_plane_mode_set(struct exynos_drm_plane_state *exynos_state)static void exynos_drm_plane_reset (struct drm_plane *plane) { -struct exynos_drm_plane *exynos_plane =to_exynos_plane (plane);struct exynos_drm_plane_state *exynos_state;if (plane->state) {
@@ -133,10 +132,8 @@ static void exynos_drm_plane_reset(struct drm_plane *plane) } exynos_state =kzalloc (sizeof (*exynos_state),GFP_KERNEL ); -if (exynos_state) { +if (exynos_state)__drm_atomic_helper_plane_reset (plane, &exynos_state->base); - plane->state->zpos = exynos_plane->config->zpos; - } } static struct drm_plane_state *
Signature · 1 line
2.34.1
PATCH 11/23 drm/imx: ipuv3-plane: Remove redundant zpos initialisation
In reply to Maxime RipardThe imx KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane purpose.
Since the initial value wasn't carried over in the state, the driver had to set it again in ipu_plane_state_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/imx/ipuv3-plane.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/imx/ipuv3-plane.c +0 -3
@@ -297,7 +297,6 @@ void ipu_plane_disable_deferred(struct drm_plane *plane)static void ipu_plane_state_reset (struct drm_plane *plane) { -unsigned int zpos = (plane->type ==DRM_PLANE_TYPE_PRIMARY ) ?0 :1 ;struct ipu_plane_state *ipu_state;if (plane->state) {
@@ -311,8 +310,6 @@ static void ipu_plane_state_reset(struct drm_plane *plane)if (ipu_state) {__drm_atomic_helper_plane_reset (plane, &ipu_state->base); - ipu_state->base.zpos = zpos; - ipu_state->base.normalized_zpos = zpos; ipu_state->base.color_encoding =DRM_COLOR_YCBCR_BT601 ; ipu_state->base.color_range =DRM_COLOR_YCBCR_LIMITED_RANGE ; }
Signature · 1 line
2.34.1
PATCH 12/23 drm/msm/mdp5: Remove redundant zpos initialisation
In reply to Maxime RipardThe mdp KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane purpose.
Since the initial value wasn't carried over in the state, the driver had to set it again in mdp5_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +0 -7
@@ -98,13 +98,6 @@ static void mdp5_plane_reset(struct drm_plane *plane)kfree (to_mdp5_plane_state (plane->state)); mdp5_state =kzalloc (sizeof (*mdp5_state),GFP_KERNEL ); - -if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) - mdp5_state->base.zpos =STAGE_BASE ; -else - mdp5_state->base.zpos =STAGE0 +drm_plane_index (plane); - mdp5_state->base.normalized_zpos = mdp5_state->base.zpos; -__drm_atomic_helper_plane_reset (plane, &mdp5_state->base); }
Signature · 1 line
2.34.1
PATCH 13/23 drm/nouveau/kms: Remove redundant zpos initialisation
In reply to Maxime RipardThe nouveau KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane purpose.
Since the initial value wasn't carried over in the state, the driver had to set it again in nv50_wndw_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/nouveau/dispnv50/wndw.c +0 -2
@@ -635,8 +635,6 @@ nv50_wndw_reset(struct drm_plane *plane) plane->funcs->atomic_destroy_state (plane, plane->state);__drm_atomic_helper_plane_reset (plane, &asyw->state); - plane->state->zpos =nv50_wndw_zpos_default (plane); - plane->state->normalized_zpos =nv50_wndw_zpos_default (plane); } static void
Signature · 1 line
2.34.1
PATCH 14/23 drm/omap: plane: Fix zpos initial value mismatch
In reply to Maxime RipardWhile the omap_plane_init() function calls drm_plane_create_zpos_property() with an initial value of 0, omap_plane_reset() will force it to another value depending on the plane type.
Fix the discrepancy by setting the initial zpos value to the same value in the drm_plane_create_zpos_property() call.
--- drivers/gpu/drm/omapdrm/omap_plane.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_plane.c +11 -1
@@ -533,6 +533,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,unsigned int num_planes =dispc_get_num_ovls (priv->dispc);struct drm_plane *plane;struct omap_plane *omap_plane; +unsigned int zpos;int ret;u32 nformats;const u32 *formats;
@@ -564,7 +565,16 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,drm_plane_helper_add (plane, &omap_plane_helper_funcs);omap_plane_install_properties (plane, &plane->base); -drm_plane_create_zpos_property (plane,0 ,0 , num_planes -1 ); + +/* +* Set the zpos default depending on whether we are a primary or overlay +* plane. +*/ +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) + zpos =0 ; +else + zpos = omap_plane->id; +drm_plane_create_zpos_property (plane, zpos,0 , num_planes -1 );drm_plane_create_alpha_property (plane);drm_plane_create_blend_mode_property (plane,BIT (DRM_MODE_BLEND_PREMULTI ) |BIT (DRM_MODE_BLEND_COVERAGE ));
Signature · 1 line
2.34.1
Re: [PATCH 14/23] drm/omap: plane: Fix zpos initial value mismatch
Quoted 34 lines · Maxime Ripard
While the
omap_plane_init()function callsdrm_plane_create_zpos_property()with an initial value of 0,omap_plane_reset()will force it to another value depending on the plane type.Fix the discrepancy by setting the initial zpos value to the same value in the
drm_plane_create_zpos_property()call.Cc Tomi Valkeinen <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/gpu/drm/omapdrm/omap_plane.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)drivers/gpu/drm/omapdrm/omap_plane.c +4
-1@@ -533,6 +533,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,unsigned int num_planes =dispc_get_num_ovls (priv->dispc);struct drm_plane *plane;struct omap_plane *omap_plane; +unsigned int zpos;int ret;u32 nformats;const u32 *formats;@@ -564,7 +565,16 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,drm_plane_helper_add (plane, &omap_plane_helper_funcs);omap_plane_install_properties (plane, &plane->base); -drm_plane_create_zpos_property (plane,0 ,0 , num_planes -1 ); + +/* +* Set the zpos default depending on whether we are a primary or overlay
drivers/gpu/drm/omapdrm/omap_plane.c struct drm_plane *omap_plane_init(struct drm_device *dev, · line 580
Quoted 10 lines
drivers/gpu/drm/omapdrm/omap_plane.c +7
-0+* plane. +*/ +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) + zpos =0 ; +else + zpos = omap_plane->id; +drm_plane_create_zpos_property (plane, zpos,0 , num_planes -1 );drm_plane_create_alpha_property (plane);drm_plane_create_blend_mode_property (plane,BIT (DRM_MODE_BLEND_PREMULTI ) |BIT (DRM_MODE_BLEND_COVERAGE ));
Tomi
PATCH 15/23 drm/omap: plane: Remove redundant zpos initialisation
In reply to Maxime RipardThe omap KMS driver will call drm_plane_create_zpos_property() with an init value of the plane index and the plane type.
Since the initial value wasn't carried over in the state, the driver had to set it again in omap_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/omapdrm/omap_plane.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/gpu/drm/omapdrm/omap_plane.c +0 -7
@@ -414,13 +414,6 @@ static void omap_plane_reset(struct drm_plane *plane)return ;__drm_atomic_helper_plane_reset (plane, &omap_state->base); - -/* -* Set the zpos default depending on whether we are a primary or overlay -* plane. -*/ - plane->state->zpos = plane->type ==DRM_PLANE_TYPE_PRIMARY - ?0 : omap_plane->id; plane->state->color_encoding =DRM_COLOR_YCBCR_BT601 ; plane->state->color_range =DRM_COLOR_YCBCR_FULL_RANGE ; }
Signature · 1 line
2.34.1
Re: [PATCH 15/23] drm/omap: plane: Remove redundant zpos initialisation
Quoted 21 lines · Maxime Ripard
The omap KMS driver will call
drm_plane_create_zpos_property()with an init value of the plane index and the plane type.Since the initial value wasn't carried over in the state, the driver had to set it again in
omap_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.Cc Tomi Valkeinen <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/gpu/drm/omapdrm/omap_plane.c | 7 ------- 1 file changed, 7 deletions(-)drivers/gpu/drm/omapdrm/omap_plane.c +0
-0@@ -414,13 +414,6 @@ static void omap_plane_reset(struct drm_plane *plane)return ;__drm_atomic_helper_plane_reset (plane, &omap_state->base);
drivers/gpu/drm/omapdrm/omap_plane.c static void omap_plane_reset(struct drm_plane *plane) · line 419
Quoted 10 lines
drivers/gpu/drm/omapdrm/omap_plane.c +0
-7- -/* -* Set the zpos default depending on whether we are a primary or overlay -* plane. -*/ - plane->state->zpos = plane->type ==DRM_PLANE_TYPE_PRIMARY - ?0 : omap_plane->id; plane->state->color_encoding =DRM_COLOR_YCBCR_BT601 ; plane->state->color_range =DRM_COLOR_YCBCR_FULL_RANGE ; }
Tomi
PATCH 16/23 drm/rcar: plane: Remove redundant zpos initialisation
In reply to Maxime RipardThe rcar-du KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane type.
Since the initial value wasn't carried over in the state, the driver had to set it again in rcar_du_plane_reset() and rcar_du_vsp_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 - 2 files changed, 2 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_plane.c +0 -1
@@ -696,7 +696,6 @@ static void rcar_du_plane_reset(struct drm_plane *plane) state->hwindex =-1 ; state->source =RCAR_DU_PLANE_MEMORY ; state->colorkey =RCAR_DU_COLORKEY_NONE ; - state->state.zpos = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 :1 ; } static int rcar_du_plane_atomic_set_property(struct drm_plane *plane,
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0 -1
@@ -362,7 +362,6 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane)return ;__drm_atomic_helper_plane_reset (plane, &state->state); - state->state.zpos = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 :1 ; }static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = {
Signature · 1 line
2.34.1
Re: [PATCH 16/23] drm/rcar: plane: Remove redundant zpos initialisation
Hello Maxime,
Thank you for the patch.
Quoted 8 lines · Maxime Ripard
The rcar-du KMS driver will call
drm_plane_create_zpos_property()with an init value depending on the plane type.Since the initial value wasn't carried over in the state, the driver had to set it again in
rcar_du_plane_reset()andrcar_du_vsp_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
Quoted 4 lines
Cc Kieran Bingham <[email protected]>Cc Laurent Pinchart <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 29 lines
--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 - 2 files changed, 2 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_plane.c +0
-1@@ -696,7 +696,6 @@ static void rcar_du_plane_reset(struct drm_plane *plane) state->hwindex =-1 ; state->source =RCAR_DU_PLANE_MEMORY ; state->colorkey =RCAR_DU_COLORKEY_NONE ; - state->state.zpos = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 :1 ; } static int rcar_du_plane_atomic_set_property(struct drm_plane *plane,drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0
-1@@ -362,7 +362,6 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane)return ;__drm_atomic_helper_plane_reset (plane, &state->state); - state->state.zpos = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 :1 ; }static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = {
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 16/23] drm/rcar: plane: Remove redundant zpos initialisation
In reply to Maxime RipardQuoting Maxime Ripard (2022-02-07 16:35:08)
Quoted 7 lines
The rcar-du KMS driver will call
drm_plane_create_zpos_property()with an init value depending on the plane type.Since the initial value wasn't carried over in the state, the driver had to set it again in
rcar_du_plane_reset()andrcar_du_vsp_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
Sounds helpful ;-)
Quoted 4 lines
Cc Kieran Bingham <[email protected]>Cc Laurent Pinchart <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 32 lines
--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 - 2 files changed, 2 deletions(-)drivers/gpu/drm/rcar-du/rcar_du_plane.c +0
-1@@ -696,7 +696,6 @@ static void rcar_du_plane_reset(struct drm_plane *plane) state->hwindex =-1 ; state->source =RCAR_DU_PLANE_MEMORY ; state->colorkey =RCAR_DU_COLORKEY_NONE ; - state->state.zpos = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 :1 ; } static int rcar_du_plane_atomic_set_property(struct drm_plane *plane,drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0
-1@@ -362,7 +362,6 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane)return ;__drm_atomic_helper_plane_reset (plane, &state->state); - state->state.zpos = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 :1 ; }static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = {Signature · 1 line
2.34.1
PATCH 17/23 drm/sti: plane: Remove redundant zpos initialisation
In reply to Maxime RipardThe sti KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane type.
Since the initial value wasn't carried over in the state, the driver had to set it again in sti_plane_reset() and rcar_du_vsp_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sti/sti_plane.c | 6 ------ drivers/gpu/drm/sti/sti_plane.h | 1 - 5 files changed, 3 insertions(+), 10 deletions(-)
drivers/gpu/drm/sti/sti_cursor.c +1 -1
@@ -351,7 +351,7 @@ static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_cursor_late_register,
drivers/gpu/drm/sti/sti_gdp.c +1 -1
@@ -905,7 +905,7 @@ static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_gdp_late_register,
drivers/gpu/drm/sti/sti_hqvdp.c +1 -1
@@ -1283,7 +1283,7 @@ static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_hqvdp_late_register,
drivers/gpu/drm/sti/sti_plane.c +0 -6
@@ -112,12 +112,6 @@ static int sti_plane_get_default_zpos(enum drm_plane_type type)return 0 ; } -void sti_plane_reset (struct drm_plane *plane) -{ -drm_atomic_helper_plane_reset (plane); - plane->state->zpos =sti_plane_get_default_zpos (plane->type); -} -static void sti_plane_attach_zorder_property (struct drm_plane *drm_plane,enum drm_plane_type type) {
drivers/gpu/drm/sti/sti_plane.h +0 -1
@@ -81,5 +81,4 @@ void sti_plane_update_fps(struct sti_plane *plane,void sti_plane_init_property (struct sti_plane *plane,enum drm_plane_type type); -void sti_plane_reset (struct drm_plane *plane);#endif
Signature · 1 line
2.34.1
Re: [PATCH 17/23] drm/sti: plane: Remove redundant zpos initialisation
Quoted 5 lines · Maxime Ripard
The sti KMS driver will call
drm_plane_create_zpos_property()with an init value depending on the plane type.Since the initial value wasn't carried over in the state, the driver had to set it again in
sti_plane_reset()andrcar_du_vsp_plane_reset().
Hi Maxime,
and many thanks for your patches.
Great you added Alain as he is now the drm/sti maintainer (Maintainers file should be updated soon)
Minor typo in the commit message as rcar_du_vsp_plane_reset() is not part of drm/sti
Philippe :-)
Quoted 80 lines
However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
Cc Alain Volmat <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sti/sti_plane.c | 6 ------ drivers/gpu/drm/sti/sti_plane.h | 1 - 5 files changed, 3 insertions(+), 10 deletions(-)drivers/gpu/drm/sti/sti_cursor.c +1
-1@@ -351,7 +351,7 @@ static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_cursor_late_register,drivers/gpu/drm/sti/sti_gdp.c +1
-1@@ -905,7 +905,7 @@ static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_gdp_late_register,drivers/gpu/drm/sti/sti_hqvdp.c +1
-1@@ -1283,7 +1283,7 @@ static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_hqvdp_late_register,drivers/gpu/drm/sti/sti_plane.c +0
-6@@ -112,12 +112,6 @@ static int sti_plane_get_default_zpos(enum drm_plane_type type)return 0 ; } -void sti_plane_reset (struct drm_plane *plane) -{ -drm_atomic_helper_plane_reset (plane); - plane->state->zpos =sti_plane_get_default_zpos (plane->type); -} -static void sti_plane_attach_zorder_property (struct drm_plane *drm_plane,enum drm_plane_type type) {drivers/gpu/drm/sti/sti_plane.h +0
-1@@ -81,5 +81,4 @@ void sti_plane_update_fps(struct sti_plane *plane,void sti_plane_init_property (struct sti_plane *plane,enum drm_plane_type type); -void sti_plane_reset (struct drm_plane *plane);#endif
Re: [PATCH 17/23] drm/sti: plane: Remove redundant zpos initialisation
In reply to Maxime RipardHi,
thanks for the patch.
Alain
Quoted 87 lines · Maxime Ripard
The sti KMS driver will call
drm_plane_create_zpos_property()with an init value depending on the plane type.Since the initial value wasn't carried over in the state, the driver had to set it again in
sti_plane_reset()andrcar_du_vsp_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.Cc Alain Volmat <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sti/sti_plane.c | 6 ------ drivers/gpu/drm/sti/sti_plane.h | 1 - 5 files changed, 3 insertions(+), 10 deletions(-)drivers/gpu/drm/sti/sti_cursor.c +1
-1@@ -351,7 +351,7 @@ static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_cursor_late_register,drivers/gpu/drm/sti/sti_gdp.c +1
-1@@ -905,7 +905,7 @@ static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_gdp_late_register,drivers/gpu/drm/sti/sti_hqvdp.c +1
-1@@ -1283,7 +1283,7 @@ static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, - .reset = sti_plane_reset, + .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .late_register = sti_hqvdp_late_register,drivers/gpu/drm/sti/sti_plane.c +0
-6@@ -112,12 +112,6 @@ static int sti_plane_get_default_zpos(enum drm_plane_type type)return 0 ; } -void sti_plane_reset (struct drm_plane *plane) -{ -drm_atomic_helper_plane_reset (plane); - plane->state->zpos =sti_plane_get_default_zpos (plane->type); -} -static void sti_plane_attach_zorder_property (struct drm_plane *drm_plane,enum drm_plane_type type) {drivers/gpu/drm/sti/sti_plane.h +0
-1@@ -81,5 +81,4 @@ void sti_plane_update_fps(struct sti_plane *plane,void sti_plane_init_property (struct sti_plane *plane,enum drm_plane_type type); -void sti_plane_reset (struct drm_plane *plane);#endif Signature · 1 line
2.34.1
PATCH 18/23 drm/sun4i: layer: Remove redundant zpos initialisation
In reply to Maxime RipardThe sun4i KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane type.
Since the initial value wasn't carried over in the state, the driver had to set it again in sun4i_backend_layer_reset().
However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/sun4i/sun4i_layer.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/gpu/drm/sun4i/sun4i_layer.c +7 -9
@@ -18,7 +18,6 @@static void sun4i_backend_layer_reset (struct drm_plane *plane) { -struct sun4i_layer *layer =plane_to_sun4i_layer (plane);struct sun4i_layer_state *state;if (plane->state) {
@@ -31,10 +30,8 @@ static void sun4i_backend_layer_reset(struct drm_plane *plane) } state =kzalloc (sizeof (*state),GFP_KERNEL ); -if (state) { +if (state)__drm_atomic_helper_plane_reset (plane, &state->state); - plane->state->zpos = layer->id; - } } static struct drm_plane_state *
@@ -192,7 +189,8 @@ static const uint64_t sun4i_layer_modifiers[] = {static struct sun4i_layer *sun4i_layer_init_one (struct drm_device *drm,struct sun4i_backend *backend, -enum drm_plane_type type) +enum drm_plane_type type, +unsigned int id) {const uint64_t *modifiers = sun4i_layer_modifiers;const uint32_t *formats = sun4i_layer_formats;
@@ -204,6 +202,7 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,if (!layer)return ERR_PTR (-ENOMEM ); + layer->id = id; layer->backend = backend;if (IS_ERR_OR_NULL (backend->frontend)) {
@@ -226,8 +225,8 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm, &sun4i_backend_layer_helper_funcs);drm_plane_create_alpha_property (&layer->plane); -drm_plane_create_zpos_property (&layer->plane,0 ,0 , -SUN4I_BACKEND_NUM_LAYERS -1 ); +drm_plane_create_zpos_property (&layer->plane, layer->id, +0 ,SUN4I_BACKEND_NUM_LAYERS -1 );return layer; }
@@ -249,14 +248,13 @@ struct drm_plane **sun4i_layers_init(struct drm_device *drm,enum drm_plane_type type = i ?DRM_PLANE_TYPE_OVERLAY :DRM_PLANE_TYPE_PRIMARY ;struct sun4i_layer *layer; - layer =sun4i_layer_init_one (drm, backend, type); + layer =sun4i_layer_init_one (drm, backend, type, i);if (IS_ERR (layer)) {dev_err (drm->dev,"Couldn't initialize %s plane\n" , i ?"overlay" :"primary" );return ERR_CAST (layer); } - layer->id = i; planes[i] = &layer->plane; }
Signature · 1 line
2.34.1
Re: [PATCH 18/23] drm/sun4i: layer: Remove redundant zpos initialisation
Hi Maxime,
Dne ponedeljek, 07. februar 2022 ob 17:35:10 CET je Maxime Ripard napisal(a):
Quoted 8 lines
The sun4i KMS driver will call
drm_plane_create_zpos_property()with an init value depending on the plane type.Since the initial value wasn't carried over in the state, the driver had to set it again in
sun4i_backend_layer_reset().
However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
Quoted 5 lines
Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Best regards,
Jernej
PATCH 19/23 drm/object: Add default color encoding and range value at reset
In reply to Maxime RipardFrom: Dave Stevenson <[email protected]>
The drm_plane_create_color_properties() function asks for an initial value for the color encoding and range, and will set the associated plane state variable with that value if a state is present.
However, that function is usually called at a time where there's no state yet. Since the drm_plane_state reset helper doesn't take care of reading that value when it's called, it means that in most cases the initial value will be 0 (so DRM_COLOR_YCBCR_BT601 and DRM_COLOR_YCBCR_LIMITED_RANGE, respectively), or the drivers will have to work around it.
Let's add some code in __drm_atomic_helper_plane_state_reset() to get the initial encoding and range value if the property has been attached in order to fix this.
--- drivers/gpu/drm/drm_atomic_state_helper.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/drm_atomic_state_helper.c +14 -0
@@ -251,6 +251,20 @@ void __drm_atomic_helper_plane_state_reset(struct drm_plane_state *plane_state, plane_state->alpha =DRM_BLEND_ALPHA_OPAQUE ; plane_state->pixel_blend_mode =DRM_MODE_BLEND_PREMULTI ; +if (plane->color_encoding_property) { +if (!drm_object_property_get_default_value (&plane->base, + plane->color_encoding_property, + &val)) + plane_state->color_encoding = val; + } + +if (plane->color_range_property) { +if (!drm_object_property_get_default_value (&plane->base, + plane->color_range_property, + &val)) + plane_state->color_range = val; + } + if (plane->zpos_property) { if (!drm_object_property_get_default_value(&plane->base, plane->zpos_property,
Signature · 1 line
2.34.1
Re: [PATCH 19/23] drm/object: Add default color encoding and range value at reset
Quoted 13 lines · Maxime Ripard
From: Dave Stevenson <[email protected]>
The
drm_plane_create_color_properties()function asks for an initial value for the color encoding and range, and will set the associated plane state variable with that value if a state is present.However, that function is usually called at a time where there's no state yet. Since the
drm_plane_statereset helper doesn't take care of reading that value when it's called, it means that in most cases the initial value will be 0 (soDRM_COLOR_YCBCR_BT601andDRM_COLOR_YCBCR_LIMITED_RANGE, respectively), or the drivers will have to work around it.
Quoted 6 lines
Let's add some code in
__drm_atomic_helper_plane_state_reset()to get the initial encoding and range value if the property has been attached in order to fix this.Signed-off-by Dave Stevenson <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Harry
Quoted 29 lines
--- drivers/gpu/drm/drm_atomic_state_helper.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/gpu/drm/drm_atomic_state_helper.c +14
-0@@ -251,6 +251,20 @@ void __drm_atomic_helper_plane_state_reset(struct drm_plane_state *plane_state, plane_state->alpha =DRM_BLEND_ALPHA_OPAQUE ; plane_state->pixel_blend_mode =DRM_MODE_BLEND_PREMULTI ; +if (plane->color_encoding_property) { +if (!drm_object_property_get_default_value (&plane->base, + plane->color_encoding_property, + &val)) + plane_state->color_encoding = val; + } + +if (plane->color_range_property) { +if (!drm_object_property_get_default_value (&plane->base, + plane->color_range_property, + &val)) + plane_state->color_range = val; + } + if (plane->zpos_property) { if (!drm_object_property_get_default_value(&plane->base, plane->zpos_property,
PATCH 20/23 drm/komeda: plane: Remove redundant color encoding and range initialisation
In reply to Maxime RipardThe komeda KMS driver will call drm_plane_create_color_properties() with a default encoding and range values of BT601 and Limited Range, respectively.
Since the initial value wasn't carried over in the state, the driver had to set it again in komeda_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_plane.c +1 -4
@@ -143,11 +143,8 @@ static void komeda_plane_reset(struct drm_plane *plane) plane->state =NULL ; state =kzalloc (sizeof (*state),GFP_KERNEL ); -if (state) { +if (state)__drm_atomic_helper_plane_reset (plane, &state->base); - state->base.color_encoding =DRM_COLOR_YCBCR_BT601 ; - state->base.color_range =DRM_COLOR_YCBCR_LIMITED_RANGE ; - } } static struct drm_plane_state *
Signature · 1 line
2.34.1
PATCH 21/23 drm/armada: overlay: Remove redundant color encoding and range initialisation
In reply to Maxime RipardThe armada KMS driver will call drm_plane_create_color_properties() with a default encoding and range values of BT601 and Limited Range, respectively.
Since the initial value wasn't carried over in the state, the driver had to set it again in armada_overlay_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/armada/armada_overlay.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/armada/armada_overlay.c +0 -2
@@ -325,8 +325,6 @@ static void armada_overlay_reset(struct drm_plane *plane) state->contrast =DEFAULT_CONTRAST ; state->saturation =DEFAULT_SATURATION ;__drm_atomic_helper_plane_reset (plane, &state->base.base); - state->base.base.color_encoding =DEFAULT_ENCODING ; - state->base.base.color_range =DRM_COLOR_YCBCR_LIMITED_RANGE ; } }
Signature · 1 line
2.34.1
PATCH 22/23 drm/imx: ipuv3-plane: Remove redundant color encoding and range initialisation
In reply to Maxime RipardThe imx KMS driver will call drm_plane_create_color_properties() with a default encoding and range values of BT601 and Limited Range, respectively.
Since the initial value wasn't carried over in the state, the driver had to set it again in ipu_plane_state_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/imx/ipuv3-plane.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/imx/ipuv3-plane.c +1 -4
@@ -308,11 +308,8 @@ static void ipu_plane_state_reset(struct drm_plane *plane) ipu_state =kzalloc (sizeof (*ipu_state),GFP_KERNEL ); -if (ipu_state) { +if (ipu_state)__drm_atomic_helper_plane_reset (plane, &ipu_state->base); - ipu_state->base.color_encoding =DRM_COLOR_YCBCR_BT601 ; - ipu_state->base.color_range =DRM_COLOR_YCBCR_LIMITED_RANGE ; - } } static struct drm_plane_state *
Signature · 1 line
2.34.1
PATCH 23/23 drm/omap: plane: Remove redundant color encoding and range initialisation
In reply to Maxime RipardThe omap KMS driver will call drm_plane_create_color_properties() with a default encoding and range values of BT601 and Full Range, respectively.
Since the initial value wasn't carried over in the state, the driver had to set it again in omap_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.
--- drivers/gpu/drm/omapdrm/omap_plane.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/omapdrm/omap_plane.c +0 -3
@@ -403,7 +403,6 @@ void omap_plane_install_properties(struct drm_plane *plane,static void omap_plane_reset (struct drm_plane *plane) { -struct omap_plane *omap_plane =to_omap_plane (plane);struct omap_plane_state *omap_state;if (plane->state)
@@ -414,8 +413,6 @@ static void omap_plane_reset(struct drm_plane *plane)return ;__drm_atomic_helper_plane_reset (plane, &omap_state->base); - plane->state->color_encoding =DRM_COLOR_YCBCR_BT601 ; - plane->state->color_range =DRM_COLOR_YCBCR_FULL_RANGE ; } static struct drm_plane_state *
Signature · 1 line
2.34.1
Re: [PATCH 23/23] drm/omap: plane: Remove redundant color encoding and range initialisation
Quoted 27 lines · Maxime Ripard
The omap KMS driver will call
drm_plane_create_color_properties()with a default encoding and range values of BT601 and Full Range, respectively.Since the initial value wasn't carried over in the state, the driver had to set it again in
omap_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore.Cc Tomi Valkeinen <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/gpu/drm/omapdrm/omap_plane.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/omapdrm/omap_plane.c +0
-1@@ -403,7 +403,6 @@ void omap_plane_install_properties(struct drm_plane *plane,static void omap_plane_reset (struct drm_plane *plane) { -struct omap_plane *omap_plane =to_omap_plane (plane);struct omap_plane_state *omap_state;if (plane->state)
drivers/gpu/drm/omapdrm/omap_plane.c static void omap_plane_reset(struct drm_plane *plane) · line 418
Quoted 8 lines
drivers/gpu/drm/omapdrm/omap_plane.c +0
-2@@ -414,8 +413,6 @@ static void omap_plane_reset(struct drm_plane *plane)return ;__drm_atomic_helper_plane_reset (plane, &omap_state->base); - plane->state->color_encoding =DRM_COLOR_YCBCR_BT601 ; - plane->state->color_range =DRM_COLOR_YCBCR_FULL_RANGE ; } static struct drm_plane_state *
Tomi