Skip to contentSkip to conversation

drm/radeon: fix audio pin counts for DCE6+

PATCH Applied Alex Deucher 3 participants 4 messages Apr 7, 2014 – Apr 8, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: fix audio pin counts for DCE6+

There is actually quite a bit of variance based on the asic.

---
 drivers/gpu/drm/radeon/dce6_afmt.c | 14 ++++++++++----
 drivers/gpu/drm/radeon/radeon.h    |  5 ++++-
 2 files changed, 14 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/dce6_afmt.c +10 -4
index 8595449..38766aa 100644
@@ -309,11 +309,17 @@ int dce6_audio_init(struct radeon_device *rdev)
 
 	rdev->audio.enabled = true;
 
-	if (ASIC_IS_DCE8(rdev))
-		rdev->audio.num_pins = 6;
-	else if (ASIC_IS_DCE61(rdev))
+	if (ASIC_IS_DCE81(rdev)) /* KV: 4 streams, 7 endpoints */
+		rdev->audio.num_pins = 7;
+	else if (ASIC_IS_DCE83(rdev)) /* KB: 2 streams, 3 endpoints */
 		rdev->audio.num_pins = 4;
-	else
+	else if (ASIC_IS_DCE8(rdev)) /* BN/HW: 6 streams, 7 endpoints */
+		rdev->audio.num_pins = 7;
+	else if (ASIC_IS_DCE61(rdev)) /* TN: 4 streams, 6 endpoints */
+		rdev->audio.num_pins = 6;
+	else if (ASIC_IS_DCE64(rdev)) /* OL: 2 streams, 2 endpoints */
+		rdev->audio.num_pins = 2;
+	else /* SI: 6 streams, 6 endpoints */
 		rdev->audio.num_pins = 6;
 
 	for (i = 0; i < rdev->audio.num_pins; i++) {
drivers/gpu/drm/radeon/radeon.h +4 -1
index 7a07ec8..f0fc2c8 100644
@@ -736,7 +736,7 @@ union radeon_irq_stat_regs {
 	struct cik_irq_stat_regs cik;
 };
 
-#define RADEON_MAX_HPD_PINS 6
+#define RADEON_MAX_HPD_PINS 7
 #define RADEON_MAX_CRTCS 6
 #define RADEON_MAX_AFMT_BLOCKS 7
 
@@ -2628,6 +2628,9 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
 #define ASIC_IS_DCE64(rdev) ((rdev->family == CHIP_OLAND))
 #define ASIC_IS_NODCE(rdev) ((rdev->family == CHIP_HAINAN))
 #define ASIC_IS_DCE8(rdev) ((rdev->family >= CHIP_BONAIRE))
+#define ASIC_IS_DCE81(rdev) ((rdev->family == CHIP_KAVERI))
+#define ASIC_IS_DCE82(rdev) ((rdev->family == CHIP_BONAIRE))
+#define ASIC_IS_DCE83(rdev) ((rdev->family == CHIP_KABINI))
 
 #define ASIC_IS_LOMBOK(rdev) ((rdev->ddev->pdev->device == 0x6849) || \
 			      (rdev->ddev->pdev->device == 0x6850) || \
Signature · 1 line
1.8.3.1
#1 lore raw

Applied to my 3.15 branch as well.

Cheers,
Christian.

Am 07.04.2014 22:17, schrieb Alex Deucher:

Quoted 59 lines

There is actually quite a bit of variance based on the asic.

---
  drivers/gpu/drm/radeon/dce6_afmt.c | 14 ++++++++++----
  drivers/gpu/drm/radeon/radeon.h    |  5 ++++-
  2 files changed, 14 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/dce6_afmt.c +10 -4
index 8595449..38766aa 100644
@@ -309,11 +309,17 @@ int dce6_audio_init(struct radeon_device *rdev)
 
  	rdev->audio.enabled = true;
 
-	if (ASIC_IS_DCE8(rdev))
-		rdev->audio.num_pins = 6;
-	else if (ASIC_IS_DCE61(rdev))
+	if (ASIC_IS_DCE81(rdev)) /* KV: 4 streams, 7 endpoints */
+		rdev->audio.num_pins = 7;
+	else if (ASIC_IS_DCE83(rdev)) /* KB: 2 streams, 3 endpoints */
  		rdev->audio.num_pins = 4;
-	else
+	else if (ASIC_IS_DCE8(rdev)) /* BN/HW: 6 streams, 7 endpoints */
+		rdev->audio.num_pins = 7;
+	else if (ASIC_IS_DCE61(rdev)) /* TN: 4 streams, 6 endpoints */
+		rdev->audio.num_pins = 6;
+	else if (ASIC_IS_DCE64(rdev)) /* OL: 2 streams, 2 endpoints */
+		rdev->audio.num_pins = 2;
+	else /* SI: 6 streams, 6 endpoints */
  		rdev->audio.num_pins = 6;
 
  	for (i = 0; i < rdev->audio.num_pins; i++) {
drivers/gpu/drm/radeon/radeon.h +4 -1
index 7a07ec8..f0fc2c8 100644
@@ -736,7 +736,7 @@ union radeon_irq_stat_regs {
  	struct cik_irq_stat_regs cik;
  };
 
-#define RADEON_MAX_HPD_PINS 6
+#define RADEON_MAX_HPD_PINS 7
  #define RADEON_MAX_CRTCS 6
  #define RADEON_MAX_AFMT_BLOCKS 7
 
@@ -2628,6 +2628,9 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
  #define ASIC_IS_DCE64(rdev) ((rdev->family == CHIP_OLAND))
  #define ASIC_IS_NODCE(rdev) ((rdev->family == CHIP_HAINAN))
  #define ASIC_IS_DCE8(rdev) ((rdev->family >= CHIP_BONAIRE))
+#define ASIC_IS_DCE81(rdev) ((rdev->family == CHIP_KAVERI))
+#define ASIC_IS_DCE82(rdev) ((rdev->family == CHIP_BONAIRE))
+#define ASIC_IS_DCE83(rdev) ((rdev->family == CHIP_KABINI))
 
  #define ASIC_IS_LOMBOK(rdev) ((rdev->ddev->pdev->device == 0x6849) || \
  			      (rdev->ddev->pdev->device == 0x6850) || \
#2 lore raw
In reply to Alex Deucher
Quoted 16 lines · Alex Deucher

There is actually quite a bit of variance based on the asic.

---
 drivers/gpu/drm/radeon/dce6_afmt.c | 14 ++++++++++----
 drivers/gpu/drm/radeon/radeon.h    |  5 ++++-
 2 files changed, 14 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/dce6_afmt.c +0 -0
index 8595449..38766aa 100644
@@ -309,11 +309,17 @@ int dce6_audio_init(struct radeon_device *rdev)
 

drivers/gpu/drm/radeon/dce6_afmt.c int dce6_audio_init(struct radeon_device *rdev) · line 316

Quoted 10 lines
drivers/gpu/drm/radeon/dce6_afmt.c +3 -4
 	rdev->audio.enabled = true;
 
-	if (ASIC_IS_DCE8(rdev))
-		rdev->audio.num_pins = 6;
-	else if (ASIC_IS_DCE61(rdev))
+	if (ASIC_IS_DCE81(rdev)) /* KV: 4 streams, 7 endpoints */
+		rdev->audio.num_pins = 7;
+	else if (ASIC_IS_DCE83(rdev)) /* KB: 2 streams, 3 endpoints */
 		rdev->audio.num_pins = 4;
-	else

This looks bogus, comment says 3 endpoint bit code set 4

Cheers,
Jerome

Quoted 40 lines
drivers/gpu/drm/radeon/dce6_afmt.c +7 -0
+	else if (ASIC_IS_DCE8(rdev)) /* BN/HW: 6 streams, 7 endpoints */
+		rdev->audio.num_pins = 7;
+	else if (ASIC_IS_DCE61(rdev)) /* TN: 4 streams, 6 endpoints */
+		rdev->audio.num_pins = 6;
+	else if (ASIC_IS_DCE64(rdev)) /* OL: 2 streams, 2 endpoints */
+		rdev->audio.num_pins = 2;
+	else /* SI: 6 streams, 6 endpoints */
 		rdev->audio.num_pins = 6;
 
 	for (i = 0; i < rdev->audio.num_pins; i++) {
drivers/gpu/drm/radeon/radeon.h +4 -1
index 7a07ec8..f0fc2c8 100644
@@ -736,7 +736,7 @@ union radeon_irq_stat_regs {
 	struct cik_irq_stat_regs cik;
 };
 
-#define RADEON_MAX_HPD_PINS 6
+#define RADEON_MAX_HPD_PINS 7
 #define RADEON_MAX_CRTCS 6
 #define RADEON_MAX_AFMT_BLOCKS 7
 
@@ -2628,6 +2628,9 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
 #define ASIC_IS_DCE64(rdev) ((rdev->family == CHIP_OLAND))
 #define ASIC_IS_NODCE(rdev) ((rdev->family == CHIP_HAINAN))
 #define ASIC_IS_DCE8(rdev) ((rdev->family >= CHIP_BONAIRE))
+#define ASIC_IS_DCE81(rdev) ((rdev->family == CHIP_KAVERI))
+#define ASIC_IS_DCE82(rdev) ((rdev->family == CHIP_BONAIRE))
+#define ASIC_IS_DCE83(rdev) ((rdev->family == CHIP_KABINI))
 
 #define ASIC_IS_LOMBOK(rdev) ((rdev->ddev->pdev->device == 0x6849) || \
 			      (rdev->ddev->pdev->device == 0x6850) || \
Signature · 6 lines
1.8.3.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 19 lines · Jerome Glisse
Quoted 18 lines · Alex Deucher

There is actually quite a bit of variance based on the asic.

---
 drivers/gpu/drm/radeon/dce6_afmt.c | 14 ++++++++++----
 drivers/gpu/drm/radeon/radeon.h    |  5 ++++-
 2 files changed, 14 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/dce6_afmt.c +0 -0
index 8595449..38766aa 100644
@@ -309,11 +309,17 @@ int dce6_audio_init(struct radeon_device *rdev)
 
      rdev->audio.enabled = true;
 
Quoted 10 lines

drivers/gpu/drm/radeon/dce6_afmt.c int dce6_audio_init(struct radeon_device *rdev) · line 316

Quoted 8 lines
drivers/gpu/drm/radeon/dce6_afmt.c +3 -4
-     if (ASIC_IS_DCE8(rdev))
-             rdev->audio.num_pins = 6;
-     else if (ASIC_IS_DCE61(rdev))
+     if (ASIC_IS_DCE81(rdev)) /* KV: 4 streams, 7 endpoints */
+             rdev->audio.num_pins = 7;
+     else if (ASIC_IS_DCE83(rdev)) /* KB: 2 streams, 3 endpoints */
              rdev->audio.num_pins = 4;
-     else

This looks bogus, comment says 3 endpoint bit code set 4

Good catch. fixed up version sent out.

Thanks!

Alex

Quoted 44 lines

Cheers,
Jerome

Quoted 40 lines
drivers/gpu/drm/radeon/dce6_afmt.c +7 -0
+     else if (ASIC_IS_DCE8(rdev)) /* BN/HW: 6 streams, 7 endpoints */
+             rdev->audio.num_pins = 7;
+     else if (ASIC_IS_DCE61(rdev)) /* TN: 4 streams, 6 endpoints */
+             rdev->audio.num_pins = 6;
+     else if (ASIC_IS_DCE64(rdev)) /* OL: 2 streams, 2 endpoints */
+             rdev->audio.num_pins = 2;
+     else /* SI: 6 streams, 6 endpoints */
              rdev->audio.num_pins = 6;
 
      for (i = 0; i < rdev->audio.num_pins; i++) {
drivers/gpu/drm/radeon/radeon.h +4 -2
index 7a07ec8..f0fc2c8 100644
@@ -736,7 +736,7 @@ union radeon_irq_stat_regs {
      struct cik_irq_stat_regs cik;
 };
 
-#define RADEON_MAX_HPD_PINS 6
+#define RADEON_MAX_HPD_PINS 7
 #define RADEON_MAX_CRTCS 6
 #define RADEON_MAX_AFMT_BLOCKS 7
 
@@ -2628,6 +2628,9 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
 #define ASIC_IS_DCE64(rdev) ((rdev->family == CHIP_OLAND))
 #define ASIC_IS_NODCE(rdev) ((rdev->family == CHIP_HAINAN))
 #define ASIC_IS_DCE8(rdev) ((rdev->family >= CHIP_BONAIRE))
+#define ASIC_IS_DCE81(rdev) ((rdev->family == CHIP_KAVERI))
+#define ASIC_IS_DCE82(rdev) ((rdev->family == CHIP_BONAIRE))
+#define ASIC_IS_DCE83(rdev) ((rdev->family == CHIP_KABINI))
 
 #define ASIC_IS_LOMBOK(rdev) ((rdev->ddev->pdev->device == 0x6849) || \
                            (rdev->ddev->pdev->device == 0x6850) || \
--

1.8.3.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel