[PATCH 38/76] drm/amd/dal: Hard-coded LB_MEMORY_SIZE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Wesley Chalmers <Wesley.Chalmers@xxxxxxx>

Signed-off-by: Wesley Chalmers <Wesley.Chalmers at amd.com>
Acked-by: Harry Wentland <harry.wentland at amd.com>
---
 drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c            | 4 +++-
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.c           | 2 ++
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c | 6 +++---
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.c         | 2 +-
 drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c            | 4 +++-
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.c             | 2 ++
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c   | 2 +-
 drivers/gpu/drm/amd/dal/dc/inc/hw/transform.h                  | 1 +
 8 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
index 0c1a9b8a9b5a..908bb297bd0f 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
@@ -491,8 +491,10 @@ static struct transform *dce100_transform_create(
 	if (!transform)
 		return NULL;
 
-	if (dce110_transform_construct(transform, ctx, inst, offsets))
+	if (dce110_transform_construct(transform, ctx, inst, offsets)) {
+		transform->base.lb_memory_size = 0x6B0; /*1712*/
 		return &transform->base;
+	}
 
 	BREAK_TO_DEBUGGER();
 	dm_free(transform);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.c
index 3426210b7482..a8973795eeeb 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.c
@@ -116,6 +116,8 @@ bool dce110_transform_construct(
 	xfm110->base.lb_bits_per_entry = LB_BITS_PER_ENTRY;
 	xfm110->base.lb_total_entries_num = LB_TOTAL_NUMBER_OF_ENTRIES;
 
+	xfm110->base.lb_memory_size = 0x6B0; /*1712*/
+
 	return true;
 }
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
index 01168b46df84..48a10128a9c2 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
@@ -26,8 +26,8 @@
 #include "dm_services.h"
 
 /* include DCE11 register header files */
-#include "dce/dce_11_0_d.h"
-#include "dce/dce_11_0_sh_mask.h"
+#include "dce/dce_11_2_d.h"
+#include "dce/dce_11_2_sh_mask.h"
 
 #include "dce110_transform.h"
 #include "dce110_transform_v.h"
@@ -786,7 +786,7 @@ bool dce110_transform_power_up_line_buffer(struct transform *xfm)
 	/*Use all three pieces of memory always*/
 	set_reg_field_value(value, 0, LB_MEMORY_CTRL, LB_MEMORY_CONFIG);
 	/*hard coded number DCE11 1712(0x6B0) Partitions: 720/960/1712*/
-	set_reg_field_value(value, LB_TOTAL_NUMBER_OF_ENTRIES, LB_MEMORY_CTRL,
+	set_reg_field_value(value, xfm110->base.lb_memory_size, LB_MEMORY_CTRL,
 			LB_MEMORY_SIZE);
 
 	dm_write_reg(xfm110->base.ctx, LB_REG(mmLB_MEMORY_CTRL), value);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.c
index bcab405a1a33..b17929dc51ea 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.c
@@ -800,7 +800,7 @@ static bool dce110_transform_v_power_up_line_buffer(struct transform *xfm)
 	/*Use all three pieces of memory always*/
 	set_reg_field_value(value, 0, LBV_MEMORY_CTRL, LB_MEMORY_CONFIG);
 	/*hard coded number DCE11 1712(0x6B0) Partitions: 720/960/1712*/
-	set_reg_field_value(value, LB_TOTAL_NUMBER_OF_ENTRIES, LBV_MEMORY_CTRL,
+	set_reg_field_value(value, xfm110->base.lb_memory_size, LBV_MEMORY_CTRL,
 			LB_MEMORY_SIZE);
 
 	dm_write_reg(xfm110->base.ctx, mmLBV_MEMORY_CTRL, value);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
index c1456483cbdb..7cd772dbd7ce 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c
@@ -516,8 +516,10 @@ static struct transform *dce112_transform_create(
 	if (!transform)
 		return NULL;
 
-	if (dce110_transform_construct(transform, ctx, inst, offsets))
+	if (dce110_transform_construct(transform, ctx, inst, offsets)) {
+		transform->base.lb_memory_size = 0x1404; /*5124*/
 		return &transform->base;
+	}
 
 	BREAK_TO_DEBUGGER();
 	dm_free(transform);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.c
index a37ecb842f74..48cbcbb28c77 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.c
@@ -105,6 +105,8 @@ bool dce80_transform_construct(
 	xfm80->base.lb_bits_per_entry = LB_BITS_PER_ENTRY;
 	xfm80->base.lb_total_entries_num = LB_TOTAL_NUMBER_OF_ENTRIES;
 
+	xfm80->base.lb_memory_size = 0x6B0; /*1712*/
+
 	return true;
 }
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
index 264d260320a6..cd310a99144c 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
@@ -732,7 +732,7 @@ bool dce80_transform_power_up_line_buffer(struct transform *xfm)
 	/*Use all three pieces of memory always*/
 	set_reg_field_value(value, 0, LB_MEMORY_CTRL, LB_MEMORY_CONFIG);
 	/*hard coded number DCE8 1712(0x6B0) Partitions: 720/960/1712*/
-	set_reg_field_value(value, LB_TOTAL_NUMBER_OF_ENTRIES, LB_MEMORY_CTRL,
+	set_reg_field_value(value, xfm80->base.lb_memory_size, LB_MEMORY_CTRL,
 			LB_MEMORY_SIZE);
 
 	dm_write_reg(xfm80->base.ctx, LB_REG(mmLB_MEMORY_CTRL), value);
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/hw/transform.h b/drivers/gpu/drm/amd/dal/dc/inc/hw/transform.h
index 8053455ffdbf..31547406aa31 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/hw/transform.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/hw/transform.h
@@ -40,6 +40,7 @@ struct transform {
 
 	int lb_total_entries_num;
 	int lb_bits_per_entry;
+	unsigned int lb_memory_size;
 };
 
 enum lb_pixel_depth {
-- 
2.10.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux