[6/9] drm/i915: Sort format arrays consistently
diff mbox series

Message ID 20191008161441.12721-6-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • [1/9] drm/i915: Expose 10:10:10 XRGB formats on SNB-BDW sprites
Related show

Commit Message

Ville Syrjälä Oct. 8, 2019, 4:14 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Let's try to keep the pixel format arrays somewhat sorted:
1. RGB before YUV
2. smaller bpp before larger bpp
3. X before A
4. RGB before BGR

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c |  2 +-
 drivers/gpu/drm/i915/display/intel_sprite.c  | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

Comments

Juha-Pekka Heikkila Oct. 27, 2019, 8:53 p.m. UTC | #1
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

On 8.10.2019 19.14, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Let's try to keep the pixel format arrays somewhat sorted:
> 1. RGB before YUV
> 2. smaller bpp before larger bpp
> 3. X before A
> 4. RGB before BGR
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_display.c |  2 +-
>   drivers/gpu/drm/i915/display/intel_sprite.c  | 20 ++++++++++----------
>   2 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 1cdcd0ea0564..a8124f01bdb2 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -83,8 +83,8 @@
>   /* Primary plane formats for gen <= 3 */
>   static const u32 i8xx_primary_formats[] = {
>   	DRM_FORMAT_C8,
> -	DRM_FORMAT_RGB565,
>   	DRM_FORMAT_XRGB1555,
> +	DRM_FORMAT_RGB565,
>   	DRM_FORMAT_XRGB8888,
>   };
>   
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> index aaabeaf11ae9..cc9e5c9668b1 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -2002,10 +2002,10 @@ static const u64 i9xx_plane_format_modifiers[] = {
>   };
>   
>   static const u32 snb_plane_formats[] = {
> -	DRM_FORMAT_XBGR8888,
>   	DRM_FORMAT_XRGB8888,
> -	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_XBGR8888,
>   	DRM_FORMAT_XBGR2101010,
> +	DRM_FORMAT_XRGB2101010,
>   	DRM_FORMAT_YUYV,
>   	DRM_FORMAT_YVYU,
>   	DRM_FORMAT_UYVY,
> @@ -2015,10 +2015,10 @@ static const u32 snb_plane_formats[] = {
>   static const u32 vlv_plane_formats[] = {
>   	DRM_FORMAT_C8,
>   	DRM_FORMAT_RGB565,
> -	DRM_FORMAT_ABGR8888,
> -	DRM_FORMAT_ARGB8888,
> -	DRM_FORMAT_XBGR8888,
>   	DRM_FORMAT_XRGB8888,
> +	DRM_FORMAT_XBGR8888,
> +	DRM_FORMAT_ARGB8888,
> +	DRM_FORMAT_ABGR8888,
>   	DRM_FORMAT_XBGR2101010,
>   	DRM_FORMAT_ABGR2101010,
>   	DRM_FORMAT_YUYV,
> @@ -2030,14 +2030,14 @@ static const u32 vlv_plane_formats[] = {
>   static const u32 chv_pipe_b_sprite_formats[] = {
>   	DRM_FORMAT_C8,
>   	DRM_FORMAT_RGB565,
> -	DRM_FORMAT_ABGR8888,
> -	DRM_FORMAT_ARGB8888,
> -	DRM_FORMAT_XBGR8888,
>   	DRM_FORMAT_XRGB8888,
> -	DRM_FORMAT_XBGR2101010,
> -	DRM_FORMAT_ABGR2101010,
> +	DRM_FORMAT_XBGR8888,
> +	DRM_FORMAT_ARGB8888,
> +	DRM_FORMAT_ABGR8888,
>   	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_XBGR2101010,
>   	DRM_FORMAT_ARGB2101010,
> +	DRM_FORMAT_ABGR2101010,
>   	DRM_FORMAT_YUYV,
>   	DRM_FORMAT_YVYU,
>   	DRM_FORMAT_UYVY,
>
Shankar, Uma Oct. 29, 2019, 12:10 p.m. UTC | #2
>-----Original Message-----
>From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
>Sent: Tuesday, October 8, 2019 9:45 PM
>To: intel-gfx@lists.freedesktop.org
>Subject: [Intel-gfx] [PATCH 6/9] drm/i915: Sort format arrays consistently
>
>From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
>Let's try to keep the pixel format arrays somewhat sorted:
>1. RGB before YUV
>2. smaller bpp before larger bpp
>3. X before A
>4. RGB before BGR

Changes look good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>---
> drivers/gpu/drm/i915/display/intel_display.c |  2 +-
>drivers/gpu/drm/i915/display/intel_sprite.c  | 20 ++++++++++----------
> 2 files changed, 11 insertions(+), 11 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_display.c
>b/drivers/gpu/drm/i915/display/intel_display.c
>index 1cdcd0ea0564..a8124f01bdb2 100644
>--- a/drivers/gpu/drm/i915/display/intel_display.c
>+++ b/drivers/gpu/drm/i915/display/intel_display.c
>@@ -83,8 +83,8 @@
> /* Primary plane formats for gen <= 3 */  static const u32 i8xx_primary_formats[] = {
> 	DRM_FORMAT_C8,
>-	DRM_FORMAT_RGB565,
> 	DRM_FORMAT_XRGB1555,
>+	DRM_FORMAT_RGB565,
> 	DRM_FORMAT_XRGB8888,
> };
>
>diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c
>b/drivers/gpu/drm/i915/display/intel_sprite.c
>index aaabeaf11ae9..cc9e5c9668b1 100644
>--- a/drivers/gpu/drm/i915/display/intel_sprite.c
>+++ b/drivers/gpu/drm/i915/display/intel_sprite.c
>@@ -2002,10 +2002,10 @@ static const u64 i9xx_plane_format_modifiers[] = {  };
>
> static const u32 snb_plane_formats[] = {
>-	DRM_FORMAT_XBGR8888,
> 	DRM_FORMAT_XRGB8888,
>-	DRM_FORMAT_XRGB2101010,
>+	DRM_FORMAT_XBGR8888,
> 	DRM_FORMAT_XBGR2101010,
>+	DRM_FORMAT_XRGB2101010,
> 	DRM_FORMAT_YUYV,
> 	DRM_FORMAT_YVYU,
> 	DRM_FORMAT_UYVY,
>@@ -2015,10 +2015,10 @@ static const u32 snb_plane_formats[] = {  static const
>u32 vlv_plane_formats[] = {
> 	DRM_FORMAT_C8,
> 	DRM_FORMAT_RGB565,
>-	DRM_FORMAT_ABGR8888,
>-	DRM_FORMAT_ARGB8888,
>-	DRM_FORMAT_XBGR8888,
> 	DRM_FORMAT_XRGB8888,
>+	DRM_FORMAT_XBGR8888,
>+	DRM_FORMAT_ARGB8888,
>+	DRM_FORMAT_ABGR8888,
> 	DRM_FORMAT_XBGR2101010,
> 	DRM_FORMAT_ABGR2101010,
> 	DRM_FORMAT_YUYV,
>@@ -2030,14 +2030,14 @@ static const u32 vlv_plane_formats[] = {  static const u32
>chv_pipe_b_sprite_formats[] = {
> 	DRM_FORMAT_C8,
> 	DRM_FORMAT_RGB565,
>-	DRM_FORMAT_ABGR8888,
>-	DRM_FORMAT_ARGB8888,
>-	DRM_FORMAT_XBGR8888,
> 	DRM_FORMAT_XRGB8888,
>-	DRM_FORMAT_XBGR2101010,
>-	DRM_FORMAT_ABGR2101010,
>+	DRM_FORMAT_XBGR8888,
>+	DRM_FORMAT_ARGB8888,
>+	DRM_FORMAT_ABGR8888,
> 	DRM_FORMAT_XRGB2101010,
>+	DRM_FORMAT_XBGR2101010,
> 	DRM_FORMAT_ARGB2101010,
>+	DRM_FORMAT_ABGR2101010,
> 	DRM_FORMAT_YUYV,
> 	DRM_FORMAT_YVYU,
> 	DRM_FORMAT_UYVY,
>--
>2.21.0
>
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 1cdcd0ea0564..a8124f01bdb2 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -83,8 +83,8 @@ 
 /* Primary plane formats for gen <= 3 */
 static const u32 i8xx_primary_formats[] = {
 	DRM_FORMAT_C8,
-	DRM_FORMAT_RGB565,
 	DRM_FORMAT_XRGB1555,
+	DRM_FORMAT_RGB565,
 	DRM_FORMAT_XRGB8888,
 };
 
diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
index aaabeaf11ae9..cc9e5c9668b1 100644
--- a/drivers/gpu/drm/i915/display/intel_sprite.c
+++ b/drivers/gpu/drm/i915/display/intel_sprite.c
@@ -2002,10 +2002,10 @@  static const u64 i9xx_plane_format_modifiers[] = {
 };
 
 static const u32 snb_plane_formats[] = {
-	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XBGR2101010,
+	DRM_FORMAT_XRGB2101010,
 	DRM_FORMAT_YUYV,
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
@@ -2015,10 +2015,10 @@  static const u32 snb_plane_formats[] = {
 static const u32 vlv_plane_formats[] = {
 	DRM_FORMAT_C8,
 	DRM_FORMAT_RGB565,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_XBGR8888,
+	DRM_FORMAT_ARGB8888,
+	DRM_FORMAT_ABGR8888,
 	DRM_FORMAT_XBGR2101010,
 	DRM_FORMAT_ABGR2101010,
 	DRM_FORMAT_YUYV,
@@ -2030,14 +2030,14 @@  static const u32 vlv_plane_formats[] = {
 static const u32 chv_pipe_b_sprite_formats[] = {
 	DRM_FORMAT_C8,
 	DRM_FORMAT_RGB565,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XBGR2101010,
-	DRM_FORMAT_ABGR2101010,
+	DRM_FORMAT_XBGR8888,
+	DRM_FORMAT_ARGB8888,
+	DRM_FORMAT_ABGR8888,
 	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_XBGR2101010,
 	DRM_FORMAT_ARGB2101010,
+	DRM_FORMAT_ABGR2101010,
 	DRM_FORMAT_YUYV,
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,