All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] drm/amd/amdgpu: Indent AMD_IS_APU properly
@ 2019-06-24 15:15 Ernst Sjöstrand
       [not found] ` <20190624151544.13934-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Ernst Sjöstrand @ 2019-06-24 15:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/soc15.c:715 soc15_get_pcie_usage() warn: inconsistent indenting
And a similar one in si.c.

Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/si.c    | 4 ++--
 drivers/gpu/drm/amd/amdgpu/soc15.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index 4ff930a47e10..4b1e0c16ac41 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -1339,8 +1339,8 @@ static void si_get_pcie_usage(struct amdgpu_device *adev, uint64_t *count0,
 	/* This reports 0 on APUs, so return to avoid writing/reading registers
 	 * that may or may not be different from their GPU counterparts
 	 */
-        if (adev->flags & AMD_IS_APU)
-                return;
+	if (adev->flags & AMD_IS_APU)
+		return;
 
 	/* Set the 2 events that we wish to watch, defined above */
 	/* Reg 40 is # received msgs, Reg 104 is # of posted requests sent */
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index fa9c27d63504..1e424d918334 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -712,8 +712,8 @@ static void soc15_get_pcie_usage(struct amdgpu_device *adev, uint64_t *count0,
 	/* This reports 0 on APUs, so return to avoid writing/reading registers
 	 * that may or may not be different from their GPU counterparts
 	 */
-	 if (adev->flags & AMD_IS_APU)
-		 return;
+	if (adev->flags & AMD_IS_APU)
+		return;
 
 	/* Set the 2 events that we wish to watch, defined above */
 	/* Reg 40 is # received msgs, Reg 104 is # of posted requests sent */
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 2/6] drm/amd/amdgpu: Fix amdgpu_set_pp_od_clk_voltage error check
       [not found] ` <20190624151544.13934-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-06-24 15:15   ` Ernst Sjöstrand
  2019-06-24 15:15   ` [PATCH 3/6] drm/amd/amdgpu: amdgpu_hwmon_show_temp: initialize temp Ernst Sjöstrand
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ernst Sjöstrand @ 2019-06-24 15:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:693 amdgpu_set_pp_od_clk_voltage() error: uninitialized symbol 'ret'.

Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 2f4b03b4e882..b44a390086f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -686,12 +686,12 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
 		if (ret)
 			return -EINVAL;
 	} else {
-		if (adev->powerplay.pp_funcs->odn_edit_dpm_table)
+		if (adev->powerplay.pp_funcs->odn_edit_dpm_table) {
 			ret = amdgpu_dpm_odn_edit_dpm_table(adev, type,
 						parameter, parameter_size);
-
-		if (ret)
-			return -EINVAL;
+			if (ret)
+				return -EINVAL;
+		}
 
 		if (type == PP_OD_COMMIT_DPM_TABLE) {
 			if (adev->powerplay.pp_funcs->dispatch_tasks) {
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 3/6] drm/amd/amdgpu: amdgpu_hwmon_show_temp: initialize temp
       [not found] ` <20190624151544.13934-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2019-06-24 15:15   ` [PATCH 2/6] drm/amd/amdgpu: Fix amdgpu_set_pp_od_clk_voltage error check Ernst Sjöstrand
@ 2019-06-24 15:15   ` Ernst Sjöstrand
  2019-06-24 15:15   ` [PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes Ernst Sjöstrand
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ernst Sjöstrand @ 2019-06-24 15:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:1496 amdgpu_hwmon_show_temp() error: uninitialized symbol 'temp'.

Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index b44a390086f4..63e6eee763bf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1459,7 +1459,7 @@ static ssize_t amdgpu_hwmon_show_temp(struct device *dev,
 	struct amdgpu_device *adev = dev_get_drvdata(dev);
 	struct drm_device *ddev = adev->ddev;
 	int channel = to_sensor_dev_attr(attr)->index;
-	int r, temp, size = sizeof(temp);
+	int r, temp = 0, size = sizeof(temp);
 
 	/* Can't get temperature when the card is off */
 	if  ((adev->flags & AMD_IS_PX) &&
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes
       [not found] ` <20190624151544.13934-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2019-06-24 15:15   ` [PATCH 2/6] drm/amd/amdgpu: Fix amdgpu_set_pp_od_clk_voltage error check Ernst Sjöstrand
  2019-06-24 15:15   ` [PATCH 3/6] drm/amd/amdgpu: amdgpu_hwmon_show_temp: initialize temp Ernst Sjöstrand
@ 2019-06-24 15:15   ` Ernst Sjöstrand
       [not found]     ` <20190624151544.13934-4-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2019-06-24 15:15   ` [PATCH 5/6] drm/amd/amdgpu: Fix style issues in dcn20_resource.c Ernst Sjöstrand
  2019-06-24 15:15   ` [PATCH 6/6] drm/amd/amdgpu: sdma_v4_0_start: initialize r Ernst Sjöstrand
  4 siblings, 1 reply; 8+ messages in thread
From: Ernst Sjöstrand @ 2019-06-24 15:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reported by smatch:
amdgpu_dm.c:5637 amdgpu_dm_commit_planes() error: we previously assumed 'acrtc_state->stream' could be null
This seems to be checked for null pretty consistently elsewhere.

Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 58d7bbc5ada7..360b31a5c028 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5669,7 +5669,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 	}
 
 	/* Update the planes if changed or disable if we don't have any. */
-	if (planes_count || acrtc_state->active_planes == 0) {
+	if ((planes_count || acrtc_state->active_planes == 0) &&
+		acrtc_state->stream) {
 		if (new_pcrtc_state->mode_changed) {
 			bundle->stream_update.src = acrtc_state->stream->src;
 			bundle->stream_update.dst = acrtc_state->stream->dst;
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 5/6] drm/amd/amdgpu: Fix style issues in dcn20_resource.c
       [not found] ` <20190624151544.13934-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2019-06-24 15:15   ` [PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes Ernst Sjöstrand
@ 2019-06-24 15:15   ` Ernst Sjöstrand
  2019-06-24 15:15   ` [PATCH 6/6] drm/amd/amdgpu: sdma_v4_0_start: initialize r Ernst Sjöstrand
  4 siblings, 0 replies; 8+ messages in thread
From: Ernst Sjöstrand @ 2019-06-24 15:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Inconsistent indentation and mixed use of brackets.

Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
index c5ac25980f19..fa4f378efe5b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
@@ -2887,15 +2887,15 @@ static bool construct(
 	dc->caps.force_dp_tps4_for_cp2520 = true;
 	dc->caps.hw_3d_lut = true;
 
-	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
+	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV) {
 		dc->debug = debug_defaults_drv;
-	else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS) {
-			pool->base.pipe_count = 4;
-
+	} else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS) {
+		pool->base.pipe_count = 4;
 		pool->base.mpcc_count = pool->base.pipe_count;
 		dc->debug = debug_defaults_diags;
-	} else
+	} else {
 		dc->debug = debug_defaults_diags;
+	}
 	//dcn2.0x
 	dc->work_arounds.dedcn20_305_wa = true;
 
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 6/6] drm/amd/amdgpu: sdma_v4_0_start: initialize r
       [not found] ` <20190624151544.13934-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                     ` (3 preceding siblings ...)
  2019-06-24 15:15   ` [PATCH 5/6] drm/amd/amdgpu: Fix style issues in dcn20_resource.c Ernst Sjöstrand
@ 2019-06-24 15:15   ` Ernst Sjöstrand
       [not found]     ` <20190624151544.13934-6-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  4 siblings, 1 reply; 8+ messages in thread
From: Ernst Sjöstrand @ 2019-06-24 15:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1167 sdma_v4_0_start() error: uninitialized symbol 'r'.

Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index c0b6011b4bd1..9e571ca283c3 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -1092,7 +1092,7 @@ static int sdma_v4_0_load_microcode(struct amdgpu_device *adev)
 static int sdma_v4_0_start(struct amdgpu_device *adev)
 {
 	struct amdgpu_ring *ring;
-	int i, r;
+	int i, r = 0;
 
 	if (amdgpu_sriov_vf(adev)) {
 		sdma_v4_0_ctx_switch_enable(adev, false);
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 6/6] drm/amd/amdgpu: sdma_v4_0_start: initialize r
       [not found]     ` <20190624151544.13934-6-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-06-24 17:44       ` Alex Deucher
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2019-06-24 17:44 UTC (permalink / raw)
  To: Ernst Sjöstrand; +Cc: amd-gfx list

Applied the series.  Thanks!

Alex

On Mon, Jun 24, 2019 at 11:16 AM Ernst Sjöstrand <ernstp@gmail.com> wrote:
>
> Reported by smatch:
> drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1167 sdma_v4_0_start() error: uninitialized symbol 'r'.
>
> Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index c0b6011b4bd1..9e571ca283c3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -1092,7 +1092,7 @@ static int sdma_v4_0_load_microcode(struct amdgpu_device *adev)
>  static int sdma_v4_0_start(struct amdgpu_device *adev)
>  {
>         struct amdgpu_ring *ring;
> -       int i, r;
> +       int i, r = 0;
>
>         if (amdgpu_sriov_vf(adev)) {
>                 sdma_v4_0_ctx_switch_enable(adev, false);
> --
> 2.20.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes
       [not found]     ` <20190624151544.13934-4-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-06-25 18:45       ` Kazlauskas, Nicholas
  0 siblings, 0 replies; 8+ messages in thread
From: Kazlauskas, Nicholas @ 2019-06-25 18:45 UTC (permalink / raw)
  To: Ernst Sjöstrand, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 6/24/19 11:15 AM, Ernst Sjöstrand wrote:
> Reported by smatch:
> amdgpu_dm.c:5637 amdgpu_dm_commit_planes() error: we previously assumed 'acrtc_state->stream' could be null
> This seems to be checked for null pretty consistently elsewhere.
> 
> Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>

This is already reviewed and merged, but this NULL check is actually 
unnecessary. This function doesn't run in the new_crtc_state->stream is 
NULL.

Technically the behavior does change inside 
dc_commit_updates_for_stream. We don't actually deference the stream 
anywhere as far as I can tell, but we do an prepare/optimize bandwidth 
and a state swap. The missing state swap would matter here, but once 
again, we don't actually run this function at all.

All these checks should probably just be dropped.

Nicholas Kazlauskas

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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 58d7bbc5ada7..360b31a5c028 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5669,7 +5669,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
>   	}
>   
>   	/* Update the planes if changed or disable if we don't have any. */
> -	if (planes_count || acrtc_state->active_planes == 0) {
> +	if ((planes_count || acrtc_state->active_planes == 0) &&
> +		acrtc_state->stream) {
>   		if (new_pcrtc_state->mode_changed) {
>   			bundle->stream_update.src = acrtc_state->stream->src;
>   			bundle->stream_update.dst = acrtc_state->stream->dst;
> 

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-06-25 18:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 15:15 [PATCH 1/6] drm/amd/amdgpu: Indent AMD_IS_APU properly Ernst Sjöstrand
     [not found] ` <20190624151544.13934-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-24 15:15   ` [PATCH 2/6] drm/amd/amdgpu: Fix amdgpu_set_pp_od_clk_voltage error check Ernst Sjöstrand
2019-06-24 15:15   ` [PATCH 3/6] drm/amd/amdgpu: amdgpu_hwmon_show_temp: initialize temp Ernst Sjöstrand
2019-06-24 15:15   ` [PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes Ernst Sjöstrand
     [not found]     ` <20190624151544.13934-4-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-25 18:45       ` Kazlauskas, Nicholas
2019-06-24 15:15   ` [PATCH 5/6] drm/amd/amdgpu: Fix style issues in dcn20_resource.c Ernst Sjöstrand
2019-06-24 15:15   ` [PATCH 6/6] drm/amd/amdgpu: sdma_v4_0_start: initialize r Ernst Sjöstrand
     [not found]     ` <20190624151544.13934-6-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-24 17:44       ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.