From patchwork Fri Aug 26 23:02:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9302099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA83A607D8 for ; Fri, 26 Aug 2016 23:02:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D10CE29593 for ; Fri, 26 Aug 2016 23:02:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C59582965E; Fri, 26 Aug 2016 23:02:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BD79729593 for ; Fri, 26 Aug 2016 23:02:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AB986E100; Fri, 26 Aug 2016 23:02:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id B5A096E100 for ; Fri, 26 Aug 2016 23:02:45 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id i138so1237424wmf.3 for ; Fri, 26 Aug 2016 16:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=kUKAHHcNAsbdO0d67tuo5h7QsiweJudLvLmEoYTYTUQ=; b=CM5/ut+SyG2Y2lVZtJDd0kQrypav3iR4QwAKYQyRz7jkl3PiSIq8/i5FqANDgV5nS8 RT6nrvADjtVdm3VMWQTvXH26K+X63OVoHcETv4T6/kSu3G6FnHZ2Nh3ISjCs7+0KlnQr aJ6n6xdRuJIlkgf0sybi/v6fN1348QuWmLYVjNnsSuwXH5eW35MbImKhnRsdAT0AYTqv /PRMyFAHZSNPX25DneTTkzfn5VK1xIq7Anutzk9cGWOPOcHR8q3ce+8iEfXrckPIl9N5 72VkRBWqKKaVjRuw6CpZwjXXohKO5FnqNJQXo7ogJvW2C+enzF13DEBTGBPeOG5AOqNW KQ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kUKAHHcNAsbdO0d67tuo5h7QsiweJudLvLmEoYTYTUQ=; b=DvunPcsDuNvh1sR/BtHF41xVuyjRfCML1WoXsJMrzb+O1sepD9CVbKFiK/doJGjXLB sr/s7Y34Pa9bkGtfoNnryD7iUevdVYsFucmz3MNtJcsyrbAAjCBxAioPhjl/9Cy/xGnq zWMhFLB/9EngDk29YQSWmmk9y8Ra3Q6al813L+hVUld5H1uOrfFNwkzLJkgWX3DkakPt 7wIcjZIODf0Li1JXmQ9xxw2cPcRPpkX1ipaTC3xTbc3avYimbCldpCu0e6SK/ee6k9og XE7GEFWXLmHEqnL4qlY1RMDxekaDTfhLyVf6HxE1Ft2KpKr7juHbBDRy2RftqxAyQEnz f/DA== X-Gm-Message-State: AE9vXwM3Qfl4TUVj8toZw8kVnATyhTWbEffxJr+jMv8khqxPDajlH0ycOypNzwDivw/79A== X-Received: by 10.28.197.129 with SMTP id v123mr885816wmf.70.1472252564341; Fri, 26 Aug 2016 16:02:44 -0700 (PDT) Received: from twisty.fritz.box (x4d02c1c1.dyn.telefonica.de. [77.2.193.193]) by smtp.gmail.com with ESMTPSA id 4sm1095405wmu.2.2016.08.26.16.02.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Aug 2016 16:02:43 -0700 (PDT) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/atomic: Don't potentially reset color_mgmt_changed on successive property updates. Date: Sat, 27 Aug 2016 01:02:28 +0200 Message-Id: <1472252548-1722-1-git-send-email-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.7.0 Cc: Daniel Vetter , "# v4 . 6+" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Due to assigning the 'replaced' value instead of or'ing it, if drm_atomic_crtc_set_property() gets called multiple times, the last call will define the color_mgmt_changed flag, so a non-updating call to a property can reset the flag and prevent actual hw state updates required by preceding property updates. Signed-off-by: Mario Kleiner Cc: Daniel Vetter Cc: # v4.6+ Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_atomic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 8d2f111..3a985d6 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -475,7 +475,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, val, -1, &replaced); - state->color_mgmt_changed = replaced; + state->color_mgmt_changed |= replaced; return ret; } else if (property == config->ctm_property) { ret = drm_atomic_replace_property_blob_from_id(crtc, @@ -483,7 +483,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, val, sizeof(struct drm_color_ctm), &replaced); - state->color_mgmt_changed = replaced; + state->color_mgmt_changed |= replaced; return ret; } else if (property == config->gamma_lut_property) { ret = drm_atomic_replace_property_blob_from_id(crtc, @@ -491,7 +491,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, val, -1, &replaced); - state->color_mgmt_changed = replaced; + state->color_mgmt_changed |= replaced; return ret; } else if (crtc->funcs->atomic_set_property) return crtc->funcs->atomic_set_property(crtc, state, property, val);