dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [radeon-alex:amd-mainline-dkms-4.15 1231/1759] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2183 fill_plane_attributes() warn: if statement not indented
@ 2018-04-26 12:54 Dan Carpenter
  2018-04-26 14:46 ` [PATCH] drm/amd/display: Remove erroneous if statement in gamma set sunpeng.li
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2018-04-26 12:54 UTC (permalink / raw)
  To: kbuild, Leo (Sunpeng) Li
  Cc: Alex Deucher, Kevin Wang, Harry Wentland, kbuild-all, dri-devel

tree:   git://people.freedesktop.org/~agd5f/linux.git amd-mainline-dkms-4.15
head:   9556f93f18f7923978fb90f860c107fed9ca7f57
commit: 265083076187e619aa9176aeb05ad630013429b4 [1231/1759] drm/amd/display: Hookup color management functions

smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2183 fill_plane_attributes() warn: if statement not indented

git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout 265083076187e619aa9176aeb05ad630013429b4
vim +2183 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c

e7b07ceef Harry Wentland   2017-08-10  2143  
3ee6b26b7 Alex Deucher     2017-10-10  2144  static int fill_plane_attributes(struct amdgpu_device *adev,
3be5262e3 Harry Wentland   2017-07-27  2145  				 struct dc_plane_state *dc_plane_state,
e7b07ceef Harry Wentland   2017-08-10  2146  				 struct drm_plane_state *plane_state,
ab8968728 Michel Dänzer    2017-10-26  2147  				 struct drm_crtc_state *crtc_state)
e7b07ceef Harry Wentland   2017-08-10  2148  {
e7b07ceef Harry Wentland   2017-08-10  2149  	const struct amdgpu_framebuffer *amdgpu_fb =
e7b07ceef Harry Wentland   2017-08-10  2150  		to_amdgpu_framebuffer(plane_state->fb);
25b138493 Roger He         2018-02-26  2151  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \
25b138493 Roger He         2018-02-26  2152  	defined(OS_NAME_RHEL_7_3) || \
25b138493 Roger He         2018-02-26  2153  	defined(OS_NAME_RHEL_7_4_5)
e7b07ceef Harry Wentland   2017-08-10  2154  	const struct drm_crtc *crtc = plane_state->crtc;
30b13a59d Junwei Zhang     2018-02-08  2155  #else
30b13a59d Junwei Zhang     2018-02-08  2156  	struct drm_crtc *crtc = plane_state->crtc;
30b13a59d Junwei Zhang     2018-02-08  2157  #endif
e7b07ceef Harry Wentland   2017-08-10  2158  	struct dc_transfer_func *input_tf;
e7b07ceef Harry Wentland   2017-08-10  2159  	int ret = 0;
e7b07ceef Harry Wentland   2017-08-10  2160  
3be5262e3 Harry Wentland   2017-07-27  2161  	if (!fill_rects_from_plane_state(plane_state, dc_plane_state))
e7b07ceef Harry Wentland   2017-08-10  2162  		return -EINVAL;
e7b07ceef Harry Wentland   2017-08-10  2163  
e7b07ceef Harry Wentland   2017-08-10  2164  	ret = fill_plane_attributes_from_fb(
e7b07ceef Harry Wentland   2017-08-10  2165  		crtc->dev->dev_private,
3be5262e3 Harry Wentland   2017-07-27  2166  		dc_plane_state,
ab8968728 Michel Dänzer    2017-10-26  2167  		amdgpu_fb);
e7b07ceef Harry Wentland   2017-08-10  2168  
e7b07ceef Harry Wentland   2017-08-10  2169  	if (ret)
e7b07ceef Harry Wentland   2017-08-10  2170  		return ret;
e7b07ceef Harry Wentland   2017-08-10  2171  
e7b07ceef Harry Wentland   2017-08-10  2172  	input_tf = dc_create_transfer_func();
e7b07ceef Harry Wentland   2017-08-10  2173  
e7b07ceef Harry Wentland   2017-08-10  2174  	if (input_tf == NULL)
e7b07ceef Harry Wentland   2017-08-10  2175  		return -ENOMEM;
e7b07ceef Harry Wentland   2017-08-10  2176  
3be5262e3 Harry Wentland   2017-07-27  2177  	dc_plane_state->in_transfer_func = input_tf;
e7b07ceef Harry Wentland   2017-08-10  2178  
e7b07ceef Harry Wentland   2017-08-10  2179  	/* In case of gamma set, update gamma value */
25b138493 Roger He         2018-02-26  2180  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \
25b138493 Roger He         2018-02-26  2181  	defined(OS_NAME_RHEL_7_3) || \
25b138493 Roger He         2018-02-26  2182  	defined(OS_NAME_RHEL_7_4_5)
e7b07ceef Harry Wentland   2017-08-10 @2183  	if (crtc_state->gamma_lut)
265083076 Leo (Sunpeng  Li 2018-02-02  2184) 	/*
265083076 Leo (Sunpeng  Li 2018-02-02  2185) 	 * Always set input transfer function, since plane state is refreshed
265083076 Leo (Sunpeng  Li 2018-02-02  2186) 	 * every time.
265083076 Leo (Sunpeng  Li 2018-02-02  2187) 	 */
265083076 Leo (Sunpeng  Li 2018-02-02  2188) 	ret = amdgpu_dm_set_degamma_lut(crtc_state, dc_plane_state);

It should be indented and I would normally use curly braces around the
whole thing as well for readability.

3f4b5749a Junwei Zhang     2018-02-07  2189  #else
3f4b5749a Junwei Zhang     2018-02-07  2190  	if (crtc->mode.private_flags & AMDGPU_CRTC_MODE_PRIVATE_FLAGS_GAMMASET) {
3f4b5749a Junwei Zhang     2018-02-07  2191  		fill_gamma_from_crtc(crtc, dc_plane_state);
3f4b5749a Junwei Zhang     2018-02-07  2192  		/* reset trigger of gamma */
3f4b5749a Junwei Zhang     2018-02-07  2193  		crtc->mode.private_flags &=
3f4b5749a Junwei Zhang     2018-02-07  2194  			~AMDGPU_CRTC_MODE_PRIVATE_FLAGS_GAMMASET;
3f4b5749a Junwei Zhang     2018-02-07  2195  	}
3f4b5749a Junwei Zhang     2018-02-07  2196  #endif
e7b07ceef Harry Wentland   2017-08-10  2197  
e7b07ceef Harry Wentland   2017-08-10  2198  	return ret;
e7b07ceef Harry Wentland   2017-08-10  2199  }
e7b07ceef Harry Wentland   2017-08-10  2200  

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

* [PATCH] drm/amd/display: Remove erroneous if statement in gamma set
  2018-04-26 12:54 [radeon-alex:amd-mainline-dkms-4.15 1231/1759] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2183 fill_plane_attributes() warn: if statement not indented Dan Carpenter
@ 2018-04-26 14:46 ` sunpeng.li
  2018-04-26 18:17   ` Harry Wentland
  0 siblings, 1 reply; 3+ messages in thread
From: sunpeng.li @ 2018-04-26 14:46 UTC (permalink / raw)
  To: Kevin1.Wang, dan.carpenter
  Cc: Leo (Sunpeng) Li, dri-devel, kbuild, kbuild-all,
	alexander.deucher

From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>

The lines were removed as part of the original change. They may have
been missed during merge.

This is a fixup to:

    committ 265083076187e619aa9176aeb05ad630013429b4
    Author: Leo (Sunpeng) Li <sunpeng.li@amd.com>
    Date:   Fri Feb 2 10:18:56 2018 -0500

        drm/amd/display: Hookup color management functions
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index b7265f6..0d4a133 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2206,11 +2206,9 @@ static int fill_plane_attributes(struct amdgpu_device *adev,
 
 	dc_plane_state->in_transfer_func = input_tf;
 
-	/* In case of gamma set, update gamma value */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \
 	defined(OS_NAME_RHEL_7_3) || \
 	defined(OS_NAME_RHEL_7_4_5)
-	if (crtc_state->gamma_lut)
 	/*
 	 * Always set input transfer function, since plane state is refreshed
 	 * every time.
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amd/display: Remove erroneous if statement in gamma set
  2018-04-26 14:46 ` [PATCH] drm/amd/display: Remove erroneous if statement in gamma set sunpeng.li
@ 2018-04-26 18:17   ` Harry Wentland
  0 siblings, 0 replies; 3+ messages in thread
From: Harry Wentland @ 2018-04-26 18:17 UTC (permalink / raw)
  To: sunpeng.li, Kevin1.Wang, dan.carpenter
  Cc: alexander.deucher, kbuild, kbuild-all, dri-devel

On 2018-04-26 10:46 AM, sunpeng.li@amd.com wrote:
> From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
> 
> The lines were removed as part of the original change. They may have
> been missed during merge.
> 
> This is a fixup to:
> 
>     committ 265083076187e619aa9176aeb05ad630013429b4
>     Author: Leo (Sunpeng) Li <sunpeng.li@amd.com>
>     Date:   Fri Feb 2 10:18:56 2018 -0500
> 
>         drm/amd/display: Hookup color management functions

Missing SOB?

With that fixed this is
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

I would like Kevin to take a look before merging first. It looks like this line was unintentionally left when merging to amd-mainline-dkms-4.15 but would like to confirm that's the case.

Harry

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index b7265f6..0d4a133 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -2206,11 +2206,9 @@ static int fill_plane_attributes(struct amdgpu_device *adev,
>  
>  	dc_plane_state->in_transfer_func = input_tf;
>  
> -	/* In case of gamma set, update gamma value */
>  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \
>  	defined(OS_NAME_RHEL_7_3) || \
>  	defined(OS_NAME_RHEL_7_4_5)
> -	if (crtc_state->gamma_lut)
>  	/*
>  	 * Always set input transfer function, since plane state is refreshed
>  	 * every time.
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-04-26 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-26 12:54 [radeon-alex:amd-mainline-dkms-4.15 1231/1759] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2183 fill_plane_attributes() warn: if statement not indented Dan Carpenter
2018-04-26 14:46 ` [PATCH] drm/amd/display: Remove erroneous if statement in gamma set sunpeng.li
2018-04-26 18:17   ` Harry Wentland

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