/**
* @brief Set the fps to a vblank object
* @details Default is the @b vertical @b refresh @b rate of the given output.
+ * It could be ignored when the fixed fps is set by #tdm_vblank_set_fixed_fps
* @param[in] vblank A vblank object
* @param[in] fps over 0
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
tdm_vblank_get_fps(tdm_vblank *vblank, unsigned int *fps);
/**
+ * @brief Set the fixed fps to a vblank object
+ * @details
+ * It could be ignored when the global fps is set by #tdm_vblank_enable_global_fps
+ * @param[in] vblank A vblank object
+ * @param[in] fps over 0
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_vblank_set_fixed_fps(tdm_vblank *vblank, unsigned int fps);
+
+/**
* @brief Ignore the vblank global fps
* @details
* The global fps will be applied to all client's vblanks for all outputs.
char name[TDM_NAME_LEN];
unsigned int fps;
unsigned int fps_changeable;
+ unsigned int fps_fixed;
int offset;
unsigned int enable_fake;
unsigned int ignore_global_fps;
TDM_RETURN_VAL_IF_FAIL(tdm_vblank_is_valid(vblank), TDM_ERROR_INVALID_PARAMETER);
TDM_RETURN_VAL_IF_FAIL(fps > 0, TDM_ERROR_INVALID_PARAMETER);
- if (private_vblank->fps != fps || private_vblank->fps_changeable)
- VIN("fps(%d) fps_changeable(0)", fps);
+ if (private_vblank->fps_fixed) {
+ VIN("fps(%d) can't be changed", private_vblank->fps);
+ return TDM_ERROR_NONE;
+ }
private_vblank->fps_changeable = 0;
private_vblank->fps = fps;
private_vblank->check_HW_or_SW = 1;
+ VIN("fps(%d) changed", fps);
+
return TDM_ERROR_NONE;
}
}
EXTERN tdm_error
+tdm_vblank_set_fixed_fps(tdm_vblank *vblank, unsigned int fps)
+{
+ tdm_private_vblank *private_vblank = vblank;
+
+ TDM_RETURN_VAL_IF_FAIL(tdm_vblank_is_valid(vblank), TDM_ERROR_INVALID_PARAMETER);
+ TDM_RETURN_VAL_IF_FAIL(fps > 0, TDM_ERROR_INVALID_PARAMETER);
+
+ private_vblank->fps_changeable = 0;
+ private_vblank->fps_fixed = 1;
+
+ if (private_vblank->fps == fps)
+ return TDM_ERROR_NONE;
+
+ private_vblank->fps = fps;
+ private_vblank->check_HW_or_SW = 1;
+
+ VIN("fps(%d) fixed", fps);
+
+ return TDM_ERROR_NONE;
+}
+
+EXTERN tdm_error
tdm_vblank_ignore_global_fps(tdm_vblank *vblank, unsigned int ignore)
{
tdm_private_vblank *private_vblank = vblank;