Re: [PATCH] drm/i915/dmc: Use RUNTIME_INFO->stp for DMC

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

 



On Wed, Jun 30, 2021 at 05:17:52PM -0700, Lucas De Marchi wrote:
On Wed, Jun 30, 2021 at 05:15:00PM -0700, Jose Souza wrote:
On Wed, 2021-06-30 at 17:01 -0700, Lucas De Marchi wrote:
Typo: RUNTIME_INFO->stp

On Wed, Jun 30, 2021 at 04:06:24PM -0700, Anusha Srivatsa wrote:
On the dmc side,we maintain a lookup table with different display
stepping-substepping combinations.

Instead of adding new table for every new platform, lets ues
the stepping info from RUNTIME_INFO(dev_priv)->step
Adding the helper intel_get_display_step().

Cc: Lucas De Marchi <lucas.demarchi@xxxxxxxxx>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@xxxxxxxxx>
---
drivers/gpu/drm/i915/display/intel_dmc.c | 49 ++++++++++++++++++++++--
1 file changed, 45 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index f8789d4543bf..c7ff7ff3f412 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -266,14 +266,55 @@ static const struct stepping_info icl_stepping_info[] = {
};

static const struct stepping_info no_stepping_info = { '*', '*' };
+struct stepping_info *display_step;
+
+static struct stepping_info *
+intel_get_display_stepping(struct intel_step_info step)
+{
+
+	switch (step.display_step) {
+	case STEP_A0:
+		display_step->stepping = 'A';
+		display_step->substepping = '0';
+		break;
+	case STEP_A2:
+		display_step->stepping = 'A';
+		display_step->substepping = '2';
+		break;
+	case STEP_B0:
+		display_step->stepping = 'B';
+		display_step->substepping = '0';
+		break;
+	case STEP_B1:
+		display_step->stepping = 'B';
+		display_step->substepping = '1';
+		break;
+	case STEP_C0:
+		display_step->stepping = 'C';
+		display_step->substepping = '0';
+		break;
+	case STEP_D0:
+		display_step->stepping = 'D';
+		display_step->substepping = '0';
+		break;
+	default:
+		display_step->stepping = '*';
+		display_step->substepping = '*';
+		break;
+	}


"crazy" idea that would avoid this type of conversion:
changing the step enum to be:


#define make_step(letter, num) (int)(((letter) << 8 ) | (num))

STEP_A0 = make_step('A', '0'),
STEP_A1 = make_step('A', '1'),

Looks a good idea to me, we could also keep it u8 using 4bits for each if there is memory concerns.

humn... indeed. Not much a concern actually, but not having to change
additional code is already a good thing.


I hope no stepping goes beyond Z9 :)

I take that out. Even if we would do (number - 'A'), there is not enough
room in 4bits to handle until Z. In fact we could go only until P8 - so
if we are going that route we will need to have some extra build checks
that we don't go beyond that.

Lucas De Marchi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



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

  Powered by Linux