[RenderEngine] Clamp input color for BT2020_PQ EOTF

Color input to EOTF for PQ transfer function is out-of-bounds [0.0, 1.0]
Reason being, texture2D returns values which is not in range [0.0, 1.0].
These returned values are passed as gl_FragColor.rgb to EOTF for PQ
transfer function. In EOTF, colors outside the range [0.0, 1.0] are
rendered as black resulting in artifacts while video playback.
Clamp the input color to the range [0.0, 1.0]

Bug: 118794307
Test: Youtube HDR video plays fine, also screenshots taken while playback
  does not have any artifacts.

Change-Id: I266f5a009c4c58924510283295757abae811a41e
diff --git a/services/surfaceflinger/RenderEngine/ProgramCache.cpp b/services/surfaceflinger/RenderEngine/ProgramCache.cpp
index 9dc6858..46402d5 100644
--- a/services/surfaceflinger/RenderEngine/ProgramCache.cpp
+++ b/services/surfaceflinger/RenderEngine/ProgramCache.cpp
@@ -220,7 +220,7 @@
                     const highp float c2 = (2413.0 / 4096.0) * 32.0;
                     const highp float c3 = (2392.0 / 4096.0) * 32.0;
 
-                    highp vec3 tmp = pow(color, 1.0 / vec3(m2));
+                    highp vec3 tmp = pow(clamp(color, 0.0, 1.0), 1.0 / vec3(m2));
                     tmp = max(tmp - c1, 0.0) / (c2 - c3 * tmp);
                     return pow(tmp, 1.0 / vec3(m1));
                 }