mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] amdgpu/dc: Fix enum mismatch in calls to program_color_matrix()
@ 2018-02-07 21:43 Matthias Kaehlcke
  2018-02-07 21:52 ` Harry Wentland
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Kaehlcke @ 2018-02-07 21:43 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Zhou, David Airlie,
	Harry Wentland, Tony Cheng, Dmytro Laktyushkin, Anthony Koo,
	Yue Hin Lau, Zeyu Fan, Charlene Liu
  Cc: amd-gfx, dri-devel, linux-kernel, Guenter Roeck, Justin TerAvest,
	Craig Bergstrom, Matthias Kaehlcke

The driver passes GRAPHICS_CSC_ADJUST_TYPE_SW of type enum
graphics_csc_adjust_type to program_color_matrix(), however the function
expects a parameter of type enum grph_color_adjust_option. Supposedly
the intention was to pass GRPH_COLOR_MATRIX_SW, which has the same value
as GRAPHICS_CSC_ADJUST_TYPE_SW, so the mismatch didn't cause any trouble.

Pass GRPH_COLOR_MATRIX_SW to program_color_matrix() instead of
GRAPHICS_CSC_ADJUST_TYPE_SW, this also fixes the following warning when
building the kernel with clang:

drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.c:1129:24:
  error: implicit conversion from enumeration type
  'enum graphics_csc_adjust_type' to different enumeration type
  'enum grph_color_adjust_option' [-Werror,-Wenum-conversion]
    xfm_dce, tbl_entry, GRAPHICS_CSC_ADJUST_TYPE_SW);

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c       | 2 +-
 drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
index 0f662e6ee9bd..ac28113c4d67 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
@@ -1126,7 +1126,7 @@ void dce110_opp_set_csc_adjustment(
 			CSC_COLOR_MODE_GRAPHICS_OUTPUT_CSC;
 
 	program_color_matrix(
-			xfm_dce, tbl_entry, GRAPHICS_CSC_ADJUST_TYPE_SW);
+			xfm_dce, tbl_entry, GRPH_COLOR_MATRIX_SW);
 
 	/*  We did everything ,now program DxOUTPUT_CSC_CONTROL */
 	configure_graphics_mode(xfm_dce, config, GRAPHICS_CSC_ADJUST_TYPE_SW,
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
index feb397b5c1a3..4245e1f818a3 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
@@ -727,7 +727,7 @@ void dce110_opp_v_set_csc_adjustment(
 			CSC_COLOR_MODE_GRAPHICS_OUTPUT_CSC;
 
 	program_color_matrix_v(
-			xfm_dce, tbl_entry, GRAPHICS_CSC_ADJUST_TYPE_SW);
+			xfm_dce, tbl_entry, GRPH_COLOR_MATRIX_SW);
 
 	/*  We did everything ,now program DxOUTPUT_CSC_CONTROL */
 	configure_graphics_mode_v(xfm_dce, config, GRAPHICS_CSC_ADJUST_TYPE_SW,
-- 
2.16.0.rc1.238.g530d649a79-goog

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] amdgpu/dc: Fix enum mismatch in calls to program_color_matrix()
  2018-02-07 21:43 [PATCH] amdgpu/dc: Fix enum mismatch in calls to program_color_matrix() Matthias Kaehlcke
@ 2018-02-07 21:52 ` Harry Wentland
  0 siblings, 0 replies; 2+ messages in thread
From: Harry Wentland @ 2018-02-07 21:52 UTC (permalink / raw)
  To: Matthias Kaehlcke, Alex Deucher, Christian König,
	David Zhou, David Airlie, Tony Cheng, Dmytro Laktyushkin,
	Anthony Koo, Yue Hin Lau, Zeyu Fan, Charlene Liu
  Cc: amd-gfx, dri-devel, linux-kernel, Guenter Roeck, Justin TerAvest,
	Craig Bergstrom

On 2018-02-07 04:43 PM, Matthias Kaehlcke wrote:
> The driver passes GRAPHICS_CSC_ADJUST_TYPE_SW of type enum
> graphics_csc_adjust_type to program_color_matrix(), however the function
> expects a parameter of type enum grph_color_adjust_option. Supposedly
> the intention was to pass GRPH_COLOR_MATRIX_SW, which has the same value
> as GRAPHICS_CSC_ADJUST_TYPE_SW, so the mismatch didn't cause any trouble.
> 
> Pass GRPH_COLOR_MATRIX_SW to program_color_matrix() instead of
> GRAPHICS_CSC_ADJUST_TYPE_SW, this also fixes the following warning when
> building the kernel with clang:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.c:1129:24:
>   error: implicit conversion from enumeration type
>   'enum graphics_csc_adjust_type' to different enumeration type
>   'enum grph_color_adjust_option' [-Werror,-Wenum-conversion]
>     xfm_dce, tbl_entry, GRAPHICS_CSC_ADJUST_TYPE_SW);
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_transform.c       | 2 +-
>  drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
> index 0f662e6ee9bd..ac28113c4d67 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
> @@ -1126,7 +1126,7 @@ void dce110_opp_set_csc_adjustment(
>  			CSC_COLOR_MODE_GRAPHICS_OUTPUT_CSC;
>  
>  	program_color_matrix(
> -			xfm_dce, tbl_entry, GRAPHICS_CSC_ADJUST_TYPE_SW);
> +			xfm_dce, tbl_entry, GRPH_COLOR_MATRIX_SW);
>  
>  	/*  We did everything ,now program DxOUTPUT_CSC_CONTROL */
>  	configure_graphics_mode(xfm_dce, config, GRAPHICS_CSC_ADJUST_TYPE_SW,
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
> index feb397b5c1a3..4245e1f818a3 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
> @@ -727,7 +727,7 @@ void dce110_opp_v_set_csc_adjustment(
>  			CSC_COLOR_MODE_GRAPHICS_OUTPUT_CSC;
>  
>  	program_color_matrix_v(
> -			xfm_dce, tbl_entry, GRAPHICS_CSC_ADJUST_TYPE_SW);
> +			xfm_dce, tbl_entry, GRPH_COLOR_MATRIX_SW);
>  
>  	/*  We did everything ,now program DxOUTPUT_CSC_CONTROL */
>  	configure_graphics_mode_v(xfm_dce, config, GRAPHICS_CSC_ADJUST_TYPE_SW,
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-07 21:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 21:43 [PATCH] amdgpu/dc: Fix enum mismatch in calls to program_color_matrix() Matthias Kaehlcke
2018-02-07 21:52 ` Harry Wentland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®