All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 01/39] drm/i915: add display sub-struct to drm_i915_private
Date: Tue, 16 Aug 2022 18:23:22 -0700	[thread overview]
Message-ID: <20220817012322.rm4xuqdt7vxtmtov@ldmartin-desk2.lan> (raw)
In-Reply-To: <a5641ef131cf70d404b5344eb8c3cd1688fdaae6.1660230121.git.jani.nikula@intel.com>

On Thu, Aug 11, 2022 at 06:07:12PM +0300, Jani Nikula wrote:
>In another long-overdue cleanup, add a display sub-struct to
>drm_i915_private, and start moving display related members there. Start
>with display funcs that need a rename anyway to not collide with the new
>display member.
>
>Add a new header under display/ for defining struct intel_display.
>
>Rename struct drm_i915_display_funcs to intel_display_funcs while at it.
>
>Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>---
> drivers/gpu/drm/i915/display/intel_display.c  | 28 +++++++-------
> .../gpu/drm/i915/display/intel_display_core.h | 38 +++++++++++++++++++
> .../drm/i915/display/intel_modeset_setup.c    |  2 +-
> .../drm/i915/display/intel_plane_initial.c    |  2 +-
> drivers/gpu/drm/i915/i915_drv.h               | 21 ++--------
> 5 files changed, 57 insertions(+), 34 deletions(-)
> create mode 100644 drivers/gpu/drm/i915/display/intel_display_core.h
>
>diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
>index f143adefdf38..24ab1501beea 100644
>--- a/drivers/gpu/drm/i915/display/intel_display.c
>+++ b/drivers/gpu/drm/i915/display/intel_display.c
>@@ -4144,7 +4144,7 @@ bool intel_crtc_get_pipe_config(struct intel_crtc_state *crtc_state)
> 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> 	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
>
>-	if (!i915->display->get_pipe_config(crtc, crtc_state))
>+	if (!i915->display.funcs.crtc->get_pipe_config(crtc, crtc_state))
> 		return false;
>
> 	crtc_state->hw.active = true;
>@@ -7119,7 +7119,7 @@ static void intel_enable_crtc(struct intel_atomic_state *state,
>
> 	intel_crtc_update_active_timings(new_crtc_state);
>
>-	dev_priv->display->crtc_enable(state, crtc);
>+	dev_priv->display.funcs.crtc->crtc_enable(state, crtc);
>
> 	if (intel_crtc_is_bigjoiner_slave(new_crtc_state))
> 		return;
>@@ -7198,7 +7198,7 @@ static void intel_old_crtc_state_disables(struct intel_atomic_state *state,
> 	 */
> 	intel_crtc_disable_pipe_crc(crtc);
>
>-	dev_priv->display->crtc_disable(state, crtc);
>+	dev_priv->display.funcs.crtc->crtc_disable(state, crtc);

lgtm. Regarding names: it's a little weird to have "crtc doubled in the funcs.crtc->crtc_
and it not being consistent accross all functions


> 	crtc->active = false;
> 	intel_fbc_disable(crtc);
> 	intel_disable_shared_dpll(old_crtc_state);
>@@ -7586,7 +7586,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
> 	}
>
> 	/* Now enable the clocks, plane, pipe, and connectors that we set up. */
>-	dev_priv->display->commit_modeset_enables(state);
>+	dev_priv->display.funcs.crtc->commit_modeset_enables(state);
>
> 	intel_encoders_update_complete(state);
>
>@@ -8317,7 +8317,7 @@ static const struct drm_mode_config_funcs intel_mode_funcs = {
> 	.atomic_state_free = intel_atomic_state_free,
> };
>
>-static const struct drm_i915_display_funcs skl_display_funcs = {
>+static const struct intel_display_funcs skl_display_funcs = {
> 	.get_pipe_config = hsw_get_pipe_config,
> 	.crtc_enable = hsw_crtc_enable,
> 	.crtc_disable = hsw_crtc_disable,
>@@ -8325,7 +8325,7 @@ static const struct drm_i915_display_funcs skl_display_funcs = {
> 	.get_initial_plane_config = skl_get_initial_plane_config,
> };
>
>-static const struct drm_i915_display_funcs ddi_display_funcs = {
>+static const struct intel_display_funcs ddi_display_funcs = {
> 	.get_pipe_config = hsw_get_pipe_config,
> 	.crtc_enable = hsw_crtc_enable,
> 	.crtc_disable = hsw_crtc_disable,
>@@ -8333,7 +8333,7 @@ static const struct drm_i915_display_funcs ddi_display_funcs = {
> 	.get_initial_plane_config = i9xx_get_initial_plane_config,
> };
>
>-static const struct drm_i915_display_funcs pch_split_display_funcs = {
>+static const struct intel_display_funcs pch_split_display_funcs = {
> 	.get_pipe_config = ilk_get_pipe_config,
> 	.crtc_enable = ilk_crtc_enable,
> 	.crtc_disable = ilk_crtc_disable,
>@@ -8341,7 +8341,7 @@ static const struct drm_i915_display_funcs pch_split_display_funcs = {
> 	.get_initial_plane_config = i9xx_get_initial_plane_config,
> };
>
>-static const struct drm_i915_display_funcs vlv_display_funcs = {
>+static const struct intel_display_funcs vlv_display_funcs = {
> 	.get_pipe_config = i9xx_get_pipe_config,
> 	.crtc_enable = valleyview_crtc_enable,
> 	.crtc_disable = i9xx_crtc_disable,
>@@ -8349,7 +8349,7 @@ static const struct drm_i915_display_funcs vlv_display_funcs = {
> 	.get_initial_plane_config = i9xx_get_initial_plane_config,
> };
>
>-static const struct drm_i915_display_funcs i9xx_display_funcs = {
>+static const struct intel_display_funcs i9xx_display_funcs = {
> 	.get_pipe_config = i9xx_get_pipe_config,
> 	.crtc_enable = i9xx_crtc_enable,
> 	.crtc_disable = i9xx_crtc_disable,
>@@ -8372,16 +8372,16 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv)
> 	intel_dpll_init_clock_hook(dev_priv);
>
> 	if (DISPLAY_VER(dev_priv) >= 9) {
>-		dev_priv->display = &skl_display_funcs;
>+		dev_priv->display.funcs.crtc = &skl_display_funcs;
> 	} else if (HAS_DDI(dev_priv)) {
>-		dev_priv->display = &ddi_display_funcs;
>+		dev_priv->display.funcs.crtc = &ddi_display_funcs;
> 	} else if (HAS_PCH_SPLIT(dev_priv)) {
>-		dev_priv->display = &pch_split_display_funcs;
>+		dev_priv->display.funcs.crtc = &pch_split_display_funcs;
> 	} else if (IS_CHERRYVIEW(dev_priv) ||
> 		   IS_VALLEYVIEW(dev_priv)) {
>-		dev_priv->display = &vlv_display_funcs;
>+		dev_priv->display.funcs.crtc = &vlv_display_funcs;
> 	} else {
>-		dev_priv->display = &i9xx_display_funcs;
>+		dev_priv->display.funcs.crtc = &i9xx_display_funcs;
> 	}
>
> 	intel_fdi_init_hook(dev_priv);
>diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
>new file mode 100644
>index 000000000000..aafe548875cc
>--- /dev/null
>+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
>@@ -0,0 +1,38 @@
>+/* SPDX-License-Identifier: MIT */
>+/*
>+ * Copyright © 2022 Intel Corporation
>+ */
>+
>+#ifndef __INTEL_DISPLAY_CORE_H__
>+#define __INTEL_DISPLAY_CORE_H__
>+
>+#include <linux/types.h>
>+
>+struct intel_atomic_state;
>+struct intel_crtc;
>+struct intel_crtc_state;
>+struct intel_initial_plane_config;
>+
>+struct intel_display_funcs {

in the same line as comment above. Maybe we could give this struct a
better name? Because it's already inside a intel_display.funcs.crtc

display->funcs.crtc->get_pipe_config()
display->funcs.crtc->get_initial_plane_nfig()
display->funcs.crtc->enable()
display->funcs.crtc->disable()
display->funcs.crtc->commit_modeset_enables()

and then call this `struct intel_crtc_funcs`.

This can be done later as this commit itself is basically moving things
with the same name inside a substruct.


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

  parent reply	other threads:[~2022-08-17  1:23 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 15:07 [Intel-gfx] [PATCH 00/39] drm/i915: add display sub-struct to drm_i915_private Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 01/39] " Jani Nikula
2022-08-12  4:27   ` Murthy, Arun R
2022-08-12  6:40     ` Jani Nikula
2022-08-16  3:31       ` Murthy, Arun R
2022-08-16  7:37         ` Jani Nikula
2022-08-16  7:40           ` Murthy, Arun R
2022-08-17  1:23   ` Lucas De Marchi [this message]
2022-08-17  6:48     ` Jani Nikula
2022-08-17  8:07       ` Jani Nikula
2022-08-18 21:25         ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 02/39] drm/i915: move cdclk_funcs to display.funcs Jani Nikula
2022-08-12  4:32   ` Murthy, Arun R
2022-08-12  6:43     ` Jani Nikula
2022-08-16  3:42       ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 03/39] drm/i915: move dpll_funcs " Jani Nikula
2022-08-12  4:33   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 04/39] drm/i915: move hotplug_funcs " Jani Nikula
2022-08-12  4:37   ` Murthy, Arun R
2022-08-12  6:45     ` Jani Nikula
2022-08-17  1:28   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 05/39] drm/i915: move clock_gating_funcs " Jani Nikula
2022-08-12  4:41   ` Murthy, Arun R
2022-08-12  6:48     ` Jani Nikula
2022-08-12  6:51       ` Jani Nikula
2022-08-16  3:45         ` Murthy, Arun R
2022-08-17  1:38   ` Lucas De Marchi
2022-08-17  6:50     ` Jani Nikula
2022-08-17  7:20       ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 06/39] drm/i915: move wm_disp funcs " Jani Nikula
2022-08-12  4:45   ` Murthy, Arun R
2022-08-12  6:54     ` Jani Nikula
2022-08-16  3:48       ` Murthy, Arun R
2022-08-17  3:50   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 07/39] drm/i915: move fdi_funcs " Jani Nikula
2022-08-12  4:48   ` Murthy, Arun R
2022-08-17  3:51   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 08/39] drm/i915: move color_funcs " Jani Nikula
2022-08-12  4:49   ` Murthy, Arun R
2022-08-17  3:52   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 09/39] drm/i915: move and group gmbus members under display.gmbus Jani Nikula
2022-08-12  4:53   ` Murthy, Arun R
2022-08-12  6:56     ` Jani Nikula
2022-08-16  3:59       ` Murthy, Arun R
2022-08-16  7:50         ` Jani Nikula
2022-08-16  8:04           ` Murthy, Arun R
2022-08-17  3:56   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 10/39] drm/i915: move and group pps members under display.pps Jani Nikula
2022-08-12  4:54   ` Murthy, Arun R
2022-08-12  6:58     ` Jani Nikula
2022-08-16  4:03       ` Murthy, Arun R
2022-08-17  3:57   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 11/39] drm/i915: move dmc to display.dmc Jani Nikula
2022-08-12  4:58   ` Murthy, Arun R
2022-08-12  7:00     ` Jani Nikula
2022-08-16  4:07       ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 12/39] drm/i915: move and split audio under display.audio and display.funcs Jani Nikula
2022-08-12  5:02   ` Murthy, Arun R
2022-08-12  7:03     ` Jani Nikula
2022-08-16  4:13       ` Murthy, Arun R
2022-08-16  8:02         ` Jani Nikula
2022-08-16  8:28           ` Murthy, Arun R
2022-08-17  4:14   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 13/39] drm/i915: move dpll under display.dpll Jani Nikula
2022-08-17  4:16   ` Lucas De Marchi
2022-08-24 10:35     ` Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 14/39] drm/i915: move and group fbdev under display.fbdev Jani Nikula
2022-08-22  3:58   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 15/39] drm/i915: move wm to display.wm Jani Nikula
2022-08-22  4:00   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 16/39] drm/i915: move and group hdcp under display.hdcp Jani Nikula
2022-08-22  4:02   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 17/39] drm/i915: move hotplug to display.hotplug Jani Nikula
2022-08-17  4:24   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 18/39] drm/i915: move overlay to display.overlay Jani Nikula
2022-08-22  4:10   ` Murthy, Arun R
2022-08-11 15:07 ` [Intel-gfx] [PATCH 19/39] drm/i915: move and group sagv under display.sagv Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 20/39] drm/i915: move and group max_bw and bw_obj under display.bw Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 21/39] drm/i915: move opregion to display.opregion Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 22/39] drm/i915: move and group cdclk under display.cdclk Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 23/39] drm/i915: move backlight to display.backlight Jani Nikula
2022-08-17  4:30   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 24/39] drm/i915: move mipi_mmio_base to display.dsi Jani Nikula
2022-08-17  4:32   ` Lucas De Marchi
2022-08-17  7:00     ` Jani Nikula
2022-08-17  7:21       ` Lucas De Marchi
2022-08-17  7:54         ` Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 25/39] drm/i915: move vbt to display.vbt Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 26/39] drm/i915: move fbc to display.fbc Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 27/39] drm/i915/vrr: drop window2_delay member from i915 Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 28/39] drm/i915: move and group power related members under display.power Jani Nikula
2022-08-17  4:41   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 29/39] drm/i915: move and group fdi members under display.fdi Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 30/39] drm/i915: move fb_tracking under display sub-struct Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 31/39] drm/i915: move INTEL_FRONTBUFFER_* macros to intel_frontbuffer.h Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 32/39] drm/i915: move dbuf under display sub-struct Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 33/39] drm/i915: move and group modeset_wq and flip_wq under display.wq Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 34/39] drm/i915: split gem quirks from display quirks Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 35/39] drm/i915/quirks: abstract checking for " Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 36/39] drm/i915/quirks: abstract quirks further by making quirk ids an enum Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 37/39] drm/i915: move quirks under display sub-struct Jani Nikula
2022-08-17  4:49   ` Lucas De Marchi
2022-08-11 15:07 ` [Intel-gfx] [PATCH 38/39] drm/i915: move atomic_helper " Jani Nikula
2022-08-11 15:07 ` [Intel-gfx] [PATCH 39/39] drm/i915: move and group properties under display.properties Jani Nikula
2022-08-11 15:15 ` [Intel-gfx] [PATCH 00/39] drm/i915: add display sub-struct to drm_i915_private Jani Nikula
2022-08-11 15:38 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-08-11 15:38 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-08-11 15:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-08-12  0:40 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-08-17  4:52 ` [Intel-gfx] [PATCH 00/39] " Lucas De Marchi

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=20220817012322.rm4xuqdt7vxtmtov@ldmartin-desk2.lan \
    --to=lucas.demarchi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.