diff mbox

[v2] drm/atomic: Don't set crtc_state->enable manually

Message ID 1434969466-25615-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart June 22, 2015, 10:37 a.m. UTC
The enable field needs to be kept in sync with the mode_blob field. Call
drm_atomic_set_mode_prop_for_crtc() instead of setting enable to false
in order to dereference the mode blob correctly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Changes since v1:

- Check the return value of drm_atomic_set_mode_prop_for_crtc()
- Drop the num_connectors local variable

Comments

Daniel Vetter June 22, 2015, 11:47 a.m. UTC | #1
On Mon, Jun 22, 2015 at 01:37:46PM +0300, Laurent Pinchart wrote:
> The enable field needs to be kept in sync with the mode_blob field. Call
> drm_atomic_set_mode_prop_for_crtc() instead of setting enable to false
> in order to dereference the mode blob correctly.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> Changes since v1:
> 
> - Check the return value of drm_atomic_set_mode_prop_for_crtc()
> - Drop the num_connectors local variable

Random process bikeshed: I'm one of the kernel maintainers who prefers to
keep the per-patch changelog (since often submitters fail to reflect all
the discussion properly in the commit message itself).

Fixed that and applied your patch to drm-misc, thanks.
-Daniel

> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 536ae4da4665..ec3d65a497ac 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1561,10 +1561,14 @@ static int update_output_state(struct drm_atomic_state *state,
>  		if (crtc == set->crtc)
>  			continue;
>  
> -		crtc_state->enable =
> -			drm_atomic_connectors_for_crtc(state, crtc);
> -		if (!crtc_state->enable)
> +		if (!drm_atomic_connectors_for_crtc(state, crtc)) {
> +			ret = drm_atomic_set_mode_prop_for_crtc(crtc_state,
> +								NULL);
> +			if (ret < 0)
> +				return ret;
> +
>  			crtc_state->active = false;
> +		}
>  	}
>  
>  	return 0;
> -- 
> Regards,
> 
> Laurent Pinchart
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 536ae4da4665..ec3d65a497ac 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1561,10 +1561,14 @@  static int update_output_state(struct drm_atomic_state *state,
 		if (crtc == set->crtc)
 			continue;
 
-		crtc_state->enable =
-			drm_atomic_connectors_for_crtc(state, crtc);
-		if (!crtc_state->enable)
+		if (!drm_atomic_connectors_for_crtc(state, crtc)) {
+			ret = drm_atomic_set_mode_prop_for_crtc(crtc_state,
+								NULL);
+			if (ret < 0)
+				return ret;
+
 			crtc_state->active = false;
+		}
 	}
 
 	return 0;