tdm_capture_commit(tdm_capture *capture)
{
tdm_buffer_info *b = NULL, *bb = NULL;
+ tdm_private_output *private_output;
CAPTURE_FUNC_ENTRY();
_pthread_mutex_lock(&private_display->lock);
+ private_output = private_capture->private_output;
+ if (private_output->current_dpms_value > TDM_OUTPUT_DPMS_ON) {
+ TDM_WRN("output(%d) dpms: %s", private_output->pipe,
+ dpms_str(private_output->current_dpms_value));
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_BAD_REQUEST;
+ }
+
if (!func_capture->capture_commit) {
_pthread_mutex_unlock(&private_display->lock);
TDM_DBG("failed: not implemented!!");
{ TDM_OUTPUT_DPMS_OFF, "off" },
};
-static type_name_fn(dpms)
+INTERN type_name_fn(dpms)
struct type_name status_names[] = {
{ TDM_OUTPUT_CONN_STATUS_DISCONNECTED, "disconnected" },
{ TDM_OUTPUT_CONN_STATUS_MODE_SETTED, "mode_setted" },
};
-static type_name_fn(status)
+INTERN type_name_fn(status)
EXTERN tdm_error
tdm_display_get_capabilities(tdm_display *dpy,
_pthread_mutex_lock(&private_display->lock);
+ if (private_output->current_dpms_value > TDM_OUTPUT_DPMS_ON) {
+ TDM_WRN("output(%d) dpms: %s", private_output->pipe,
+ dpms_str(private_output->current_dpms_value));
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_BAD_REQUEST;
+ }
+
func_output = &private_display->func_output;
if (!func_output->output_wait_vblank) {
_pthread_mutex_lock(&private_display->lock);
+ if (private_output->current_dpms_value > TDM_OUTPUT_DPMS_ON) {
+ TDM_WRN("output(%d) dpms: %s", private_output->pipe,
+ dpms_str(private_output->current_dpms_value));
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_BAD_REQUEST;
+ }
+
ret = _tdm_output_commit(output, sync, func, user_data);
_pthread_mutex_unlock(&private_display->lock);
}
ret = func_output->output_set_dpms(private_output->output_backend, dpms_value);
+ if (ret == TDM_ERROR_NONE)
+ private_output->current_dpms_value = dpms_value;
_pthread_mutex_unlock(&private_display->lock);
#define TDM_TRACE_END()
#endif
+#define prototype_name_fn(res) const char * res##_str(int type)
+
+prototype_name_fn(dpms);
+prototype_name_fn(status);
+
typedef enum {
TDM_CAPTURE_TARGET_OUTPUT,
TDM_CAPTURE_TARGET_LAYER,
tdm_output *output_backend;
unsigned int pipe;
+ tdm_output_dpms current_dpms_value;
int regist_vblank_cb;
int regist_commit_cb;