From patchwork Thu Nov 16 15:02:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juha-Pekka Heikkila X-Patchwork-Id: 13458007 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0AD6BC5ACB3 for ; Thu, 16 Nov 2023 15:02:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 603E410E610; Thu, 16 Nov 2023 15:02:36 +0000 (UTC) Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by gabe.freedesktop.org (Postfix) with ESMTPS id B43A910E610 for ; Thu, 16 Nov 2023 15:02:34 +0000 (UTC) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5079f9ec8d9so991511e87.0 for ; Thu, 16 Nov 2023 07:02:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700146952; x=1700751752; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=l2LsyBnmjU1iNwb2YdzyMKYKk3PKcP56TGoNBON9/3o=; b=ZZkY1gp33h1BvkRYslP01Hc5aSgsen3fPYG19qwkbRcoyguYUQFM1lj3Eyw0YGkJpd 68EOBkjwqm/29GMJ7QVi2LnwicEfyfdVEasfRWtxDDF27hvtCIhgpZAlDwEAcuR2gETO vU1kpG7yOHvzTlkCuM3obe/6sTVxjy/7mBzRMsE/GsXpGlV5t9blQ8NrU+EHkmAJitvp vycDIeuahBgK1UY9jfD+M7ZW7lRR/swktGHXFZ6o1zEHlaTYq3lIsXu9ydxYyFN5TxdU a1UpBFhaMHXt2ewtRak1apP7MwCn8OdawkV2WNuaF24VY1cBrEP87GuarnQWCvAj8T1I ynMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700146952; x=1700751752; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l2LsyBnmjU1iNwb2YdzyMKYKk3PKcP56TGoNBON9/3o=; b=wwlys0uQdjW81LG+3gZaGFBUPvCmDG4e4WGUbDTbnqMfCkmFBNbgP/Jv8rT/YbYKp5 Mp+9cgES3/LJ0rcmMQf6h/uOCd4uTGv2DBbVhVj6MX4aNRPWM04SF/tlZ/Lqk+UiiDTU DO2g5OsSlGsXp71/hrZqVYlo05tvxQlqhJi33NTQYxQ4j4DtN4VA0tMpHpjZ6Nm5p4M8 6kD26kcbH4EAGaxbSP16pWlAx9DJsZu9oLJLSR0SCCXfhcPlLaJg4ht7ue9ZqlEtqhgB NRYxIVinrU4vn5UgvcPh/hxm3gHYO72jOEcoSUZz9RBcQ8yPftHsKHcjw6Z5GRTiR9z2 NuUA== X-Gm-Message-State: AOJu0Yy33U9qA/qbLJh03UQtCSTI9sqfKRyL54NsW6m1qsOS+LBpj2mW SlXh6ompL3jVJqxGSpgsjclBJ8OolShdYA== X-Google-Smtp-Source: AGHT+IEMNlTo13LIpzX4eCKlFl+rNjPfQbZ7w4w74W3iwWisGYsH9YQM/EvuoRKbaYvcPCA0wRM22A== X-Received: by 2002:ac2:454e:0:b0:4fe:b97:e361 with SMTP id j14-20020ac2454e000000b004fe0b97e361mr756685lfm.18.1700146952201; Thu, 16 Nov 2023 07:02:32 -0800 (PST) Received: from jheikkil-mobl1.. ([2001:998:22:0:a48a:cde7:e984:4fbc]) by smtp.gmail.com with ESMTPSA id c27-20020ac25f7b000000b00500b561285bsm18055lfc.292.2023.11.16.07.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:02:31 -0800 (PST) From: Juha-Pekka Heikkila To: intel-gfx@lists.freedesktop.org Date: Thu, 16 Nov 2023 17:02:23 +0200 Message-Id: <20231116150225.204233-1-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/3] drm/i915/display: Separate xe and i915 common dpt code into own file 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" Here created intel_dpt_common.c to hold intel_dpt_configure which is needed for both xe and i915. Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Jouni Högander --- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_display.c | 1 + drivers/gpu/drm/i915/display/intel_dpt.c | 26 -------------- drivers/gpu/drm/i915/display/intel_dpt.h | 2 -- .../gpu/drm/i915/display/intel_dpt_common.c | 34 +++++++++++++++++++ .../gpu/drm/i915/display/intel_dpt_common.h | 13 +++++++ 6 files changed, 49 insertions(+), 28 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_dpt_common.c create mode 100644 drivers/gpu/drm/i915/display/intel_dpt_common.h diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 7e5d6a39d450..65e984242089 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -275,6 +275,7 @@ i915-y += \ display/intel_dpll.o \ display/intel_dpll_mgr.o \ display/intel_dpt.o \ + display/intel_dpt_common.o \ display/intel_drrs.o \ display/intel_dsb.o \ display/intel_dsb_buffer.o \ diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 125903007a29..c5bde50cd8e9 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -77,6 +77,7 @@ #include "intel_dpll.h" #include "intel_dpll_mgr.h" #include "intel_dpt.h" +#include "intel_dpt_common.h" #include "intel_drrs.h" #include "intel_dsb.h" #include "intel_dsi.h" diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c index 2b067cb952f0..b29bceff73f2 100644 --- a/drivers/gpu/drm/i915/display/intel_dpt.c +++ b/drivers/gpu/drm/i915/display/intel_dpt.c @@ -9,8 +9,6 @@ #include "gt/gen8_ppgtt.h" #include "i915_drv.h" -#include "i915_reg.h" -#include "intel_de.h" #include "intel_display_types.h" #include "intel_dpt.h" #include "intel_fb.h" @@ -318,27 +316,3 @@ void intel_dpt_destroy(struct i915_address_space *vm) i915_vm_put(&dpt->vm); } -void intel_dpt_configure(struct intel_crtc *crtc) -{ - struct drm_i915_private *i915 = to_i915(crtc->base.dev); - - if (DISPLAY_VER(i915) == 14) { - enum pipe pipe = crtc->pipe; - enum plane_id plane_id; - - for_each_plane_id_on_crtc(crtc, plane_id) { - if (plane_id == PLANE_CURSOR) - continue; - - intel_de_rmw(i915, PLANE_CHICKEN(pipe, plane_id), - PLANE_CHICKEN_DISABLE_DPT, - i915->display.params.enable_dpt ? 0 : - PLANE_CHICKEN_DISABLE_DPT); - } - } else if (DISPLAY_VER(i915) == 13) { - intel_de_rmw(i915, CHICKEN_MISC_2, - CHICKEN_MISC_DISABLE_DPT, - i915->display.params.enable_dpt ? 0 : - CHICKEN_MISC_DISABLE_DPT); - } -} diff --git a/drivers/gpu/drm/i915/display/intel_dpt.h b/drivers/gpu/drm/i915/display/intel_dpt.h index d9a166550185..e18a9f767b11 100644 --- a/drivers/gpu/drm/i915/display/intel_dpt.h +++ b/drivers/gpu/drm/i915/display/intel_dpt.h @@ -10,7 +10,6 @@ struct drm_i915_private; struct i915_address_space; struct i915_vma; -struct intel_crtc; struct intel_framebuffer; void intel_dpt_destroy(struct i915_address_space *vm); @@ -20,6 +19,5 @@ void intel_dpt_suspend(struct drm_i915_private *i915); void intel_dpt_resume(struct drm_i915_private *i915); struct i915_address_space * intel_dpt_create(struct intel_framebuffer *fb); -void intel_dpt_configure(struct intel_crtc *crtc); #endif /* __INTEL_DPT_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_dpt_common.c b/drivers/gpu/drm/i915/display/intel_dpt_common.c new file mode 100644 index 000000000000..cdba47165c04 --- /dev/null +++ b/drivers/gpu/drm/i915/display/intel_dpt_common.c @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +/* + * Copyright © 2023 Intel Corporation + */ + +#include "i915_reg.h" +#include "intel_de.h" +#include "intel_display_types.h" +#include "intel_dpt_common.h" + +void intel_dpt_configure(struct intel_crtc *crtc) +{ + struct drm_i915_private *i915 = to_i915(crtc->base.dev); + + if (DISPLAY_VER(i915) == 14) { + enum pipe pipe = crtc->pipe; + enum plane_id plane_id; + + for_each_plane_id_on_crtc(crtc, plane_id) { + if (plane_id == PLANE_CURSOR) + continue; + + intel_de_rmw(i915, PLANE_CHICKEN(pipe, plane_id), + PLANE_CHICKEN_DISABLE_DPT, + i915->display.params.enable_dpt ? 0 : + PLANE_CHICKEN_DISABLE_DPT); + } + } else if (DISPLAY_VER(i915) == 13) { + intel_de_rmw(i915, CHICKEN_MISC_2, + CHICKEN_MISC_DISABLE_DPT, + i915->display.params.enable_dpt ? 0 : + CHICKEN_MISC_DISABLE_DPT); + } +} diff --git a/drivers/gpu/drm/i915/display/intel_dpt_common.h b/drivers/gpu/drm/i915/display/intel_dpt_common.h new file mode 100644 index 000000000000..6d7de405126a --- /dev/null +++ b/drivers/gpu/drm/i915/display/intel_dpt_common.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2023 Intel Corporation + */ + +#ifndef __INTEL_DPT_COMMON_H__ +#define __INTEL_DPT_COMMON_H__ + +struct intel_crtc; + +void intel_dpt_configure(struct intel_crtc *crtc); + +#endif /* __INTEL_DPT_COMMON_H__ */