All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: linux-kernel@vger.kernel.org
Cc: Peter Rosin <peda@axentia.se>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Sean Paul <seanpaul@chromium.org>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>
Subject: [PATCH v5 02/14] drm/atomic-helper: update lut props directly in ..._legacy_gamma_set
Date: Thu, 13 Jul 2017 18:25:26 +0200	[thread overview]
Message-ID: <20170713162538.22788-3-peda@axentia.se> (raw)
In-Reply-To: <20170713162538.22788-1-peda@axentia.se>

Do not waste cycles looking up the property id when we have the
actual property already.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/gpu/drm/drm_atomic_helper.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 0fed20692df4..a8f19127c29a 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3769,12 +3769,12 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
 				       struct drm_modeset_acquire_ctx *ctx)
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_mode_config *config = &dev->mode_config;
 	struct drm_atomic_state *state;
 	struct drm_crtc_state *crtc_state;
 	struct drm_property_blob *blob = NULL;
 	struct drm_color_lut *blob_data;
 	int i, ret = 0;
+	bool replaced;
 
 	state = drm_atomic_state_alloc(crtc->dev);
 	if (!state)
@@ -3805,20 +3805,10 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
 	}
 
 	/* Reset DEGAMMA_LUT and CTM properties. */
-	ret = drm_atomic_crtc_set_property(crtc, crtc_state,
-			config->degamma_lut_property, 0);
-	if (ret)
-		goto fail;
-
-	ret = drm_atomic_crtc_set_property(crtc, crtc_state,
-			config->ctm_property, 0);
-	if (ret)
-		goto fail;
-
-	ret = drm_atomic_crtc_set_property(crtc, crtc_state,
-			config->gamma_lut_property, blob->base.id);
-	if (ret)
-		goto fail;
+	replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
+	replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
+	replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
+	crtc_state->color_mgmt_changed |= replaced;
 
 	ret = drm_atomic_commit(state);
 
-- 
2.11.0

  parent reply	other threads:[~2017-07-13 16:24 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 16:25 [PATCH v5 00/14] improve the fb_setcmap helper Peter Rosin
2017-07-13 16:25 ` Peter Rosin
2017-07-13 16:25 ` [PATCH v5 01/14] drm: rename, adjust and export drm_atomic_replace_property_blob Peter Rosin
2017-07-13 16:25 ` Peter Rosin [this message]
2017-07-13 16:25 ` [PATCH v5 03/14] drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths Peter Rosin
2017-07-14 13:54   ` Daniel Vetter
2017-08-03 22:49     ` Peter Rosin
2017-08-04  9:38       ` Daniel Vetter
2017-08-04  9:38         ` Daniel Vetter
2017-08-04 10:30         ` [PATCH] staging: vboxvideo: remove dead gamma lut code Peter Rosin
2017-08-04 10:45           ` [RESEND PATCH] " Peter Rosin
2017-08-05 11:11             ` Hans de Goede
2017-08-05 11:11               ` Hans de Goede
2017-08-07  9:21             ` Daniel Vetter
2017-08-08 11:54               ` Peter Rosin
2017-08-09 15:14                 ` Daniel Vetter
2017-08-09 15:14                   ` Daniel Vetter
2017-07-13 16:25 ` [PATCH v5 04/14] drm: amd: remove dead code and pointless local lut storage Peter Rosin
2017-07-14 14:06   ` Alex Deucher
2017-07-14 14:06     ` Alex Deucher
2017-07-13 16:25 ` [PATCH v5 05/14] drm: armada: remove dead empty functions Peter Rosin
2017-07-13 16:25 ` [PATCH v5 06/14] drm: ast: remove dead code and pointless local lut storage Peter Rosin
2017-07-13 16:25 ` [PATCH v5 07/14] drm: cirrus: " Peter Rosin
2017-07-13 16:25 ` Peter Rosin
2017-07-13 16:25 ` [PATCH v5 08/14] drm: gma500: " Peter Rosin
2017-07-13 16:25 ` [PATCH v5 09/14] drm: i915: " Peter Rosin
2017-07-13 16:25 ` [PATCH v5 10/14] drm: mgag200: " Peter Rosin
2017-07-13 16:25 ` [PATCH v5 11/14] drm: nouveau: " Peter Rosin
2017-07-13 16:25 ` [PATCH v5 12/14] drm: radeon: " Peter Rosin
2017-07-14 14:06   ` Alex Deucher
2017-07-14 14:06     ` Alex Deucher
2017-07-13 16:25 ` [PATCH v5 13/14] drm: stm: " Peter Rosin
2017-07-17  9:47   ` Philippe CORNU
2017-07-17  9:47     ` Philippe CORNU
2017-07-13 16:25 ` [PATCH v5 14/14] drm: remove unused and redundant callbacks Peter Rosin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170713162538.22788-3-peda@axentia.se \
    --to=peda@axentia.se \
    --cc=airlied@linux.ie \
    --cc=boris.brezillon@free-electrons.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lionel.g.landwerlin@intel.com \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.