Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09f84dad authored by Park Ju Hyung's avatar Park Ju Hyung Committed by KakatkarAkshay
Browse files

techpack: display: add some bp hints to hot paths



Signed-off-by: default avatarPark Ju Hyung <qkrwngud825@gmail.com>
[@0ctobot: Adapted for 4.19]
Signed-off-by: default avatarAdam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: default avatarLibXZR <xzr467706992@163.com>
parent ea1dd125
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -5914,7 +5914,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;
	}
@@ -5925,13 +5925,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);
@@ -5969,7 +5969,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,
@@ -5987,14 +5987,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;
+5 −5
Original line number Diff line number Diff line
@@ -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);
@@ -328,7 +328,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;