AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] drm/amdgpu: fix style and comments in DCE6
@ 2025-03-01  2:17 Alexandre Demers
  2025-03-01  2:17 ` [PATCH v2 1/2] drm/amdgpu: add some " Alexandre Demers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexandre Demers @ 2025-03-01  2:17 UTC (permalink / raw)
  To: amd-gfx

While going throught DCE6 code, I took on myself to add some comments
and to fix style in a few places.

Alexandre Demers (2):
  drm/amdgpu: add some comments in DCE6
  dmr/amdgpu: fix style in DCE6

 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 32 ++++++++++++++++++---------
 1 file changed, 21 insertions(+), 11 deletions(-)

-- 
2.48.1


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

* [PATCH v2 1/2] drm/amdgpu: add some comments in DCE6
  2025-03-01  2:17 [PATCH v2 0/2] drm/amdgpu: fix style and comments in DCE6 Alexandre Demers
@ 2025-03-01  2:17 ` Alexandre Demers
  2025-03-01  2:17 ` [PATCH v2 2/2] dmr/amdgpu: fix style " Alexandre Demers
  2025-03-03 17:05 ` [PATCH v2 0/2] drm/amdgpu: fix style and comments " Alex Deucher
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Demers @ 2025-03-01  2:17 UTC (permalink / raw)
  To: amd-gfx

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index eb7de9122d99..78402e7444db 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -206,9 +206,9 @@ static void dce_v6_0_page_flip(struct amdgpu_device *adev,
 	/* update the scanout addresses */
 	WREG32(mmGRPH_PRIMARY_SURFACE_ADDRESS_HIGH + amdgpu_crtc->crtc_offset,
 	       upper_32_bits(crtc_base));
+	/* writing to the low address triggers the update */
 	WREG32(mmGRPH_PRIMARY_SURFACE_ADDRESS + amdgpu_crtc->crtc_offset,
 	       (u32)crtc_base);
-
 	/* post the write */
 	RREG32(mmGRPH_PRIMARY_SURFACE_ADDRESS + amdgpu_crtc->crtc_offset);
 }
@@ -218,11 +218,11 @@ static int dce_v6_0_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc,
 {
 	if ((crtc < 0) || (crtc >= adev->mode_info.num_crtc))
 		return -EINVAL;
+
 	*vbl = RREG32(mmCRTC_V_BLANK_START_END + crtc_offsets[crtc]);
 	*position = RREG32(mmCRTC_STATUS_POSITION + crtc_offsets[crtc]);
 
 	return 0;
-
 }
 
 /**
@@ -1006,6 +1006,18 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev,
 }
 
 /* watermark setup */
+/**
+ * dce_v6_0_line_buffer_adjust - Set up the line buffer
+ *
+ * @adev: amdgpu_device pointer
+ * @amdgpu_crtc: the selected display controller
+ * @mode: the current display mode on the selected display
+ * controller
+ *
+ * Setup up the line buffer allocation for
+ * the selected display controller (CIK).
+ * Returns the line buffer size in pixels.
+ */
 static u32 dce_v6_0_line_buffer_adjust(struct amdgpu_device *adev,
 				   struct amdgpu_crtc *amdgpu_crtc,
 				   struct drm_display_mode *mode,
@@ -1386,6 +1398,8 @@ static int dce_v6_0_audio_init(struct amdgpu_device *adev)
 		adev->mode_info.audio.pin[i].connected = false;
 		adev->mode_info.audio.pin[i].offset = pin_offsets[i];
 		adev->mode_info.audio.pin[i].id = i;
+		/* disable audio.  it will be set up later */
+		/* XXX remove once we switch to ip funcs */
 		dce_v6_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
 	}
 
-- 
2.48.1


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

* [PATCH v2 2/2] dmr/amdgpu: fix style in DCE6
  2025-03-01  2:17 [PATCH v2 0/2] drm/amdgpu: fix style and comments in DCE6 Alexandre Demers
  2025-03-01  2:17 ` [PATCH v2 1/2] drm/amdgpu: add some " Alexandre Demers
@ 2025-03-01  2:17 ` Alexandre Demers
  2025-03-03 17:05 ` [PATCH v2 0/2] drm/amdgpu: fix style and comments " Alex Deucher
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Demers @ 2025-03-01  2:17 UTC (permalink / raw)
  To: amd-gfx

A few returns not where they should be.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index 78402e7444db..a72fd7220081 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -242,7 +242,8 @@ static bool dce_v6_0_hpd_sense(struct amdgpu_device *adev,
 	if (hpd >= adev->mode_info.num_hpd)
 		return connected;
 
-	if (RREG32(mmDC_HPD1_INT_STATUS + hpd_offsets[hpd]) & DC_HPD1_INT_STATUS__DC_HPD1_SENSE_MASK)
+	if (RREG32(mmDC_HPD1_INT_STATUS + hpd_offsets[hpd]) &
+	    DC_HPD1_INT_STATUS__DC_HPD1_SENSE_MASK)
 		connected = true;
 
 	return connected;
@@ -419,7 +420,6 @@ void dce_v6_0_disable_dce(struct amdgpu_device *adev)
 
 static void dce_v6_0_program_fmt(struct drm_encoder *encoder)
 {
-
 	struct drm_device *dev = encoder->dev;
 	struct amdgpu_device *adev = drm_to_adev(dev);
 	struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder);
@@ -895,8 +895,8 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev,
 		wm_high.dram_channels = dram_channels;
 		wm_high.num_heads = num_heads;
 
-		if (adev->pm.dpm_enabled) {
 		/* watermark for low clocks */
+		if (adev->pm.dpm_enabled) {
 			wm_low.yclk =
 				amdgpu_dpm_get_mclk(adev, true) * 10;
 			wm_low.sclk =
@@ -3135,7 +3135,6 @@ static int dce_v6_0_hpd_irq(struct amdgpu_device *adev,
 	}
 
 	return 0;
-
 }
 
 static int dce_v6_0_set_clockgating_state(void *handle,
@@ -3268,8 +3267,7 @@ static void dce_v6_0_ext_commit(struct drm_encoder *encoder)
 
 }
 
-static void
-dce_v6_0_ext_mode_set(struct drm_encoder *encoder,
+static void dce_v6_0_ext_mode_set(struct drm_encoder *encoder,
 		      struct drm_display_mode *mode,
 		      struct drm_display_mode *adjusted_mode)
 {
@@ -3281,8 +3279,7 @@ static void dce_v6_0_ext_disable(struct drm_encoder *encoder)
 
 }
 
-static void
-dce_v6_0_ext_dpms(struct drm_encoder *encoder, int mode)
+static void dce_v6_0_ext_dpms(struct drm_encoder *encoder, int mode)
 {
 
 }
@@ -3353,7 +3350,6 @@ static void dce_v6_0_encoder_add(struct amdgpu_device *adev,
 			amdgpu_encoder->devices |= supported_device;
 			return;
 		}
-
 	}
 
 	/* add a new one */
-- 
2.48.1


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

* Re: [PATCH v2 0/2] drm/amdgpu: fix style and comments in DCE6
  2025-03-01  2:17 [PATCH v2 0/2] drm/amdgpu: fix style and comments in DCE6 Alexandre Demers
  2025-03-01  2:17 ` [PATCH v2 1/2] drm/amdgpu: add some " Alexandre Demers
  2025-03-01  2:17 ` [PATCH v2 2/2] dmr/amdgpu: fix style " Alexandre Demers
@ 2025-03-03 17:05 ` Alex Deucher
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2025-03-03 17:05 UTC (permalink / raw)
  To: Alexandre Demers; +Cc: amd-gfx

Applied these.  thanks.

Alex

On Fri, Feb 28, 2025 at 9:22 PM Alexandre Demers
<alexandre.f.demers@gmail.com> wrote:
>
> While going throught DCE6 code, I took on myself to add some comments
> and to fix style in a few places.
>
> Alexandre Demers (2):
>   drm/amdgpu: add some comments in DCE6
>   dmr/amdgpu: fix style in DCE6
>
>  drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 32 ++++++++++++++++++---------
>  1 file changed, 21 insertions(+), 11 deletions(-)
>
> --
> 2.48.1
>

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

end of thread, other threads:[~2025-03-03 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-01  2:17 [PATCH v2 0/2] drm/amdgpu: fix style and comments in DCE6 Alexandre Demers
2025-03-01  2:17 ` [PATCH v2 1/2] drm/amdgpu: add some " Alexandre Demers
2025-03-01  2:17 ` [PATCH v2 2/2] dmr/amdgpu: fix style " Alexandre Demers
2025-03-03 17:05 ` [PATCH v2 0/2] drm/amdgpu: fix style and comments " Alex Deucher

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