mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
drm/msm/sde: Add some bp hints to hot paths
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Signed-off-by: UtsavisGreat <utsavbalar1231@gmail.com> Signed-off-by: Forenche <prahul2003@gmail.com> Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
parent
5f8ae038bb
commit
dd900c3f7b
@ -5968,7 +5968,7 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc,
|
||||
int idx, ret;
|
||||
uint64_t fence_fd;
|
||||
|
||||
if (!crtc || !state || !property) {
|
||||
if (unlikely(!crtc || !state || !property)) {
|
||||
SDE_ERROR("invalid argument(s)\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -5979,13 +5979,13 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc,
|
||||
SDE_ATRACE_BEGIN("sde_crtc_atomic_set_property");
|
||||
/* check with cp property system first */
|
||||
ret = sde_cp_crtc_set_property(crtc, property, val);
|
||||
if (ret != -ENOENT)
|
||||
if (unlikely(ret != -ENOENT))
|
||||
goto exit;
|
||||
|
||||
/* if not handled by cp, check msm_property system */
|
||||
ret = msm_property_atomic_set(&sde_crtc->property_info,
|
||||
&cstate->property_state, property, val);
|
||||
if (ret)
|
||||
if (unlikely(ret))
|
||||
goto exit;
|
||||
|
||||
idx = msm_property_index(&sde_crtc->property_info, property);
|
||||
@ -6023,18 +6023,18 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc,
|
||||
cstate->bw_split_vote = true;
|
||||
break;
|
||||
case CRTC_PROP_OUTPUT_FENCE:
|
||||
if (!val)
|
||||
if (unlikely(!val))
|
||||
goto exit;
|
||||
|
||||
ret = _sde_crtc_get_output_fence(crtc, state, &fence_fd);
|
||||
if (ret) {
|
||||
if (unlikely(ret)) {
|
||||
SDE_ERROR("fence create failed rc:%d\n", ret);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_fd,
|
||||
sizeof(uint64_t));
|
||||
if (ret) {
|
||||
if (unlikely(ret)) {
|
||||
SDE_ERROR("copy to user failed rc:%d\n", ret);
|
||||
put_unused_fd(fence_fd);
|
||||
ret = -EFAULT;
|
||||
|
@ -211,13 +211,13 @@ static int _sde_fence_create_fd(void *fence_ctx, uint32_t val)
|
||||
signed int fd = -EINVAL;
|
||||
struct sde_fence_context *ctx = fence_ctx;
|
||||
|
||||
if (!ctx) {
|
||||
if (unlikely(!ctx)) {
|
||||
SDE_ERROR("invalid context\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
sde_fence = kmem_cache_zalloc(kmem_fence_pool, GFP_KERNEL);
|
||||
if (!sde_fence)
|
||||
if (unlikely(!sde_fence))
|
||||
return -ENOMEM;
|
||||
|
||||
sde_fence->ctx = fence_ctx;
|
||||
@ -231,7 +231,7 @@ static int _sde_fence_create_fd(void *fence_ctx, uint32_t val)
|
||||
|
||||
/* create fd */
|
||||
fd = get_unused_fd_flags(0);
|
||||
if (fd < 0) {
|
||||
if (unlikely(fd < 0)) {
|
||||
#ifdef CONFIG_FENCE_DEBUG
|
||||
SDE_ERROR("failed to get_unused_fd_flags(), %s\n",
|
||||
sde_fence->name);
|
||||
@ -242,7 +242,7 @@ static int _sde_fence_create_fd(void *fence_ctx, uint32_t val)
|
||||
|
||||
/* create fence */
|
||||
sync_file = sync_file_create(&sde_fence->base);
|
||||
if (sync_file == NULL) {
|
||||
if (unlikely(sync_file == NULL)) {
|
||||
put_unused_fd(fd);
|
||||
fd = -EINVAL;
|
||||
#ifdef CONFIG_FENCE_DEBUG
|
||||
@ -362,7 +362,7 @@ int sde_fence_create(struct sde_fence_context *ctx, uint64_t *val,
|
||||
int fd, rc = -EINVAL;
|
||||
unsigned long flags;
|
||||
|
||||
if (!ctx || !val) {
|
||||
if (unlikely(!ctx || !val)) {
|
||||
SDE_ERROR("invalid argument(s), fence %d, pval %d\n",
|
||||
ctx != NULL, val != NULL);
|
||||
return rc;
|
||||
@ -388,7 +388,7 @@ int sde_fence_create(struct sde_fence_context *ctx, uint64_t *val,
|
||||
|
||||
SDE_EVT32(ctx->drm_id, trigger_value, fd);
|
||||
|
||||
if (fd >= 0) {
|
||||
if (likely(fd >= 0)) {
|
||||
rc = 0;
|
||||
_sde_fence_trigger(ctx, ktime_get(), false);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user