TDM_RETURN_IF_FAIL(private_output != NULL);
+ /* If value is extended value, we handle it as DPMS on in client side
+ * The extended DPMS value is valid only in server side.
+ * Or, need to export to client side also?
+ */
+ if (value > TDM_OUTPUT_DPMS_OFF)
+ value = TDM_OUTPUT_DPMS_ON;
+
if (private_output->dpms == value)
return;
/**
* @brief The output capability enumeration
* @details
- * @remark
+ * If a backend module provides #TDM_OUTPUT_CAPABILITY_EXTENDED_DPMS, we can set
+ * an extended DPMS mode to an output which a backend module supports.
+ * Don't use the low-4bit for an extended DPMS mode value. It's used for default
+ * DPMS modes.
*/
typedef enum {
TDM_OUTPUT_CAPABILITY_ASYNC_DPMS = (1 << 0), /**< if a outupt supports asynchronous DPMS operation */
TDM_OUTPUT_CAPABILITY_HWC = (1 << 1), /**< if a outupt supports hwc operation @since 2.0.0*/
+ TDM_OUTPUT_CAPABILITY_EXTENDED_DPMS = (1 << 2), /**< if a outupt supports extended DPMS operation @since 2.0.0 */
} tdm_output_capability;
/**
/* can't export VSYNC macro because we can't define the exact meaning of vsync off
* at this time. Does committing in standy mode work? Doesn't committing in suspend mode work?
*/
+#define TDM_OUTPUT_DPMS_DEFAULT_MASK 0xF
#define TDM_OUTPUT_DPMS_VSYNC_OFF_MASK 0x2
#define TDM_OUTPUT_DPMS_VSYNC_IS_OFF(dpms) ((dpms) & TDM_OUTPUT_DPMS_VSYNC_OFF_MASK)
tdm_func_output *func_output;
OUTPUT_FUNC_ENTRY();
+ if (dpms_value > TDM_OUTPUT_DPMS_OFF) {
+ if (dpms_value & TDM_OUTPUT_DPMS_DEFAULT_MASK) {
+ TDM_ERR("Don't use the low-4bit for an extended DPMS mode: dpms_value(%x)", dpms_value);
+ return TDM_ERROR_BAD_REQUEST;
+ }
+
+ if (!(private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_EXTENDED_DPMS)) {
+ TDM_ERR("output(%d) doesn't support the extended DPMS control: '%s'",
+ private_output->pipe, tdm_dpms_str(dpms_value));
+ return TDM_ERROR_BAD_REQUEST;
+ }
+ }
+
_pthread_mutex_lock(&private_display->lock);
if (private_output->waiting_dpms_change) {
return TDM_ERROR_BAD_REQUEST;
}
+ if (dpms_value > TDM_OUTPUT_DPMS_OFF) {
+ if (dpms_value & TDM_OUTPUT_DPMS_DEFAULT_MASK) {
+ TDM_ERR("Don't use the low-4bit for an extended DPMS mode: dpms_value(%x)", dpms_value);
+ return TDM_ERROR_BAD_REQUEST;
+ }
+
+ if (!(private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_EXTENDED_DPMS)) {
+ TDM_ERR("output(%d) doesn't support the extended DPMS control: '%s'",
+ private_output->pipe, tdm_dpms_str(dpms_value));
+ return TDM_ERROR_BAD_REQUEST;
+ }
+ }
+
_pthread_mutex_lock(&private_display->lock);
if (private_output->waiting_dpms_change) {