diff mbox series

[2/2] drm/i915: Enable RGB565 90/270 plane rotation for gen11 onwards.

Message ID 1535373473-3594-3-git-send-email-juhapekka.heikkila@gmail.com (mailing list archive)
State New, archived
Headers show
Series Enable RGB565 rotation from gen11 onwards | expand

Commit Message

Juha-Pekka Heikkila Aug. 27, 2018, 12:37 p.m. UTC
From gen11 onwards RGB565 90/270 plane rotation is supported on hardware.

IGT: https://patchwork.freedesktop.org/series/48756/
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 drivers/gpu/drm/i915/intel_atomic_plane.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Ville Syrjälä Sept. 5, 2018, 2:58 p.m. UTC | #1
On Mon, Aug 27, 2018 at 03:37:53PM +0300, Juha-Pekka Heikkila wrote:
> From gen11 onwards RGB565 90/270 plane rotation is supported on hardware.
> 
> IGT: https://patchwork.freedesktop.org/series/48756/
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
>  drivers/gpu/drm/i915/intel_atomic_plane.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
> index 344a16b..c245906 100644
> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
> @@ -123,14 +123,17 @@ static bool intel_plane_valid_rotation(const struct drm_plane_state *plane_state
>  		}
>  
>  		/*
> -		 * 90/270 is not allowed with RGB64 16:16:16:16,
> -		 * RGB 16-bit 5:6:5, and Indexed 8-bit.
> +		 * 90/270 is not allowed with RGB64 16:16:16:16 and
> +		 * Indexed 8-bit. RGB 16-bit. 5:6:5 is allowed gen11 onwards.
                                            ^
Extra period there

Otherwise lgtm
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  		 * TBD: Add RGB64 case once its added in supported format
>  		 * list.
>  		 */
>  		switch (plane_state->fb->format->format) {
> -		case DRM_FORMAT_C8:
>  		case DRM_FORMAT_RGB565:
> +			if (INTEL_GEN(dev_priv) >= 11)
> +				break;
> +			/* fall through */
> +		case DRM_FORMAT_C8:
>  			DRM_DEBUG_KMS("Unsupported pixel format %s for 90/270!\n",
>  				      drm_get_format_name(plane_state->fb->format->format,
>  							  &format_name));
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst Sept. 25, 2018, 1:35 p.m. UTC | #2
Op 05-09-18 om 16:58 schreef Ville Syrjälä:
> On Mon, Aug 27, 2018 at 03:37:53PM +0300, Juha-Pekka Heikkila wrote:
>> From gen11 onwards RGB565 90/270 plane rotation is supported on hardware.
>>
>> IGT: https://patchwork.freedesktop.org/series/48756/
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
>> ---
>>  drivers/gpu/drm/i915/intel_atomic_plane.c | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
>> index 344a16b..c245906 100644
>> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
>> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
>> @@ -123,14 +123,17 @@ static bool intel_plane_valid_rotation(const struct drm_plane_state *plane_state
>>  		}
>>  
>>  		/*
>> -		 * 90/270 is not allowed with RGB64 16:16:16:16,
>> -		 * RGB 16-bit 5:6:5, and Indexed 8-bit.
>> +		 * 90/270 is not allowed with RGB64 16:16:16:16 and
>> +		 * Indexed 8-bit. RGB 16-bit. 5:6:5 is allowed gen11 onwards.
>                                             ^
> Extra period there
>
> Otherwise lgtm
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Thanks, pushed.

Patch 1/2 is dropped because of other cleanups superceeding it, and had to rebase patch 2/2 to apply. All should be well now. :)

~Maarten
Juha-Pekka Heikkila Sept. 25, 2018, 2:38 p.m. UTC | #3
On 25.09.2018 16:35, Maarten Lankhorst wrote:
> Op 05-09-18 om 16:58 schreef Ville Syrjälä:
>> On Mon, Aug 27, 2018 at 03:37:53PM +0300, Juha-Pekka Heikkila wrote:
>>>  From gen11 onwards RGB565 90/270 plane rotation is supported on hardware.
>>>
>>> IGT: https://patchwork.freedesktop.org/series/48756/
>>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
>>> ---
>>>   drivers/gpu/drm/i915/intel_atomic_plane.c | 9 ++++++---
>>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
>>> index 344a16b..c245906 100644
>>> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
>>> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
>>> @@ -123,14 +123,17 @@ static bool intel_plane_valid_rotation(const struct drm_plane_state *plane_state
>>>   		}
>>>   
>>>   		/*
>>> -		 * 90/270 is not allowed with RGB64 16:16:16:16,
>>> -		 * RGB 16-bit 5:6:5, and Indexed 8-bit.
>>> +		 * 90/270 is not allowed with RGB64 16:16:16:16 and
>>> +		 * Indexed 8-bit. RGB 16-bit. 5:6:5 is allowed gen11 onwards.
>>                                              ^
>> Extra period there
>>
>> Otherwise lgtm
>> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Thanks, pushed.
> 
> Patch 1/2 is dropped because of other cleanups superceeding it, and had to rebase patch 2/2 to apply. All should be well now. :)
> 

Ok, thank you :)

/Juha-Pekka
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 344a16b..c245906 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -123,14 +123,17 @@  static bool intel_plane_valid_rotation(const struct drm_plane_state *plane_state
 		}
 
 		/*
-		 * 90/270 is not allowed with RGB64 16:16:16:16,
-		 * RGB 16-bit 5:6:5, and Indexed 8-bit.
+		 * 90/270 is not allowed with RGB64 16:16:16:16 and
+		 * Indexed 8-bit. RGB 16-bit. 5:6:5 is allowed gen11 onwards.
 		 * TBD: Add RGB64 case once its added in supported format
 		 * list.
 		 */
 		switch (plane_state->fb->format->format) {
-		case DRM_FORMAT_C8:
 		case DRM_FORMAT_RGB565:
+			if (INTEL_GEN(dev_priv) >= 11)
+				break;
+			/* fall through */
+		case DRM_FORMAT_C8:
 			DRM_DEBUG_KMS("Unsupported pixel format %s for 90/270!\n",
 				      drm_get_format_name(plane_state->fb->format->format,
 							  &format_name));