[Intel-gfx] [PATCH 1/3] drm/i915: Convert intel_tv connector properties to atomic, v2.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Wed Mar 15 08:32:57 UTC 2017


Op 14-03-17 om 19:36 schreef Ville Syrjälä:
> On Mon, Mar 13, 2017 at 05:10:28PM +0100, Maarten Lankhorst wrote:
>> As a proof of concept, first try to convert intel_tv, which is a rarely
>> used connector. It has 5 properties, tv format and 4 margins.
>>
>> I'm less certain about the state behavior itself, should we pass a size
>> parameter to intel_connector_alloc instead, so duplicate_state
>> can be done globally if it can be blindly copied?
>>
>> Can we also have a atomic_check function for connectors, so the
>> crtc_state->connectors_changed can be set there? It would be cleaner
>> and more atomic-like.
>>
>> To match the legacy behavior, format can be changed by probing just like
>> in legacy mode.
>>
>> Changes since v1:
>> - Add intel_encoder->swap_state to allow updating connector state.
>> - Add intel_tv->format for detect_mode and mode_valid, updated on atomic commit.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_display.c |  15 ++
>>  drivers/gpu/drm/i915/intel_drv.h     |   4 +
>>  drivers/gpu/drm/i915/intel_tv.c      | 259 +++++++++++++++++++++--------------
>>  3 files changed, 176 insertions(+), 102 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index ac25c9bc8b81..18b7e7546ee1 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
> <snip>
>> +
>> +static int
>> +intel_tv_atomic_get_property(struct drm_connector *connector,
>> +				    const struct drm_connector_state *state,
>> +				    struct drm_property *property,
>> +				    uint64_t *val)
>> +{
>> +	struct drm_device *dev = connector->dev;
>> +	struct intel_tv_connector_state *tv_state =
>> +		to_intel_tv_connector_state(state);
>> +
>> +	if (property == dev->mode_config.tv_left_margin_property)
>> +		*val = tv_state->margin[TV_MARGIN_LEFT];
>> +	else if (property == dev->mode_config.tv_right_margin_property)
>> +		*val = tv_state->margin[TV_MARGIN_RIGHT];
>> +	else if (property == dev->mode_config.tv_top_margin_property)
>> +		*val = tv_state->margin[TV_MARGIN_TOP];
>> +	else if (property == dev->mode_config.tv_bottom_margin_property)
>> +		*val = tv_state->margin[TV_MARGIN_BOTTOM];
>> +	else if (property == dev->mode_config.tv_mode_property) {
>> +		*val = tv_state->format;
> Actually, aren't all of these handled by drm_atomic_connector_set_property()
> already?
>
> And same deal with drm_atomic_connector_get_property() AFAICS.
Argh, indeed. Thanks for noticing.. That should reduce the amount of boilerplate.

Is there hw for doing actual testing on the tv connector? If I actually tested this on real hw I would have noticed this.

~Maarten


More information about the Intel-gfx mailing list