From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/i915: move intel_get_pipe_from_crtc_id_ioctl to intel_crtc.c
Date: Fri, 13 Sep 2024 16:53:50 -0400 [thread overview]
Message-ID: <ZuSmXuza8wwkvqkZ@intel.com> (raw)
In-Reply-To: <edcf4477e6f38cc1f36a8afc0d09fd98544803ab.1726235647.git.jani.nikula@intel.com>
On Fri, Sep 13, 2024 at 04:54:38PM +0300, Jani Nikula wrote:
> Reduce the size of and dependencies on intel_display.[ch], and move
> intel_get_pipe_from_crtc_id_ioctl() to intel_crtc.[ch]. Rename to
> intel_crtc_get_pipe_from_crtc_id_ioctl() while at it.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_crtc.c | 17 +++++++++++++++++
> drivers/gpu/drm/i915/display/intel_crtc.h | 4 ++++
> drivers/gpu/drm/i915/display/intel_display.c | 17 -----------------
> drivers/gpu/drm/i915/display/intel_display.h | 3 ---
> drivers/gpu/drm/i915/i915_driver.c | 4 ++--
> 5 files changed, 23 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
> index aed3853952be..f95d169fc324 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -389,6 +389,23 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
> return ret;
> }
>
> +int intel_crtc_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
> + struct drm_file *file)
> +{
> + struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
> + struct drm_crtc *drm_crtc;
> + struct intel_crtc *crtc;
> +
> + drm_crtc = drm_crtc_find(dev, file, pipe_from_crtc_id->crtc_id);
> + if (!drm_crtc)
> + return -ENOENT;
> +
> + crtc = to_intel_crtc(drm_crtc);
> + pipe_from_crtc_id->pipe = crtc->pipe;
> +
> + return 0;
> +}
> +
> static bool intel_crtc_needs_vblank_work(const struct intel_crtc_state *crtc_state)
> {
> return crtc_state->hw.active &&
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.h b/drivers/gpu/drm/i915/display/intel_crtc.h
> index 0de8c772df2e..a58ecd11bba2 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.h
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.h
> @@ -10,7 +10,9 @@
>
> enum i9xx_plane_id;
> enum pipe;
> +struct drm_device;
> struct drm_display_mode;
> +struct drm_file;
> struct drm_i915_private;
> struct intel_atomic_state;
> struct intel_crtc;
> @@ -32,6 +34,8 @@ int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
> void intel_crtc_arm_vblank_event(struct intel_crtc_state *crtc_state);
> u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state);
> int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe);
> +int intel_crtc_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
> + struct drm_file *file_priv);
> struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc);
> void intel_crtc_state_reset(struct intel_crtc_state *crtc_state,
> struct intel_crtc *crtc);
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index fdf244a32b24..7bba54a31eda 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -7706,23 +7706,6 @@ void intel_plane_destroy(struct drm_plane *plane)
> kfree(to_intel_plane(plane));
> }
>
> -int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
> - struct drm_file *file)
> -{
> - struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
> - struct drm_crtc *drmmode_crtc;
> - struct intel_crtc *crtc;
> -
> - drmmode_crtc = drm_crtc_find(dev, file, pipe_from_crtc_id->crtc_id);
> - if (!drmmode_crtc)
> - return -ENOENT;
> -
> - crtc = to_intel_crtc(drmmode_crtc);
> - pipe_from_crtc_id->pipe = crtc->pipe;
> -
> - return 0;
> -}
> -
> static u32 intel_encoder_possible_clones(struct intel_encoder *encoder)
> {
> struct drm_device *dev = encoder->base.dev;
> diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
> index 7ca26e5cb20e..d10608526eee 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.h
> +++ b/drivers/gpu/drm/i915/display/intel_display.h
> @@ -471,9 +471,6 @@ bool intel_encoder_is_snps(struct intel_encoder *encoder);
> bool intel_encoder_is_tc(struct intel_encoder *encoder);
> enum tc_port intel_encoder_to_tc(struct intel_encoder *encoder);
>
> -int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
> - struct drm_file *file_priv);
> -
> int ilk_get_lanes_required(int target_clock, int link_bw, int bpp);
> void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
> struct intel_digital_port *dig_port,
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 943e938040c0..7f98f2dbd881 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -48,8 +48,8 @@
> #include "display/intel_acpi.h"
> #include "display/intel_bw.h"
> #include "display/intel_cdclk.h"
> +#include "display/intel_crtc.h"
> #include "display/intel_display_driver.h"
> -#include "display/intel_display.h"
> #include "display/intel_dmc.h"
> #include "display/intel_dp.h"
> #include "display/intel_dpt.h"
> @@ -1724,7 +1724,7 @@ static const struct drm_ioctl_desc i915_ioctls[] = {
> DRM_IOCTL_DEF_DRV(I915_GEM_SET_TILING, i915_gem_set_tiling_ioctl, DRM_RENDER_ALLOW),
> DRM_IOCTL_DEF_DRV(I915_GEM_GET_TILING, i915_gem_get_tiling_ioctl, DRM_RENDER_ALLOW),
> DRM_IOCTL_DEF_DRV(I915_GEM_GET_APERTURE, i915_gem_get_aperture_ioctl, DRM_RENDER_ALLOW),
> - DRM_IOCTL_DEF_DRV(I915_GET_PIPE_FROM_CRTC_ID, intel_get_pipe_from_crtc_id_ioctl, 0),
> + DRM_IOCTL_DEF_DRV(I915_GET_PIPE_FROM_CRTC_ID, intel_crtc_get_pipe_from_crtc_id_ioctl, 0),
> DRM_IOCTL_DEF_DRV(I915_GEM_MADVISE, i915_gem_madvise_ioctl, DRM_RENDER_ALLOW),
> DRM_IOCTL_DEF_DRV(I915_OVERLAY_PUT_IMAGE, intel_overlay_put_image_ioctl, DRM_MASTER),
> DRM_IOCTL_DEF_DRV(I915_OVERLAY_ATTRS, intel_overlay_attrs_ioctl, DRM_MASTER),
> --
> 2.39.2
>
next prev parent reply other threads:[~2024-09-13 20:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 13:54 [PATCH 0/2] drm/i915: clean up deps on intel_display.h a bit Jani Nikula
2024-09-13 13:54 ` [PATCH 1/2] drm/i915: move intel_get_pipe_from_crtc_id_ioctl to intel_crtc.c Jani Nikula
2024-09-13 20:53 ` Rodrigo Vivi [this message]
2024-09-13 13:54 ` [PATCH 2/2] drm/i915/display: move enum i9xx_plane_id to intel_display_limits.h Jani Nikula
2024-09-13 20:55 ` Rodrigo Vivi
2024-09-13 21:32 ` Jani Nikula
2024-09-16 16:22 ` Rodrigo Vivi
2024-09-17 9:07 ` Jani Nikula
2024-09-13 18:18 ` ✗ Fi.CI.SPARSE: warning for drm/i915: clean up deps on intel_display.h a bit Patchwork
2024-09-13 18:52 ` ✓ Fi.CI.BAT: success " Patchwork
2024-09-15 1:17 ` ✗ Fi.CI.IGT: failure " Patchwork
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=ZuSmXuza8wwkvqkZ@intel.com \
--to=rodrigo.vivi@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.