diff mbox

[v4.1,01/9] drm/atomic: Handle aspect ratio and scaling mode in core, v2.

Message ID 1492074937-4774-1-git-send-email-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst April 13, 2017, 9:15 a.m. UTC
This is required to for i915 to convert connector properties to atomic.

Changes since v1:
- Add docbook info. (danvet)
- Change picture_aspect_ratio to enum hdmi_picture_aspect.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Acked-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_atomic.c |  8 ++++++++
 include/drm/drm_connector.h  | 16 ++++++++++++++++
 2 files changed, 24 insertions(+)

Comments

Daniel Vetter April 19, 2017, 3:43 p.m. UTC | #1
On Thu, Apr 13, 2017 at 11:15:37AM +0200, Maarten Lankhorst wrote:
> This is required to for i915 to convert connector properties to atomic.
> 
> Changes since v1:
> - Add docbook info. (danvet)
> - Change picture_aspect_ratio to enum hdmi_picture_aspect.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: dri-devel@lists.freedesktop.org
> Acked-by: Dave Airlie <airlied@redhat.com>
> ---
>  drivers/gpu/drm/drm_atomic.c |  8 ++++++++
>  include/drm/drm_connector.h  | 16 ++++++++++++++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 30229ab719c0..25ea6f797a54 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1123,6 +1123,10 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,
>  		 */
>  		if (state->link_status != DRM_LINK_STATUS_GOOD)
>  			state->link_status = val;
> +	} else if (property == config->aspect_ratio_property) {
> +		state->picture_aspect_ratio = val;
> +	} else if (property == config->scaling_mode_property) {
> +		state->scaling_mode = val;
>  	} else if (connector->funcs->atomic_set_property) {
>  		return connector->funcs->atomic_set_property(connector,
>  				state, property, val);
> @@ -1199,6 +1203,10 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
>  		*val = state->tv.hue;
>  	} else if (property == config->link_status_property) {
>  		*val = state->link_status;
> +	} else if (property == config->aspect_ratio_property) {
> +		*val = state->picture_aspect_ratio;
> +	} else if (property == config->scaling_mode_property) {
> +		*val = state->scaling_mode;
>  	} else if (connector->funcs->atomic_get_property) {
>  		return connector->funcs->atomic_get_property(connector,
>  				state, property, val);
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 4eeda120e46d..5b50bc2db6fb 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -25,6 +25,7 @@
>  
>  #include <linux/list.h>
>  #include <linux/ctype.h>
> +#include <linux/hdmi.h>
>  #include <drm/drm_mode_object.h>
>  
>  #include <uapi/drm/drm_mode.h>
> @@ -326,6 +327,21 @@ struct drm_connector_state {
>  	struct drm_atomic_state *state;
>  
>  	struct drm_tv_connector_state tv;
> +
> +	/**
> +	 * @picture_aspect_ratio: Connector property to control the
> +	 * HDMI infoframe aspect ratio setting.
> +	 *
> +	 * The DRM_MODE_PICTURE_ASPECT_* values much match the

I think the above will upset sphinx and spew a warning, you need
ASPECT_\* or something like that. Or just spell them out and enumerate
them all. Fixed either way this is

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> +	 * values for &enum hdmi_picture_aspect
> +	 */
> +	enum hdmi_picture_aspect picture_aspect_ratio;
> +
> +	/**
> +	 * @scaling_mode: Connector property to control the
> +	 * upscaling, mostly used for built-in panels.
> +	 */
> +	unsigned int scaling_mode;
>  };
>  
>  /**
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst April 24, 2017, 12:01 p.m. UTC | #2
On 19-04-17 17:43, Daniel Vetter wrote:
> On Thu, Apr 13, 2017 at 11:15:37AM +0200, Maarten Lankhorst wrote:
>> This is required to for i915 to convert connector properties to atomic.
>>
>> Changes since v1:
>> - Add docbook info. (danvet)
>> - Change picture_aspect_ratio to enum hdmi_picture_aspect.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Cc: dri-devel@lists.freedesktop.org
>> Acked-by: Dave Airlie <airlied@redhat.com>
>> ---
>>  drivers/gpu/drm/drm_atomic.c |  8 ++++++++
>>  include/drm/drm_connector.h  | 16 ++++++++++++++++
>>  2 files changed, 24 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
>> index 30229ab719c0..25ea6f797a54 100644
>> --- a/drivers/gpu/drm/drm_atomic.c
>> +++ b/drivers/gpu/drm/drm_atomic.c
>> @@ -1123,6 +1123,10 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,
>>  		 */
>>  		if (state->link_status != DRM_LINK_STATUS_GOOD)
>>  			state->link_status = val;
>> +	} else if (property == config->aspect_ratio_property) {
>> +		state->picture_aspect_ratio = val;
>> +	} else if (property == config->scaling_mode_property) {
>> +		state->scaling_mode = val;
>>  	} else if (connector->funcs->atomic_set_property) {
>>  		return connector->funcs->atomic_set_property(connector,
>>  				state, property, val);
>> @@ -1199,6 +1203,10 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
>>  		*val = state->tv.hue;
>>  	} else if (property == config->link_status_property) {
>>  		*val = state->link_status;
>> +	} else if (property == config->aspect_ratio_property) {
>> +		*val = state->picture_aspect_ratio;
>> +	} else if (property == config->scaling_mode_property) {
>> +		*val = state->scaling_mode;
>>  	} else if (connector->funcs->atomic_get_property) {
>>  		return connector->funcs->atomic_get_property(connector,
>>  				state, property, val);
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index 4eeda120e46d..5b50bc2db6fb 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -25,6 +25,7 @@
>>  
>>  #include <linux/list.h>
>>  #include <linux/ctype.h>
>> +#include <linux/hdmi.h>
>>  #include <drm/drm_mode_object.h>
>>  
>>  #include <uapi/drm/drm_mode.h>
>> @@ -326,6 +327,21 @@ struct drm_connector_state {
>>  	struct drm_atomic_state *state;
>>  
>>  	struct drm_tv_connector_state tv;
>> +
>> +	/**
>> +	 * @picture_aspect_ratio: Connector property to control the
>> +	 * HDMI infoframe aspect ratio setting.
>> +	 *
>> +	 * The DRM_MODE_PICTURE_ASPECT_* values much match the
> I think the above will upset sphinx and spew a warning, you need
> ASPECT_\* or something like that. Or just spell them out and enumerate
> them all. Fixed either way this is
I checked and make htmldocs worked just fine, but I'll quote the *.

Thanks,
Maarten
Daniel Vetter May 2, 2017, 8:12 a.m. UTC | #3
On Mon, Apr 24, 2017 at 02:01:05PM +0200, Maarten Lankhorst wrote:
> On 19-04-17 17:43, Daniel Vetter wrote:
> > On Thu, Apr 13, 2017 at 11:15:37AM +0200, Maarten Lankhorst wrote:
> >> This is required to for i915 to convert connector properties to atomic.
> >>
> >> Changes since v1:
> >> - Add docbook info. (danvet)
> >> - Change picture_aspect_ratio to enum hdmi_picture_aspect.
> >>
> >> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> >> Cc: dri-devel@lists.freedesktop.org
> >> Acked-by: Dave Airlie <airlied@redhat.com>
> >> ---
> >>  drivers/gpu/drm/drm_atomic.c |  8 ++++++++
> >>  include/drm/drm_connector.h  | 16 ++++++++++++++++
> >>  2 files changed, 24 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> >> index 30229ab719c0..25ea6f797a54 100644
> >> --- a/drivers/gpu/drm/drm_atomic.c
> >> +++ b/drivers/gpu/drm/drm_atomic.c
> >> @@ -1123,6 +1123,10 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,
> >>  		 */
> >>  		if (state->link_status != DRM_LINK_STATUS_GOOD)
> >>  			state->link_status = val;
> >> +	} else if (property == config->aspect_ratio_property) {
> >> +		state->picture_aspect_ratio = val;
> >> +	} else if (property == config->scaling_mode_property) {
> >> +		state->scaling_mode = val;
> >>  	} else if (connector->funcs->atomic_set_property) {
> >>  		return connector->funcs->atomic_set_property(connector,
> >>  				state, property, val);
> >> @@ -1199,6 +1203,10 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
> >>  		*val = state->tv.hue;
> >>  	} else if (property == config->link_status_property) {
> >>  		*val = state->link_status;
> >> +	} else if (property == config->aspect_ratio_property) {
> >> +		*val = state->picture_aspect_ratio;
> >> +	} else if (property == config->scaling_mode_property) {
> >> +		*val = state->scaling_mode;
> >>  	} else if (connector->funcs->atomic_get_property) {
> >>  		return connector->funcs->atomic_get_property(connector,
> >>  				state, property, val);
> >> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> >> index 4eeda120e46d..5b50bc2db6fb 100644
> >> --- a/include/drm/drm_connector.h
> >> +++ b/include/drm/drm_connector.h
> >> @@ -25,6 +25,7 @@
> >>  
> >>  #include <linux/list.h>
> >>  #include <linux/ctype.h>
> >> +#include <linux/hdmi.h>
> >>  #include <drm/drm_mode_object.h>
> >>  
> >>  #include <uapi/drm/drm_mode.h>
> >> @@ -326,6 +327,21 @@ struct drm_connector_state {
> >>  	struct drm_atomic_state *state;
> >>  
> >>  	struct drm_tv_connector_state tv;
> >> +
> >> +	/**
> >> +	 * @picture_aspect_ratio: Connector property to control the
> >> +	 * HDMI infoframe aspect ratio setting.
> >> +	 *
> >> +	 * The DRM_MODE_PICTURE_ASPECT_* values much match the
> > I think the above will upset sphinx and spew a warning, you need
> > ASPECT_\* or something like that. Or just spell them out and enumerate
> > them all. Fixed either way this is
> I checked and make htmldocs worked just fine, but I'll quote the *.

I meant inspecting the visual output ... Without the * escaped iirc you
can end up with the entire paragraph bold.
-Daniel
Maarten Lankhorst May 2, 2017, 8:17 a.m. UTC | #4
Op 02-05-17 om 10:12 schreef Daniel Vetter:
> On Mon, Apr 24, 2017 at 02:01:05PM +0200, Maarten Lankhorst wrote:
>> On 19-04-17 17:43, Daniel Vetter wrote:
>>> On Thu, Apr 13, 2017 at 11:15:37AM +0200, Maarten Lankhorst wrote:
>>>> This is required to for i915 to convert connector properties to atomic.
>>>>
>>>> Changes since v1:
>>>> - Add docbook info. (danvet)
>>>> - Change picture_aspect_ratio to enum hdmi_picture_aspect.
>>>>
>>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>>> Cc: dri-devel@lists.freedesktop.org
>>>> Acked-by: Dave Airlie <airlied@redhat.com>
>>>> ---
>>>>  drivers/gpu/drm/drm_atomic.c |  8 ++++++++
>>>>  include/drm/drm_connector.h  | 16 ++++++++++++++++
>>>>  2 files changed, 24 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
>>>> index 30229ab719c0..25ea6f797a54 100644
>>>> --- a/drivers/gpu/drm/drm_atomic.c
>>>> +++ b/drivers/gpu/drm/drm_atomic.c
>>>> @@ -1123,6 +1123,10 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,
>>>>  		 */
>>>>  		if (state->link_status != DRM_LINK_STATUS_GOOD)
>>>>  			state->link_status = val;
>>>> +	} else if (property == config->aspect_ratio_property) {
>>>> +		state->picture_aspect_ratio = val;
>>>> +	} else if (property == config->scaling_mode_property) {
>>>> +		state->scaling_mode = val;
>>>>  	} else if (connector->funcs->atomic_set_property) {
>>>>  		return connector->funcs->atomic_set_property(connector,
>>>>  				state, property, val);
>>>> @@ -1199,6 +1203,10 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
>>>>  		*val = state->tv.hue;
>>>>  	} else if (property == config->link_status_property) {
>>>>  		*val = state->link_status;
>>>> +	} else if (property == config->aspect_ratio_property) {
>>>> +		*val = state->picture_aspect_ratio;
>>>> +	} else if (property == config->scaling_mode_property) {
>>>> +		*val = state->scaling_mode;
>>>>  	} else if (connector->funcs->atomic_get_property) {
>>>>  		return connector->funcs->atomic_get_property(connector,
>>>>  				state, property, val);
>>>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>>>> index 4eeda120e46d..5b50bc2db6fb 100644
>>>> --- a/include/drm/drm_connector.h
>>>> +++ b/include/drm/drm_connector.h
>>>> @@ -25,6 +25,7 @@
>>>>  
>>>>  #include <linux/list.h>
>>>>  #include <linux/ctype.h>
>>>> +#include <linux/hdmi.h>
>>>>  #include <drm/drm_mode_object.h>
>>>>  
>>>>  #include <uapi/drm/drm_mode.h>
>>>> @@ -326,6 +327,21 @@ struct drm_connector_state {
>>>>  	struct drm_atomic_state *state;
>>>>  
>>>>  	struct drm_tv_connector_state tv;
>>>> +
>>>> +	/**
>>>> +	 * @picture_aspect_ratio: Connector property to control the
>>>> +	 * HDMI infoframe aspect ratio setting.
>>>> +	 *
>>>> +	 * The DRM_MODE_PICTURE_ASPECT_* values much match the
>>> I think the above will upset sphinx and spew a warning, you need
>>> ASPECT_\* or something like that. Or just spell them out and enumerate
>>> them all. Fixed either way this is
>> I checked and make htmldocs worked just fine, but I'll quote the *.
> I meant inspecting the visual output ... Without the * escaped iirc you
> can end up with the entire paragraph bold.
> -Daniel

Yeah either way worked though for the html documentation, at least when I checked it locally. But it didn't complain either option so v5 and v6 use \*.


~Maarten
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 30229ab719c0..25ea6f797a54 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1123,6 +1123,10 @@  int drm_atomic_connector_set_property(struct drm_connector *connector,
 		 */
 		if (state->link_status != DRM_LINK_STATUS_GOOD)
 			state->link_status = val;
+	} else if (property == config->aspect_ratio_property) {
+		state->picture_aspect_ratio = val;
+	} else if (property == config->scaling_mode_property) {
+		state->scaling_mode = val;
 	} else if (connector->funcs->atomic_set_property) {
 		return connector->funcs->atomic_set_property(connector,
 				state, property, val);
@@ -1199,6 +1203,10 @@  drm_atomic_connector_get_property(struct drm_connector *connector,
 		*val = state->tv.hue;
 	} else if (property == config->link_status_property) {
 		*val = state->link_status;
+	} else if (property == config->aspect_ratio_property) {
+		*val = state->picture_aspect_ratio;
+	} else if (property == config->scaling_mode_property) {
+		*val = state->scaling_mode;
 	} else if (connector->funcs->atomic_get_property) {
 		return connector->funcs->atomic_get_property(connector,
 				state, property, val);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 4eeda120e46d..5b50bc2db6fb 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -25,6 +25,7 @@ 
 
 #include <linux/list.h>
 #include <linux/ctype.h>
+#include <linux/hdmi.h>
 #include <drm/drm_mode_object.h>
 
 #include <uapi/drm/drm_mode.h>
@@ -326,6 +327,21 @@  struct drm_connector_state {
 	struct drm_atomic_state *state;
 
 	struct drm_tv_connector_state tv;
+
+	/**
+	 * @picture_aspect_ratio: Connector property to control the
+	 * HDMI infoframe aspect ratio setting.
+	 *
+	 * The DRM_MODE_PICTURE_ASPECT_* values much match the
+	 * values for &enum hdmi_picture_aspect
+	 */
+	enum hdmi_picture_aspect picture_aspect_ratio;
+
+	/**
+	 * @scaling_mode: Connector property to control the
+	 * upscaling, mostly used for built-in panels.
+	 */
+	unsigned int scaling_mode;
 };
 
 /**