techpack: display: Add some bp hints to hot paths
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Change-Id: Ife3962a0ae501fc2148be351eb61f1322eb56470
This commit is contained in:
committed by
Wiktor Rudzki
parent
d429f1b5c0
commit
26e90dd3fc
@@ -5607,7 +5607,7 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc,
|
||||
uint64_t fence_user_fd;
|
||||
uint64_t __user prev_user_fd;
|
||||
|
||||
if (!crtc || !state || !property) {
|
||||
if (unlikely(!crtc || !state || !property)) {
|
||||
SDE_ERROR("invalid argument(s)\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -5618,13 +5618,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);
|
||||
@@ -5662,7 +5662,7 @@ 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 = copy_from_user(&prev_user_fd, (void __user *)val,
|
||||
@@ -5680,14 +5680,14 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc,
|
||||
if (prev_user_fd == -1) {
|
||||
ret = _sde_crtc_get_output_fence(crtc, state,
|
||||
&fence_user_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_user_fd, sizeof(uint64_t));
|
||||
if (ret) {
|
||||
if (unlikely(ret)) {
|
||||
SDE_ERROR("copy to user failed rc:%d\n", ret);
|
||||
put_unused_fd(fence_user_fd);
|
||||
ret = -EFAULT;
|
||||
|
||||
@@ -192,13 +192,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 = kzalloc(sizeof(*sde_fence), GFP_KERNEL);
|
||||
if (!sde_fence)
|
||||
if (unlikely(!sde_fence))
|
||||
return -ENOMEM;
|
||||
|
||||
sde_fence->ctx = fence_ctx;
|
||||
@@ -210,7 +210,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)) {
|
||||
SDE_ERROR("failed to get_unused_fd_flags(), %s\n",
|
||||
sde_fence->name);
|
||||
dma_fence_put(&sde_fence->base);
|
||||
@@ -219,7 +219,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;
|
||||
SDE_ERROR("couldn't create fence, %s\n", sde_fence->name);
|
||||
@@ -327,7 +327,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;
|
||||
|
||||
Reference in New Issue
Block a user