[hwc] add new composition type TDM_COMPOSITION_CLIENT_CANDIDATE 42/155542/1
authorSergey Sizonov <s.sizonov@samsung.com>
Fri, 13 Oct 2017 10:18:03 +0000 (13:18 +0300)
committerSergey Sizonov <s.sizonov@samsung.com>
Fri, 13 Oct 2017 12:09:50 +0000 (15:09 +0300)
If a window with the device composition type changes a type
to the client composition type (by the e20 demands or by
the driver demands) we got the flickering as a buffer owned by
this window can't be composited to the fb_target immediately.

That's why we need the new transition type between the
TDM_COMPOSITION_DEVICE and the TDM_COMPOSITION_CLIENT.

Change-Id: I56c5c20b206c5f8083123c2ca189a0d2e071faf6
Signed-off-by: Sergey Sizonov <s.sizonov@samsung.com>
include/tdm_types.h

index 56e3616..0c68217 100644 (file)
@@ -146,11 +146,47 @@ typedef enum {
         * User can choose this type for window to avoid a hardware composition for
         * this window.
         *
+        * User has to set this type for the window which has the TDM_COMPOSITION_CLIENT_CANDIDATE
+        * type. (see the TDM_COMPOSITION_CLIENT_CANDIDATE type)
+        *
         * The device must not request any composition type changes for windows of
         * this type.
         */
        TDM_COMPOSITION_CLIENT = 0,
 
+       /* Set by the HWC after tdm_output_validate().
+        *
+        * If the HWC decided that it doesn't want/can't to continue the composition for
+        * this window through a hardware overlay or other similar way it'll change
+        * a type to the TDM_COMPOSITION_CLIENT_CANDIDATE type.
+        *
+        * This transition can happen only if the window has the TDM_COMPOSITION_DEVICE
+        * type already.
+        *
+        * If an user changed type of a window from the TDM_COMPOSITION_DEVICE type to the
+        * the TDM_COMPOSITION_CLIENT type, the type will be rejected to the
+        * TDM_COMPOSITION_CLIENT_CANDIDATE type.
+        *
+        * The user has to composite this window itself.
+        *
+        * The underlying hardware overlay is owned by this window till a type being
+        * changed to the TDM_COMPOSITION_CLIENT type, but it's not possible to set a
+        * buffer for this window after a type's been changed to the
+        * TDM_COMPOSITION_CLIENT_CANDIDATE type.
+        *
+        * This transitional state is used to get rid of blinking at a transition from
+        * the TDM_COMPOSITION_DEVICE type to the TDM_COMPOSITION_CLIENT type where the hw
+        * has to wait till a buffer, which was on a hw overlay, get composited to the
+        * fb_target and only after this happens unset(or set another window on) this
+        * hw overlay.
+        *
+        * User has to inform the HWC (the HWC got no way to know when it happens) after a buffer,
+        * which was on a hw overlay, get composited to the fb_target by setting a type of this
+        * window to the TDM_COMPOSITION_CLIENT type, it causes a type of this window being changed
+        * to TDM_COMPOSITION_CLIENT.
+        */
+       TDM_COMPOSITION_CLIENT_CANDIDATE = 5,
+
        /** Set by the client before tdm_output_validate().
         *
         * Upon tdm_output_validate(), the device may request a change from this type to