Merge branch 'tizen' into sandbox/srk/hwc 99/150699/1
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 15 Sep 2017 14:41:44 +0000 (17:41 +0300)
committerKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 15 Sep 2017 14:41:44 +0000 (17:41 +0300)
Change-Id: I1516546b16a40946b3c5c30cf3774f4cdf6023be

1  2 
include/tdm.h
include/tdm_backend.h
include/tdm_common.h
src/tdm.c
src/tdm_output.c
src/tdm_private.h

diff --cc include/tdm.h
Simple merge
@@@ -524,116 -525,28 +526,138 @@@ typedef struct _tdm_func_output 
        tdm_error (*output_set_dpms_handler)(tdm_output *output,
                                                                                 tdm_output_dpms_handler func,
                                                                                 void *user_data);
 +      /**
 +       * @brief Creates a new window on the given display.
 +       * @param[in] output A output object
 +       * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
 +       * @return A created window object
 +       */
 +      tdm_hwc_window *(*output_create_hwc_window)(tdm_output *output, tdm_error *error);
 +
 +      /**
 +       * @brief Destroys the given window.
 +       * @param[in] output A output object
 +       * @param[in] window the pointer of the window to destroy
 +       * @return #TDM_ERROR_NONE if success. Otherwise, error value.
 +       */
 +      tdm_error (*output_destroy_hwc_window)(tdm_output *output, tdm_hwc_window *hwc_window);
 +
 +      /**
 +       * @brief Set the client(relative to the TDM) target buffer
 +       * @details Sets the buffer which will receive the output of client composition.
 +       * Window marked as TDM_COMPOSITION_CLIENT or TDM_COMPOSITION_DEVICE_CANDIDATE
 +       * will be composited into this buffer prior to the call to output_commit(),
 +       * and windows not marked as TDM_COMPOSITION_CLIENT and
 +       * TDM_COMPOSITION_DEVICE_CANDIDATE should be composited with this buffer by the
 +       * device.
 +       *
 +       * The buffer handle provided may be null if no windows are being composited by
 +       * the client. This must not result in an error (unless an invalid display
 +       * handle is also provided).
 +       *
 +       * The damage parameter describes a surface damage region as defined in the
 +       * description of hwc_window_set_surface_damage().
 +       *
 +       * Will be called before output_commit() if any of the layers are marked as
 +       * TDM_COMPOSITION_CLIENT or TDM_COMPOSITION_DEVICE_CANDIDATE. If no layers are
 +       * so marked, then it is not necessary to call this function. It is not necessary
 +       * to call output_validate() after changing the target through this function.
 +       * @param[in] output A output object
 +       * @param[in] target The new target buffer
 +       * @param[in] damage The surface damage region
 +       * @return #TDM_ERROR_NONE if success. Otherwise, error value.
 +       */
 +      tdm_error (*output_set_client_target_buffer)(tdm_output *output, tbm_surface_h target,
 +                                                                                               tdm_hwc_region damage);
 +
 +      /**
 +       * @brief Validate the output
 +       * @details Instructs the device to inspect all of the layer state and
 +       * determine if there are any composition type changes necessary before
 +       * presenting the output. Permitted changes are described in the definition
 +       * of tdm_composition_t above.
 +       * @param[in] output A output object
 +       * @param[out] num_types The number of composition type changes required by
 +       * the device; if greater than 0, the client must either set and validate new
 +       * types, or call output_accept_changes() to accept the changes returned by
 +       * output_get_changed_composition_types(); must be the same as the number of
 +       * changes returned by output_get_changed_composition_types (see the
 +       * declaration of that function for more information); pointer will be non-NULL
 +       * @return #TDM_ERROR_NONE if success. Otherwise, error value.
 +       */
 +      tdm_error (*output_validate)(tdm_output *output, uint32_t *num_types);
 +
 +      /**
 +       * @brief Get changed composition types
 +       * @details Retrieves the windows for which the device requires a different
 +       * composition type than had been set prior to the last call to output_validate().
 +       * The client will either update its state with these types and call
 +       * output_accept_changes, or will set new types and attempt to validate the
 +       * display again.
 +       * layers and types may be NULL to retrieve the number of elements which
 +       * will be returned. The number of elements returned must be the same as the
 +       * value returned in num_types from the last call to output_validate().
 +       * @param[in] output A output object
 +       * @param[out] num_elements If windows or types were NULL, the number of layers
 +       * and types which would have been returned; if both were non-NULL, the
 +       * number of elements returned in layers and types, which must not exceed
 +       * the value stored in num_elements prior to the call; pointer will be
 +       * non-NULL
 +       * @param[out] windows An array of windows
 +       * @param[out] composition_types An array of composition types, each
 +       * corresponding to an element of windows
 +       * @return #TDM_ERROR_NONE if success. Otherwise, error value.
 +       */
 +      tdm_error (*output_get_changed_composition_types)(tdm_output *output,
 +                                                                                                        uint32_t *num_elements,
 +                                                                                                        tdm_hwc_window **hwc_window,
 +                                                                                                        tdm_hwc_window_composition_t *composition_types);
 +      /**
 +       * @brief Accepts the changes required by the device
 +       * @details Accepts the changes required by the device from the previous
 +       * output_validate() call (which may be queried using
 +       * output_get_chaged_composition_types()) and revalidates the display. This
 +       * function is equivalent to requesting the changed types from
 +       * output_get_chaged_composition_types(), setting those types on the
 +       * corresponding windows, and then calling output_validate again.
 +       * After this call it must be valid to present this display. Calling this after
 +       * output_validate() returns 0 changes must succeed with TDM_ERROR_NONE, but
 +       * should have no other effect.
 +       * @param[in] output A output object
 +       * @return #TDM_ERROR_NONE if success. Otherwise, error value.
 +       */
 +      tdm_error (*output_accept_changes)(tdm_output *output);
 +
 +      /**
 +       * @brief Get a target surface queue
 +       * @param[in] output A output object
 +       * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
 +       * @return A surface queue
 +       */
 +      tbm_surface_queue_h (*output_get_target_surface_queue)(tdm_output *output,
 +                                                                                                                 tdm_error *error);
+       /**
+        * @brief Set DPMS of a output object asynchronously
+        * @param[in] output A output object
+        * @details This function can be NULL if an output doesn't support asynchronous
+        * DPMS control. Otherwise, an output should have #TDM_OUTPUT_CAPABILITY_ASYNC_DPMS
+        * flags which #output_get_capability returns. And if a output dpms handler is added with
+        * #output_set_dpms_handler, a backend module needs to call the output dpms handler
+        * to let the TDM frontend know the output DPMS change indeed.
+        * @param[in] dpms_value DPMS value
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        * @see #output_set_dpms_handler, #TDM_OUTPUT_CAPABILITY_ASYNC_DPMS
+        * @since 1.7.0
+        */
+       tdm_error (*output_set_dpms_async)(tdm_output *output, tdm_output_dpms dpms_value);
+       void (*reserved3)(void);
+       void (*reserved4)(void);
+       void (*reserved5)(void);
+       void (*reserved6)(void);
+       void (*reserved7)(void);
+       void (*reserved8)(void);
  } tdm_func_output;
  
  /**
Simple merge
diff --cc src/tdm.c
Simple merge
Simple merge
Simple merge