mirror of https://lore.kernel.org/lkml/
 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,
	Boris Brezillon <boris.brezillon@free-electrons.com>
Subject: [PATCH v4 02/14] drm/atomic-helper: update lut props directly in ..._legacy_gamma_set
Date: Thu,  6 Jul 2017 14:20:36 +0200	[thread overview]
Message-ID: <1499343648-29695-3-git-send-email-peda@axentia.se> (raw)
In-Reply-To: <1499343648-29695-1-git-send-email-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 | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 667ec97..5a4a344 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3769,11 +3769,11 @@ 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;
+	bool replaced = false;
 	int i, ret = 0;
 
 	state = drm_atomic_state_alloc(crtc->dev);
@@ -3805,20 +3805,13 @@ 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;
+	drm_atomic_replace_property_blob(&crtc_state->degamma_lut,
+					 NULL, &replaced);
+	drm_atomic_replace_property_blob(&crtc_state->ctm,
+					 NULL, &replaced);
+	drm_atomic_replace_property_blob(&crtc_state->gamma_lut,
+					 blob, &replaced);
+	crtc_state->color_mgmt_changed |= replaced;
 
 	ret = drm_atomic_commit(state);
 
-- 
2.1.4

  parent reply	other threads:[~2017-07-06 12:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 12:20 [PATCH v4 00/14] improve the fb_setcmap helper Peter Rosin
2017-07-06 12:20 ` [PATCH v4 01/14] drm/atomic: export drm_atomic_replace_property_blob Peter Rosin
2017-07-11  8:01   ` Daniel Vetter
2017-07-11 12:06     ` Peter Rosin
2017-07-06 12:20 ` Peter Rosin [this message]
2017-07-11  8:02   ` [PATCH v4 02/14] drm/atomic-helper: update lut props directly in ..._legacy_gamma_set Daniel Vetter
2017-07-11 13:08     ` Peter Rosin
2017-07-06 12:20 ` [PATCH v4 03/14] drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths Peter Rosin
2017-07-11  8:10   ` Daniel Vetter
2017-07-11 12:12     ` Peter Rosin
2017-07-12  7:03       ` Daniel Vetter
2017-07-12  7:47         ` Peter Rosin
2017-07-13 12:42           ` Daniel Vetter
2017-07-06 12:20 ` [PATCH v4 04/14] drm: amd: remove dead code and pointless local lut storage Peter Rosin
2017-07-06 12:20 ` [PATCH v4 05/14] drm: armada: remove dead empty functions Peter Rosin
2017-07-06 12:20 ` [PATCH v4 06/14] drm: ast: remove dead code and pointless local lut storage Peter Rosin
2017-07-06 12:20 ` [PATCH v4 07/14] drm: cirrus: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 08/14] drm: gma500: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 09/14] drm: i915: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 10/14] drm: mgag200: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 11/14] drm: nouveau: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 12/14] drm: radeon: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 13/14] drm: stm: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 14/14] drm: remove unused and redundant callbacks Peter Rosin
2017-07-11  8:13   ` Daniel Vetter
2017-07-11 12:13     ` 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=1499343648-29695-3-git-send-email-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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®