drm/msm/sde: update release & retire fence timeline
Update release and retire fence timeline according to client requirement to align it with correct vsync boundary and avoid issues in jank cases. Change-Id: Ibee64f4feea2623e8bc8459273b7193d5e7bdacc Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org> Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
This commit is contained in:
parent
bd20893138
commit
fec05057ef
3 changed files with 29 additions and 9 deletions
|
@ -534,13 +534,7 @@ static int sde_connector_atomic_get_property(struct drm_connector *connector,
|
|||
|
||||
idx = msm_property_index(&c_conn->property_info, property);
|
||||
if (idx == CONNECTOR_PROP_RETIRE_FENCE)
|
||||
/*
|
||||
* Set a fence offset if not a virtual connector, so that the
|
||||
* fence signals after one additional commit rather than at the
|
||||
* end of the current one.
|
||||
*/
|
||||
rc = sde_fence_create(&c_conn->retire_fence, val,
|
||||
c_conn->connector_type != DRM_MODE_CONNECTOR_VIRTUAL);
|
||||
rc = sde_fence_create(&c_conn->retire_fence, val, 0);
|
||||
else
|
||||
/* get cached property value */
|
||||
rc = msm_property_atomic_get(&c_conn->property_info,
|
||||
|
|
|
@ -390,5 +390,22 @@ enum sde_csc_type sde_connector_get_csc_type(struct drm_connector *conn);
|
|||
*/
|
||||
int sde_connector_get_dpms(struct drm_connector *connector);
|
||||
|
||||
/**
|
||||
* sde_connector_needs_offset - adjust the output fence offset based on
|
||||
* display type
|
||||
* @connector: Pointer to drm connector object
|
||||
* Returns: true if offset is required, false for all other cases.
|
||||
*/
|
||||
static inline bool sde_connector_needs_offset(struct drm_connector *connector)
|
||||
{
|
||||
struct sde_connector *c_conn;
|
||||
|
||||
if (!connector)
|
||||
return false;
|
||||
|
||||
c_conn = to_sde_connector(connector);
|
||||
return (c_conn->connector_type != DRM_MODE_CONNECTOR_VIRTUAL);
|
||||
}
|
||||
|
||||
#endif /* _SDE_CONNECTOR_H_ */
|
||||
|
||||
|
|
|
@ -1674,19 +1674,28 @@ static int sde_crtc_atomic_get_property(struct drm_crtc *crtc,
|
|||
struct sde_crtc *sde_crtc;
|
||||
struct sde_crtc_state *cstate;
|
||||
int i, ret = -EINVAL;
|
||||
bool conn_offset = 0;
|
||||
|
||||
if (!crtc || !state) {
|
||||
SDE_ERROR("invalid argument(s)\n");
|
||||
} else {
|
||||
sde_crtc = to_sde_crtc(crtc);
|
||||
cstate = to_sde_crtc_state(state);
|
||||
|
||||
for (i = 0; i < cstate->num_connectors; ++i) {
|
||||
conn_offset = sde_connector_needs_offset(
|
||||
cstate->connectors[i]);
|
||||
if (conn_offset)
|
||||
break;
|
||||
}
|
||||
|
||||
i = msm_property_index(&sde_crtc->property_info, property);
|
||||
if (i == CRTC_PROP_OUTPUT_FENCE) {
|
||||
int offset = sde_crtc_get_property(cstate,
|
||||
CRTC_PROP_OUTPUT_FENCE_OFFSET);
|
||||
|
||||
ret = sde_fence_create(
|
||||
&sde_crtc->output_fence, val, offset);
|
||||
ret = sde_fence_create(&sde_crtc->output_fence, val,
|
||||
offset + conn_offset);
|
||||
if (ret)
|
||||
SDE_ERROR("fence create failed\n");
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue