Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I added some minor stuff. Note 8 tester would be higly apriciated(?) before release. #3

Open
wants to merge 4 commits into
base: lineage-20.0
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
smart_dimming: add Note 8 support
opensourcefreak committed Jul 31, 2023
commit 7a3b2d4456182b15f86cecd1d450ee62f9d82070
Original file line number Diff line number Diff line change
@@ -139,7 +139,11 @@ static u8 great_a3_sa_mps_table[][1] = { { 0xCC }, { 0xDC } };
static u8 great_a3_sa_elvss_table[][S6E3HA6_TOTAL_NR_LUMINANCE][1] = {
{
/* OVER_ZERO */
#ifdef CONFIG_PANEL_SMART_DIMMING
{ 0x0B }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0C },
#else
{ 0x0A }, { 0x0A }, { 0x0A }, { 0x0A }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0C },
#endif
{ 0x0D }, { 0x0E }, { 0x0F }, { 0x11 }, { 0x13 }, { 0x15 }, { 0x15 }, { 0x15 },
{ 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 },
{ 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 },
@@ -158,7 +162,11 @@ static u8 great_a3_sa_elvss_table[][S6E3HA6_TOTAL_NR_LUMINANCE][1] = {
},
{
/* UNDER_ZERO */
#ifdef CONFIG_PANEL_SMART_DIMMING
{ 0x0B }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0C },
#else
{ 0x0A }, { 0x0A }, { 0x0A }, { 0x0A }, { 0x0B }, { 0x0B }, { 0x0B }, { 0x0C },
#endif
{ 0x0D }, { 0x0E }, { 0x0F }, { 0x11 }, { 0x13 }, { 0x15 }, { 0x15 }, { 0x15 },
{ 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 },
{ 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 }, { 0x15 },
@@ -1772,7 +1780,11 @@ DEFINE_VARIABLE_PACKET(great_a3_sa_gram_img_pattern_1, DSI_PKT_TYPE_WR_MEM, GREA
#endif

DEFINE_VARIABLE_PACKET(great_a3_sa_gamma, DSI_PKT_TYPE_WR, GREAT_A3_SA_GAMMA, &great_a3_sa_maptbl[GAMMA_MAPTBL], 1);
#ifndef CONFIG_PANEL_SMART_DIMMING
DEFINE_VARIABLE_PACKET(great_a3_sa_aor, DSI_PKT_TYPE_WR, GREAT_A3_SA_AOR, &great_a3_sa_maptbl[AOR_MAPTBL], 1);
#else
DEFINE_STATIC_PACKET(great_a3_sa_aor, DSI_PKT_TYPE_WR, GREAT_A3_SA_AOR);
#endif

static struct pkt_update_info pktui_great_a3_sa_tset_mps_elvss[] = {
{ .offset = 1, .maptbl = &great_a3_sa_maptbl[TSET_MAPTBL] },
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@
* LDI : S6E3HA6
* PANEL : GREAT_A3_SA
*/
#ifndef CONFIG_PANEL_SMART_DIMMING
/* gray scale offset values */
static s32 great_a3_sa_rtbl2nit[11] = { 0, 0, 40, 39, 34, 30, 25, 19, 11, 7, 0 };
static s32 great_a3_sa_rtbl3nit[11] = { 0, 0, 33, 31, 27, 24, 20, 17, 10, 8, 0 };
@@ -250,6 +251,88 @@ static struct dimming_lut great_a3_sa_dimming_lut[] = {
DIM_LUT_V0_INIT(420, 420, GAMMA_2_20, great_a3_sa_rtbl420nit, great_a3_sa_ctbl420nit),
};

#else
static s32 rtbl420nit[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static s32 ctbl420nit[33] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

static struct dimming_lut great_a3_sa_dimming_lut[] = {
DIM_LUT_V0_INIT(2, 6, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(3, 6, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(4, 7, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(5, 7, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(6, 8, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(7, 8, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(8, 9, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(9, 9, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(10, 10, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(11, 11, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(12, 12, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(13, 13, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(14, 14, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(15, 15, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(16, 16, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(17, 17, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(19, 19, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(20, 20, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(21, 21, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(22, 22, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(24, 24, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(25, 25, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(27, 27, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(29, 29, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(30, 30, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(32, 32, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(34, 34, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(37, 37, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(39, 39, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(41, 41, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(44, 44, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(47, 47, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(50, 50, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(53, 53, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(56, 56, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(60, 60, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(64, 64, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(68, 68, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(72, 72, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(77, 77, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(82, 82, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(87, 87, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(93, 93, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(98, 98, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(105, 105, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(111, 111, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(119, 119, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(126, 126, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(134, 134, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(143, 143, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(152, 152, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(162, 162, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(172, 172, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(183, 183, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(195, 195, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(207, 207, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(220, 220, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(234, 234, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(249, 249, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(265, 265, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(282, 282, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(300, 300, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(316, 316, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(333, 333, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(350, 350, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(357, 357, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(365, 365, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(372, 372, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(380, 380, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(387, 387, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(395, 395, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(403, 403, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(412, 412, GAMMA_2_15, rtbl420nit, ctbl420nit),
DIM_LUT_V0_INIT(420, 420, GAMMA_2_20, rtbl420nit, ctbl420nit),
};
#endif

#if PANEL_BACKLIGHT_PAC_STEPS == 512
static unsigned int great_a3_sa_brt_to_step_tbl[S6E3HA6_TOTAL_PAC_STEPS] = {
0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500,