Commit c282e18
committed
Set right dimmingRatio for fp16 input layers without metadata
...since 1.0 == SDR white, we can program these layers by sending
SDR/HDR as the dimmingRatio to map the degamma'd value at HDR/SDR
to the max panel lux.
It's a little counter-intuitive at first glance, because we're sending a
dimming ratio < 1.0 for an HDR layer which looks like we're intending to
dim the layer. But it makes sense just from the math: layer_luminance =
panel_luminance * srgb_EOTF(layer_input) * (SDR_white / panel_luminance) =
srgb_EOTF(layer_input) * SDR_white. For an entirely SDR layer, then the
layer luminance is capped by SDR_white as desired, and for a layer that
was rendered with an HDR/SDR ratio then the layer luminance cancels out
to HDR_white == panel_luminance. And, we *are* dimming the layer: since
for a full range layer 1.0 before this infrastructure was in place would
have mapped to the max panel luminance.
Now, the HDR/SDR ratio may have differed by the time we hit the panel
(the layer is slightly in the past), but assuming the ratio changed slowly:
* If HDR/SDR increased, then we dim the layer a bit more than the
application intended, but the user does not notice because the SDR
white point stayed the same; the application just used less headroom
than it could have.
* If HDR/SDR decreased, then we dim the layer less than the application
intended, but the panel can just clip
Bug: 236745178
Flag: com.android.graphics.surfaceflinger.flags.fp16_client_target
Test: builds
Test: courage
Change-Id: I85a0d978f994d495e34dfbdd9dc7b03bd64f293c1 parent f74bfe1 commit c282e18
2 files changed
Lines changed: 19 additions & 7 deletions
File tree
- libs/ui/include_types/ui
- services/surfaceflinger/CompositionEngine/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
320 | 323 | | |
321 | 324 | | |
322 | 325 | | |
| |||
339 | 342 | | |
340 | 343 | | |
341 | 344 | | |
342 | | - | |
343 | | - | |
| 345 | + | |
| 346 | + | |
344 | 347 | | |
345 | 348 | | |
346 | 349 | | |
| |||
351 | 354 | | |
352 | 355 | | |
353 | 356 | | |
| 357 | + | |
354 | 358 | | |
355 | 359 | | |
356 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
357 | 365 | | |
358 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
359 | 369 | | |
| 370 | + | |
360 | 371 | | |
361 | 372 | | |
362 | 373 | | |
| |||
0 commit comments