disp: msm: sde: avoid duplicate fence create from client
SDE fence driver avoids duplicate fence creation if fence timeline is not increased. This may lead to issue if client closes the fence with failure ATOMIC_COMMIT. SDE fence driver provides the closed fd node to subsequent valid commit and leads to invalid state. This patch avoids duplicate fence creation from crtc and connector object instead of sde_fence. Change-Id: Ic7b43762f0ad251fb20e42edb5f4d5f401790e14 Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
这个提交包含在:
@@ -325,9 +325,8 @@ int sde_fence_create(struct sde_fence_context *ctx, uint64_t *val,
|
||||
uint32_t offset)
|
||||
{
|
||||
uint32_t trigger_value;
|
||||
int fd = -1, rc = -EINVAL;
|
||||
int fd, rc = -EINVAL;
|
||||
unsigned long flags;
|
||||
struct sde_fence *fc;
|
||||
|
||||
if (!ctx || !val) {
|
||||
SDE_ERROR("invalid argument(s), fence %d, pval %d\n",
|
||||
@@ -347,22 +346,10 @@ int sde_fence_create(struct sde_fence_context *ctx, uint64_t *val,
|
||||
trigger_value = ctx->commit_count + offset;
|
||||
spin_unlock_irqrestore(&ctx->lock, flags);
|
||||
|
||||
spin_lock(&ctx->list_lock);
|
||||
list_for_each_entry(fc, &ctx->fence_list_head, fence_list) {
|
||||
if (trigger_value == fc->base.seqno) {
|
||||
fd = fc->fd;
|
||||
*val = fd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock(&ctx->list_lock);
|
||||
|
||||
if (fd < 0) {
|
||||
fd = _sde_fence_create_fd(ctx, trigger_value);
|
||||
*val = fd;
|
||||
SDE_DEBUG("fd:%d trigger:%d commit:%d offset:%d\n",
|
||||
fd, trigger_value, ctx->commit_count, offset);
|
||||
}
|
||||
fd = _sde_fence_create_fd(ctx, trigger_value);
|
||||
*val = fd;
|
||||
SDE_DEBUG("fd:%d trigger:%d commit:%d offset:%d\n",
|
||||
fd, trigger_value, ctx->commit_count, offset);
|
||||
|
||||
SDE_EVT32(ctx->drm_id, trigger_value, fd);
|
||||
rc = (fd >= 0) ? 0 : fd;
|
||||
|
在新工单中引用
屏蔽一个用户