From patchwork Mon Sep 6 03:43:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Airlie X-Patchwork-Id: 12476271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F81CC4332F for ; Mon, 6 Sep 2021 03:51:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26FD560EB7 for ; Mon, 6 Sep 2021 03:51:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 26FD560EB7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 471D289A91; Mon, 6 Sep 2021 03:51:10 +0000 (UTC) Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0B00899F3 for ; Mon, 6 Sep 2021 03:51:04 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-UPv8sLviNKeF7rpYzHzduA-1; Sun, 05 Sep 2021 23:44:26 -0400 X-MC-Unique: UPv8sLviNKeF7rpYzHzduA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6390B80196C; Mon, 6 Sep 2021 03:44:25 +0000 (UTC) Received: from dreadlord-bne-redhat-com.bne.redhat.com (unknown [10.64.0.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D13A5D9DE; Mon, 6 Sep 2021 03:44:23 +0000 (UTC) From: Dave Airlie To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, Dave Airlie Date: Mon, 6 Sep 2021 13:43:55 +1000 Message-Id: <20210906034356.2946530-10-airlied@gmail.com> In-Reply-To: <20210906034356.2946530-1-airlied@gmail.com> References: <20210906034356.2946530-1-airlied@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: gmail.com Subject: [Intel-gfx] [PATCH 09/10] drm/i915/display: move drrs into display struct X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Dave Airlie Signed-off-by: Dave Airlie --- .../drm/i915/display/intel_display_debugfs.c | 2 +- drivers/gpu/drm/i915/display/intel_drrs.c | 32 +++++++++---------- drivers/gpu/drm/i915/display/intel_psr.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index 7221bf2e75b0..0fe8c1ec491f 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -1234,7 +1234,7 @@ static void drrs_status_per_crtc(struct seq_file *m, struct intel_crtc *crtc) { struct drm_i915_private *dev_priv = to_i915(dev); - struct i915_drrs *drrs = &dev_priv->drrs; + struct i915_drrs *drrs = &dev_priv->display.drrs; int vrefresh = 0; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; diff --git a/drivers/gpu/drm/i915/display/intel_drrs.c b/drivers/gpu/drm/i915/display/intel_drrs.c index 670bcd50a56f..2430041f4c53 100644 --- a/drivers/gpu/drm/i915/display/intel_drrs.c +++ b/drivers/gpu/drm/i915/display/intel_drrs.c @@ -69,7 +69,7 @@ intel_drrs_compute_config(struct intel_dp *intel_dp, return; if (!intel_connector->panel.downclock_mode || - dev_priv->drrs.type != SEAMLESS_DRRS_SUPPORT) + dev_priv->display.drrs.type != SEAMLESS_DRRS_SUPPORT) return; pipe_config->has_drrs = true; @@ -91,7 +91,7 @@ static void intel_drrs_set_state(struct drm_i915_private *dev_priv, const struct intel_crtc_state *crtc_state, int refresh_rate) { - struct intel_dp *intel_dp = dev_priv->drrs.dp; + struct intel_dp *intel_dp = dev_priv->display.drrs.dp; struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum drrs_refresh_rate_type index = DRRS_HIGH_RR; @@ -112,7 +112,7 @@ static void intel_drrs_set_state(struct drm_i915_private *dev_priv, return; } - if (dev_priv->drrs.type < SEAMLESS_DRRS_SUPPORT) { + if (dev_priv->display.drrs.type < SEAMLESS_DRRS_SUPPORT) { drm_dbg_kms(&dev_priv->drm, "Only Seamless DRRS supported.\n"); return; } @@ -121,7 +121,7 @@ static void intel_drrs_set_state(struct drm_i915_private *dev_priv, refresh_rate) index = DRRS_LOW_RR; - if (index == dev_priv->drrs.refresh_rate_type) { + if (index == dev_priv->display.drrs.refresh_rate_type) { drm_dbg_kms(&dev_priv->drm, "DRRS requested for previously set RR...ignoring\n"); return; @@ -165,7 +165,7 @@ static void intel_drrs_set_state(struct drm_i915_private *dev_priv, intel_de_write(dev_priv, reg, val); } - dev_priv->drrs.refresh_rate_type = index; + dev_priv->display.drrs.refresh_rate_type = index; drm_dbg_kms(&dev_priv->drm, "eDP Refresh Rate set to : %dHz\n", refresh_rate); @@ -176,8 +176,8 @@ intel_drrs_enable_locked(struct intel_dp *intel_dp) { struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); - dev_priv->drrs.busy_frontbuffer_bits = 0; - dev_priv->drrs.dp = intel_dp; + dev_priv->display.drrs.busy_frontbuffer_bits = 0; + dev_priv->display.drrs.dp = intel_dp; } /** @@ -191,7 +191,7 @@ void intel_drrs_enable(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); - struct i915_drrs *drrs = &dev_priv->drrs; + struct i915_drrs *drrs = &dev_priv->display.drrs; if (!crtc_state->has_drrs) return; @@ -216,7 +216,7 @@ intel_drrs_disable_locked(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); - struct i915_drrs *drrs = &dev_priv->drrs; + struct i915_drrs *drrs = &dev_priv->display.drrs; if (drrs->refresh_rate_type == DRRS_LOW_RR) { int refresh; @@ -238,7 +238,7 @@ void intel_drrs_disable(struct intel_dp *intel_dp, const struct intel_crtc_state *old_crtc_state) { struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); - struct i915_drrs *drrs = &dev_priv->drrs; + struct i915_drrs *drrs = &dev_priv->display.drrs; if (!old_crtc_state->has_drrs) return; @@ -269,7 +269,7 @@ intel_drrs_update(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); - struct i915_drrs *drrs = &dev_priv->drrs; + struct i915_drrs *drrs = &dev_priv->display.drrs; if (drrs->type != SEAMLESS_DRRS_SUPPORT) return; @@ -292,8 +292,8 @@ intel_drrs_update(struct intel_dp *intel_dp, static void intel_drrs_downclock_work(struct work_struct *work) { struct drm_i915_private *dev_priv = - container_of(work, typeof(*dev_priv), drrs.work.work); - struct i915_drrs *drrs = &dev_priv->drrs; + container_of(work, typeof(*dev_priv), display.drrs.work.work); + struct i915_drrs *drrs = &dev_priv->display.drrs; struct intel_dp *intel_dp; mutex_lock(&drrs->mutex); @@ -335,7 +335,7 @@ static void intel_drrs_downclock_work(struct work_struct *work) void intel_drrs_invalidate(struct drm_i915_private *dev_priv, unsigned int frontbuffer_bits) { - struct i915_drrs *drrs = &dev_priv->drrs; + struct i915_drrs *drrs = &dev_priv->display.drrs; struct intel_dp *intel_dp; struct drm_crtc *crtc; enum pipe pipe; @@ -382,7 +382,7 @@ void intel_drrs_invalidate(struct drm_i915_private *dev_priv, void intel_drrs_flush(struct drm_i915_private *dev_priv, unsigned int frontbuffer_bits) { - struct i915_drrs *drrs = &dev_priv->drrs; + struct i915_drrs *drrs = &dev_priv->display.drrs; struct intel_dp *intel_dp; struct drm_crtc *crtc; enum pipe pipe; @@ -439,7 +439,7 @@ intel_drrs_init(struct intel_connector *connector, struct drm_display_mode *fixed_mode) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct i915_drrs *drrs = &dev_priv->drrs; + struct i915_drrs *drrs = &dev_priv->display.drrs; struct drm_display_mode *downclock_mode = NULL; INIT_DELAYED_WORK(&drrs->work, intel_drrs_downclock_work); diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index b355c8d36b2d..be826ef8bd43 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1225,7 +1225,7 @@ void intel_psr_enable(struct intel_dp *intel_dp, if (!crtc_state->has_psr) return; - drm_WARN_ON(&dev_priv->drm, dev_priv->drrs.dp); + drm_WARN_ON(&dev_priv->drm, dev_priv->display.drrs.dp); mutex_lock(&intel_dp->psr.lock); intel_psr_enable_locked(intel_dp, crtc_state, conn_state); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4194a2042abf..daa289a0efab 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -867,6 +867,7 @@ struct drm_i915_display { wait_queue_head_t gmbus_wait_queue; struct intel_dmc dmc; + struct i915_drrs drrs; }; struct drm_i915_private { @@ -941,7 +942,6 @@ struct drm_i915_private { struct i915_hotplug hotplug; struct intel_fbc fbc; - struct i915_drrs drrs; struct intel_opregion opregion; struct intel_vbt_data vbt;