From patchwork Fri Aug 14 06:57:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1344662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BSZ5g4n62z9sTR; Fri, 14 Aug 2020 16:58:15 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1k6TfG-0007gT-56; Fri, 14 Aug 2020 06:58:10 +0000 Received: from mail-pf1-f196.google.com ([209.85.210.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k6TfD-0007c2-3a for kernel-team@lists.ubuntu.com; Fri, 14 Aug 2020 06:58:07 +0000 Received: by mail-pf1-f196.google.com with SMTP id m71so4115554pfd.1 for ; Thu, 13 Aug 2020 23:58:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gOuWBci6hyZEBEL10FXGdk6gU249n9BR2r9VDKOSQwc=; b=L3ZwiKBwL0HcOToChkzOo26QFSgbZiZPxtE61ORu7zozFLI4c0ajwdMmX+FrARZQ+C nXzMK2ljCE3M/JzoQKkwsYsIUWkeiF2yMNQSXc43eEL5Kn3lE8wVRnx0B24qD+XOcASq wxvUNg6uX91W2d/lwyYGTO+bfGpOdywmUI3grEHlhACdEm0h4nr+peapOKxAPpdfEUMZ MkWPehn+ldUJ8WZWG/2sbZ18YVWnsKW3hwevU7nSFx/UQb3JsJjUwhXyylBFFV0f/Ntt QINTToPq/pp2cdN9OFCT89WmcJZATIzcDfdVGg94vqwSMVE1SdAr35YTXIVFAOI7IS/X Iwcw== X-Gm-Message-State: AOAM533DCPtzCuV/7M44wnHm3+EmIxf6XUn9kQ8Snb6dtAY7b+0Wd8of W8m2NWWDLaX29kCt06UDAndRqHzlECEfEw== X-Google-Smtp-Source: ABdhPJwpaV8zsBPu4XQTkBSuR3rYFLe+A1Ktr2/uaKnWJIjC6fP1aYDUcuR5d7UHdCmBk8h0/72yiw== X-Received: by 2002:a63:d62:: with SMTP id 34mr874609pgn.179.1597388283413; Thu, 13 Aug 2020 23:58:03 -0700 (PDT) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id e9sm8297614pfh.151.2020.08.13.23.58.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2020 23:58:02 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 07/31][SRU][OEM-5.6] drm/i915: swap() the entire cdclk state Date: Fri, 14 Aug 2020 14:57:16 +0800 Message-Id: <20200814065740.276039-8-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200814065740.276039-1-vicamo.yang@canonical.com> References: <20200814065740.276039-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.196; envelope-from=vicamo@gmail.com; helo=mail-pf1-f196.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Ville Syrjälä BugLink: https://bugs.launchpad.net/bugs/1891451 To make life less confusing let's swap() the entire cdclk state rather than swapping some parts, copying other parts, and leaving the rest just as is. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200120174728.21095-11-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak (cherry picked from commit 4c029c499fb446d97b85509c151f8564dfe1dcc3) Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/i915/display/intel_cdclk.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c index e219b2fb986c..2a4540d426fd 100644 --- a/drivers/gpu/drm/i915/display/intel_cdclk.c +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -1847,19 +1847,7 @@ void intel_cdclk_swap_state(struct intel_atomic_state *state) { struct drm_i915_private *dev_priv = to_i915(state->base.dev); - /* FIXME maybe swap() these too */ - memcpy(dev_priv->cdclk_state.min_cdclk, - state->cdclk_state.min_cdclk, - sizeof(state->cdclk_state.min_cdclk)); - memcpy(dev_priv->cdclk_state.min_voltage_level, - state->cdclk_state.min_voltage_level, - sizeof(state->cdclk_state.min_voltage_level)); - - dev_priv->cdclk_state.force_min_cdclk = - state->cdclk_state.force_min_cdclk; - - swap(state->cdclk_state.logical, dev_priv->cdclk_state.logical); - swap(state->cdclk_state.actual, dev_priv->cdclk_state.actual); + swap(state->cdclk_state, dev_priv->cdclk_state); } void intel_dump_cdclk_config(const struct intel_cdclk_config *cdclk_config, @@ -1915,7 +1903,7 @@ intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state) /* called after intel_cdclk_swap_state()! */ const struct intel_cdclk_state *old_cdclk_state = &state->cdclk_state; const struct intel_cdclk_state *new_cdclk_state = &dev_priv->cdclk_state; - enum pipe pipe = old_cdclk_state->pipe; /* not swapped */ + enum pipe pipe = new_cdclk_state->pipe; if (pipe == INVALID_PIPE || old_cdclk_state->actual.cdclk <= new_cdclk_state->actual.cdclk) @@ -1936,7 +1924,7 @@ intel_set_cdclk_post_plane_update(struct intel_atomic_state *state) /* called after intel_cdclk_swap_state()! */ const struct intel_cdclk_state *old_cdclk_state = &state->cdclk_state; const struct intel_cdclk_state *new_cdclk_state = &dev_priv->cdclk_state; - enum pipe pipe = old_cdclk_state->pipe; /* not swapped */ + enum pipe pipe = new_cdclk_state->pipe; if (pipe != INVALID_PIPE && old_cdclk_state->actual.cdclk > new_cdclk_state->actual.cdclk)