miatoll: Pull brightness overlays from raviole

Adapted for miatoll's display specifications (450 nits),
converted floats to integers.

Change-Id: I7936e8b10d9ac6bc74efc8fdf6623c827d65c6da
This commit is contained in:
Alexander Winkowski 2022-08-07 09:43:49 +00:00
parent 0d65ed389c
commit 6417e2be02
No known key found for this signature in database
GPG Key ID: 72762A66704CDE44

View File

@ -42,16 +42,28 @@
lux * (1.0f + CONSTRAINT_VALUE). When the current lux is higher than this threshold, lux * (1.0f + CONSTRAINT_VALUE). When the current lux is higher than this threshold,
the screen brightness is recalculated. See the config_ambientThresholdLevels the screen brightness is recalculated. See the config_ambientThresholdLevels
description for how the constraint value is chosen. --> description for how the constraint value is chosen. -->
<array name="config_ambientBrighteningThresholds"> <integer-array name="config_ambientBrighteningThresholds">
<item>5</item> <item>11373</item>
<item>5</item> <item>5000</item>
<item>10</item> <item>4333</item>
<item>30</item> <item>3666</item>
<item>100</item> <item>3000</item>
<item>400</item> <item>2760</item>
<item>600</item> <item>2520</item>
<item>1000</item> <item>2280</item>
</array> <item>2040</item>
<item>1800</item>
<item>800</item>
<item>527</item>
<item>500</item>
<item>470</item>
<item>396</item>
<item>322</item>
<item>248</item>
<item>174</item>
<item>99</item>
<item>99</item>
</integer-array>
<!-- Array of hysteresis constraint values for darkening, represented as tenths of a <!-- Array of hysteresis constraint values for darkening, represented as tenths of a
percent. The length of this array is assumed to be one greater than percent. The length of this array is assumed to be one greater than
@ -59,16 +71,28 @@
lux * (1.0f - CONSTRAINT_VALUE). When the current lux is lower than this threshold, lux * (1.0f - CONSTRAINT_VALUE). When the current lux is lower than this threshold,
the screen brightness is recalculated. See the config_ambientThresholdLevels the screen brightness is recalculated. See the config_ambientThresholdLevels
description for how the constraint value is chosen. --> description for how the constraint value is chosen. -->
<array name="config_ambientDarkeningThresholds"> <integer-array name="config_ambientDarkeningThresholds">
<item>800</item> <item>853</item>
<item>800</item> <item>700</item>
<item>800</item> <item>683</item>
<item>800</item> <item>666</item>
<item>800</item> <item>650</item>
<item>640</item>
<item>630</item>
<item>620</item>
<item>610</item>
<item>600</item>
<item>500</item> <item>500</item>
<item>500</item> <item>500</item>
<item>500</item> <item>440</item>
</array> <item>385</item>
<item>348</item>
<item>311</item>
<item>274</item>
<item>237</item>
<item>200</item>
<item>200</item>
</integer-array>
<!-- Array of ambient lux threshold values. This is used for determining hysteresis constraint <!-- Array of ambient lux threshold values. This is used for determining hysteresis constraint
values by calculating the index to use for lookup and then setting the constraint value values by calculating the index to use for lookup and then setting the constraint value
@ -80,15 +104,27 @@
value < level[0] 0 value < level[0] 0
level[n] <= value < level[n+1] n+1 level[n] <= value < level[n+1] n+1
level[MAX] <= value MAX+1 --> level[MAX] <= value MAX+1 -->
<array name="config_ambientThresholdLevels"> <integer-array name="config_ambientThresholdLevels">
<item>1</item>
<item>2</item> <item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item> <item>10</item>
<item>20</item>
<item>30</item> <item>30</item>
<item>40</item>
<item>50</item>
<item>60</item>
<item>70</item>
<item>80</item>
<item>90</item>
<item>100</item> <item>100</item>
<item>800</item> </integer-array>
<item>2000</item>
<item>4000</item>
</array>
<!-- Array of desired screen brightness in nits corresponding to the lux values <!-- Array of desired screen brightness in nits corresponding to the lux values
in the config_autoBrightnessLevels array. As with config_screenBrightnessMinimumNits and in the config_autoBrightnessLevels array. As with config_screenBrightnessMinimumNits and
@ -101,68 +137,27 @@
This array should have size one greater than the size of the config_autoBrightnessLevels This array should have size one greater than the size of the config_autoBrightnessLevels
array. The brightness values must be non-negative and non-decreasing. This must be array. The brightness values must be non-negative and non-decreasing. This must be
overridden in platform specific overlays --> overridden in platform specific overlays -->
<array name="config_autoBrightnessDisplayValuesNits"> <integer-array name="config_autoBrightnessDisplayValuesNits">
<item>5</item> <item>5</item> <!-- 0 - 1 -->
<item>5</item> <item>10</item> <!-- 1 - 2 -->
<item>5</item> <item>18</item> <!-- 2 - 3 -->
<item>5</item> <item>22</item> <!-- 3 - 4 -->
<item>15</item> <item>24</item> <!-- 4 - 8 -->
<item>24</item> <item>31</item> <!-- 8 - 12 -->
<item>37</item> <item>35</item> <!-- 12 - 20 -->
<item>47</item> <item>41</item> <!-- 20 - 33 -->
<item>61</item> <item>48</item> <!-- 33 - 55 -->
<item>76</item> <item>56</item> <!-- 55 - 90 -->
<item>83</item> <item>66</item> <!-- 90 - 148 -->
<item>83</item> <item>80</item> <!-- 148 - 245 -->
<item>83</item> <item>98</item> <!-- 245 - 403 -->
<item>87</item> <item>125</item> <!-- 403 - 665 -->
<item>93</item> <item>162</item> <!-- 665 - 1097 -->
<item>107</item> <item>208</item> <!-- 1097 - 1808 -->
<item>117</item> <item>265</item> <!-- 1808 - 2981 -->
<item>124</item> <item>328</item> <!-- 2981 - 5000 -->
<item>133</item> <item>450</item> <!-- 5000+ -->
<item>166</item> </integer-array>
<item>182</item>
<item>270</item>
<item>315</item>
<item>373</item>
<item>442</item>
<item>455</item>
</array>
<!-- Array of output values for LCD backlight corresponding to the lux values
in the config_autoBrightnessLevels array. This array should have size one greater
than the size of the config_autoBrightnessLevels array.
The brightness values must be between 0 and 255 and be non-decreasing.
This must be overridden in platform specific overlays -->
<array name="config_autoBrightnessLcdBacklightValues">
<item>3</item>
<item>3</item>
<item>3</item>
<item>3</item>
<item>8</item>
<item>13</item>
<item>20</item>
<item>25</item>
<item>33</item>
<item>41</item>
<item>45</item>
<item>45</item>
<item>45</item>
<item>47</item>
<item>50</item>
<item>58</item>
<item>63</item>
<item>67</item>
<item>72</item>
<item>90</item>
<item>99</item>
<item>150</item>
<item>175</item>
<item>208</item>
<item>248</item>
<item>255</item>
</array>
<!-- Array of light sensor lux values to define our levels for auto backlight brightness support. <!-- Array of light sensor lux values to define our levels for auto backlight brightness support.
The N entries of this array define N + 1 control points as follows: The N entries of this array define N + 1 control points as follows:
@ -180,58 +175,33 @@
Spline interpolation is used to determine the auto-brightness Spline interpolation is used to determine the auto-brightness
backlight values for lux levels between these control points. backlight values for lux levels between these control points.
Must be overridden in platform specific overlays --> Must be overridden in platform specific overlays -->
<array name="config_autoBrightnessLevels"> <integer-array name="config_autoBrightnessLevels">
<item>1</item> <item>1</item>
<item>2</item> <item>2</item>
<item>3</item>
<item>4</item> <item>4</item>
<item>5</item>
<item>8</item> <item>8</item>
<item>13</item> <item>12</item>
<item>17</item> <item>20</item>
<item>21</item> <item>33</item>
<item>26</item> <item>55</item>
<item>30</item> <item>90</item>
<item>34</item> <item>148</item>
<item>39</item> <item>245</item>
<item>60</item> <item>403</item>
<item>140</item> <item>665</item>
<item>310</item> <item>1097</item>
<item>400</item> <item>1808</item>
<item>500</item> <item>2981</item>
<item>600</item> <item>5000</item>
<item>1000</item> </integer-array>
<item>1200</item>
<item>1500</item>
<item>2100</item>
<item>3000</item>
<item>3500</item>
<item>4000</item>
</array>
<!-- An array describing the screen's backlight values corresponding to the brightness <!-- An array describing the screen's backlight values corresponding to the brightness
values in the config_screenBrightnessNits array. --> values in the config_screenBrightnessNits array. -->
<array name="config_screenBrightnessBacklight"> <integer-array name="config_screenBrightnessBacklight">
<item>@null</item>
<item>1</item> <item>1</item>
<item>10</item>
<item>15</item>
<item>30</item>
<item>45</item>
<item>60</item>
<item>75</item>
<item>90</item>
<item>105</item>
<item>120</item>
<item>135</item>
<item>150</item>
<item>165</item>
<item>180</item>
<item>195</item>
<item>210</item>
<item>225</item>
<item>240</item>
<item>255</item> <item>255</item>
</array> </integer-array>
<!-- An array of floats describing the screen brightness in nits corresponding to the backlight <!-- An array of floats describing the screen brightness in nits corresponding to the backlight
values in the config_screenBrightnessBacklight array. On OLED displays these values values in the config_screenBrightnessBacklight array. On OLED displays these values
@ -239,80 +209,18 @@
Note that this value should *not* reflect the maximum brightness value for any high Note that this value should *not* reflect the maximum brightness value for any high
brightness modes but only the maximum brightness value obtainable in a sustainable manner. brightness modes but only the maximum brightness value obtainable in a sustainable manner.
This array should be equal in size to config_screenBrightnessBacklight --> This array should be equal in size to config_screenBrightnessBacklight -->
<array name="config_screenBrightnessNits"> <integer-array name="config_screenBrightnessNits">
<item>@null</item> <item>2</item>
<item>4</item> <item>450</item>
<item>22</item> </integer-array>
<item>30</item>
<item>68</item>
<item>95</item>
<item>133</item>
<item>165</item>
<item>192</item>
<item>218</item>
<item>255</item>
<item>290</item>
<item>326</item>
<item>352</item>
<item>384</item>
<item>399</item>
<item>422</item>
<item>432</item>
<item>442</item>
<item>455</item>
</array>
<!-- Array of hysteresis constraint values for brightening, represented as tenths of a
percent. The length of this array is assumed to be one greater than
config_screenThresholdLevels. The brightening threshold is calculated as
screenBrightness * (1.0f + CONSTRAINT_VALUE). When the new screen brightness is higher
than this threshold, it is applied. See the config_screenThresholdLevels description for
how the constraint value is chosen. -->
<array name="config_screenBrighteningThresholds">
<item>@null</item>
</array>
<!-- Array of hysteresis constraint values for darkening, represented as tenths of a
percent. The length of this array is assumed to be one greater than
config_screenThresholdLevels. The darkening threshold is calculated as
screenBrightness * (1.0f - CONSTRAINT_VALUE). When the new screen brightness is lower than
this threshold, it is applied. See the config_screenThresholdLevels description for how
the constraint value is chosen. -->
<array name="config_screenDarkeningThresholds">
<item>@null</item>
</array>
<!-- Array of screen brightness threshold values. This is used for determining hysteresis
constraint values by calculating the index to use for lookup and then setting the
constraint value to the corresponding value of the array. The new brightening hysteresis
constraint value is the n-th element of config_screenBrighteningThresholds, and the new
darkening hysteresis constraint value is the n-th element of
config_screenDarkeningThresholds.
The (zero-based) index is calculated as follows: (MAX is the largest index of the array)
condition calculated index
value < level[0] 0
level[n] <= value < level[n+1] n+1
level[MAX] <= value MAX+1 -->
<array name="config_screenThresholdLevels">
</array>
<!-- The maximum range of gamma adjustment possible using the screen
auto-brightness adjustment setting. -->
<fraction name="config_autoBrightnessAdjustmentMaxGamma">100%</fraction>
<!-- Stability requirements in milliseconds for accepting a new brightness level. This is used <!-- Stability requirements in milliseconds for accepting a new brightness level. This is used
for debouncing the light sensor. Different constants are used to debounce the light sensor for debouncing the light sensor. Different constants are used to debounce the light sensor
when adapting to brighter or darker environments. This parameter controls how quickly when adapting to brighter or darker environments. This parameter controls how quickly
brightness changes occur in response to an observed change in light level that exceeds the brightness changes occur in response to an observed change in light level that exceeds the
hysteresis threshold. --> hysteresis threshold. -->
<integer name="config_autoBrightnessBrighteningLightDebounce">1000</integer> <integer name="config_autoBrightnessBrighteningLightDebounce">2000</integer>
<integer name="config_autoBrightnessDarkeningLightDebounce">1000</integer> <integer name="config_autoBrightnessDarkeningLightDebounce">4000</integer>
<!-- Fast brightness animation ramp rate in brightness units per second-->
<integer name="config_brightness_ramp_rate_fast">308</integer>
<!-- Slow brightness animation ramp rate in brightness units per second-->
<integer name="config_brightness_ramp_rate_slow">246</integer>
<!-- Minimum screen brightness setting allowed by power manager. <!-- Minimum screen brightness setting allowed by power manager.
The user is forbidden from setting the brightness below this level. The user is forbidden from setting the brightness below this level.