[Intel-gfx] [PATCH 07/23] drm/i915/intel_fb: Pull FB plane functions from intel_display_types.h
Imre Deak
imre.deak at intel.com
Thu Mar 11 16:31:27 UTC 2021
On Thu, Mar 11, 2021 at 06:15:26PM +0200, Ville Syrjälä wrote:
> ...
> > diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> > new file mode 100644
> > index 000000000000..29b8ec087f53
> > --- /dev/null
> > +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> > @@ -0,0 +1,28 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2021 Intel Corporation
> > + */
> > +
> > +#include <drm/drm_framebuffer.h>
> > +
> > +#include "display/intel_display_types.h"
> > +#include "display/intel_fb.h"
>
> I don't think we usually have the "display/" part in these.
Ah ok, took that idea from intel_display.c, but that was only
intentional before moving it under display/. Will fix this.
> Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> > +
> > +bool is_ccs_plane(const struct drm_framebuffer *fb, int plane)
> > +{
> > + if (!is_ccs_modifier(fb->modifier))
> > + return false;
> > +
> > + return plane >= fb->format->num_planes / 2;
> > +}
> > +
> > +bool is_gen12_ccs_plane(const struct drm_framebuffer *fb, int plane)
> > +{
> > + return is_gen12_ccs_modifier(fb->modifier) && is_ccs_plane(fb, plane);
> > +}
> > +
> > +bool is_gen12_ccs_cc_plane(const struct drm_framebuffer *fb, int plane)
> > +{
> > + return fb->modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC &&
> > + plane == 2;
> > +}
> > diff --git a/drivers/gpu/drm/i915/display/intel_fb.h b/drivers/gpu/drm/i915/display/intel_fb.h
> > new file mode 100644
> > index 000000000000..64e6a2521320
> > --- /dev/null
> > +++ b/drivers/gpu/drm/i915/display/intel_fb.h
> > @@ -0,0 +1,17 @@
> > +/* SPDX-License-Identifier: MIT */
> > +/*
> > + * Copyright © 2020-2021 Intel Corporation
> > + */
> > +
> > +#ifndef __INTEL_FB_H__
> > +#define __INTEL_FB_H__
> > +
> > +#include <linux/types.h>
> > +
> > +struct drm_framebuffer;
> > +
> > +bool is_ccs_plane(const struct drm_framebuffer *fb, int plane);
> > +bool is_gen12_ccs_plane(const struct drm_framebuffer *fb, int plane);
> > +bool is_gen12_ccs_cc_plane(const struct drm_framebuffer *fb, int plane);
> > +
> > +#endif /* __INTEL_FB_H__ */
> > diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > index 1f335cb09149..3ff1008b0b4a 100644
> > --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > @@ -11,6 +11,7 @@
> > #include "i915_drv.h"
> > #include "intel_atomic_plane.h"
> > #include "intel_display_types.h"
> > +#include "intel_fb.h"
> > #include "intel_pm.h"
> > #include "intel_psr.h"
> > #include "intel_sprite.h"
> > --
> > 2.25.1
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Ville Syrjälä
> Intel
More information about the Intel-gfx
mailing list