Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "nirmoy.das@linux.intel.com" <nirmoy.das@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"B, Jeevan" <jeevan.b@intel.com>
Subject: Re: [Intel-gfx] [PATCH v2 3/3] drm/i915/fbc: Moved fence related code away from intel_fbc
Date: Mon, 7 Aug 2023 05:56:25 +0000	[thread overview]
Message-ID: <6eaddaa5a978efcade046f74187c9a37f7203cab.camel@intel.com> (raw)
In-Reply-To: <f0283070-0504-7bb8-96d1-b50b4d0fa279@linux.intel.com>

On Tue, 2023-08-01 at 09:42 +0200, Nirmoy Das wrote:
> 
> On 6/14/2023 7:17 AM, Jouni Högander wrote:
> > As a preparation for Xe move HW fence details away from intel_fbc
> > code.
> > Add new functions to check support for legacy fencing and fence id
> > and use
> > these in fbc code. Xe doesn't support legacy fencing.
> > 
> > v2: Fix intel_gt_support_legacy_fencing macro
> > 
> > Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> > ---
> >   drivers/gpu/drm/i915/display/intel_fbc.c | 12 ++++++------
> >   drivers/gpu/drm/i915/gt/intel_gt_types.h |  2 ++
> >   drivers/gpu/drm/i915/i915_vma.h          |  5 +++++
> >   3 files changed, 13 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c
> > b/drivers/gpu/drm/i915/display/intel_fbc.c
> > index da8166eedf93..25382022cd27 100644
> > --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> > @@ -47,6 +47,7 @@
> >   #include "i915_reg.h"
> >   #include "i915_utils.h"
> >   #include "i915_vgpu.h"
> > +#include "i915_vma.h"
> >   #include "intel_cdclk.h"
> >   #include "intel_de.h"
> >   #include "intel_display_trace.h"
> > @@ -607,7 +608,7 @@ static void ivb_fbc_activate(struct intel_fbc
> > *fbc)
> >         else if (DISPLAY_VER(i915) == 9)
> >                 skl_fbc_program_cfb_stride(fbc);
> >   
> > -       if (to_gt(i915)->ggtt->num_fences)
> > +       if (intel_gt_support_legacy_fencing(to_gt(i915)))
> >                 snb_fbc_program_fence(fbc);
> >   
> >         intel_de_write(i915, ILK_DPFC_CONTROL(fbc->id),
> > @@ -991,11 +992,10 @@ static void intel_fbc_update_state(struct
> > intel_atomic_state *state,
> >         fbc_state->fence_y_offset =
> > intel_plane_fence_y_offset(plane_state);
> >   
> >         drm_WARN_ON(&i915->drm, plane_state->flags &
> > PLANE_HAS_FENCE &&
> > -                   !plane_state->ggtt_vma->fence);
> > +                   !intel_gt_support_legacy_fencing(to_gt(i915)));
> >   
> > -       if (plane_state->flags & PLANE_HAS_FENCE &&
> > -           plane_state->ggtt_vma->fence)
> > -               fbc_state->fence_id = plane_state->ggtt_vma->fence-
> > >id;
> > +       if (plane_state->flags & PLANE_HAS_FENCE)
> > +               fbc_state->fence_id = 
> > i915_vma_fence_id(plane_state->ggtt_vma);
> >         else
> >                 fbc_state->fence_id = -1;
> >   
> > @@ -1022,7 +1022,7 @@ static bool intel_fbc_is_fence_ok(const
> > struct intel_plane_state *plane_state)
> >          */
> >         return DISPLAY_VER(i915) >= 9 ||
> >                 (plane_state->flags & PLANE_HAS_FENCE &&
> > -                plane_state->ggtt_vma->fence);
> > +                i915_vma_fence_id(plane_state->ggtt_vma) != -1);
> >   }
> >   
> >   static bool intel_fbc_is_cfb_ok(const struct intel_plane_state
> > *plane_state)
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > index f08c2556aa25..121a53f908d1 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > @@ -306,4 +306,6 @@ enum intel_gt_scratch_field {
> >         INTEL_GT_SCRATCH_FIELD_COHERENTL3_WA = 256,
> >   };
> >   
> > +#define intel_gt_support_legacy_fencing(gt) (gt->ggtt->num_fences
> > > 0)
> 
> With the checkpath warning fixed here, this is
> 
> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>

Thank Nirmoy and Jeevan for your reviews. Whole set now merged. Also
warning mentioned above fixed before merging.

BR.

Jouni Högander

> 
> > +
> >   #endif /* __INTEL_GT_TYPES_H__ */
> > diff --git a/drivers/gpu/drm/i915/i915_vma.h
> > b/drivers/gpu/drm/i915/i915_vma.h
> > index 9a9729205d5b..6fdf6205c290 100644
> > --- a/drivers/gpu/drm/i915/i915_vma.h
> > +++ b/drivers/gpu/drm/i915/i915_vma.h
> > @@ -418,6 +418,11 @@ i915_vma_unpin_fence(struct i915_vma *vma)
> >                 __i915_vma_unpin_fence(vma);
> >   }
> >   
> > +static inline int i915_vma_fence_id(const struct i915_vma *vma)
> > +{
> > +       return vma->fence ? vma->fence->id : -1;
> > +}
> > +
> >   void i915_vma_parked(struct intel_gt *gt);
> >   
> >   static inline bool i915_vma_is_scanout(const struct i915_vma
> > *vma)


  reply	other threads:[~2023-08-07  5:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  5:17 [Intel-gfx] [PATCH v2 0/3] Move stolen memory handling details into i915_gem_stolen Jouni Högander
2023-06-14  5:17 ` [Intel-gfx] [PATCH v2 1/3] drm/i915: Move stolen memory handling " Jouni Högander
2023-08-01  8:02   ` Nirmoy Das
2023-08-01  8:33     ` Hogander, Jouni
2023-08-02  7:51       ` Nirmoy Das
2023-08-02  7:52         ` Hogander, Jouni
2023-08-03  8:51           ` Nirmoy Das
2023-06-14  5:17 ` [Intel-gfx] [PATCH v2 2/3] drm/i915/fbc: Make FBC check stolen at use time Jouni Högander
2023-08-03 10:18   ` B, Jeevan
2023-06-14  5:17 ` [Intel-gfx] [PATCH v2 3/3] drm/i915/fbc: Moved fence related code away from intel_fbc Jouni Högander
2023-08-01  7:42   ` Nirmoy Das
2023-08-07  5:56     ` Hogander, Jouni [this message]
2023-06-14  6:00 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Move stolen memory handling details into i915_gem_stolen (rev2) Patchwork
2023-06-14  6:00 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-06-14  6:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-06-14  9:29 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-31 10:50 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Move stolen memory handling details into i915_gem_stolen (rev3) Patchwork
2023-07-31 10:51 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-07-31 11:13 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-08-04  6:36 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Move stolen memory handling details into i915_gem_stolen (rev4) Patchwork
2023-08-04  6:37 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-08-04  6:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-04 11:34 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=6eaddaa5a978efcade046f74187c9a37f7203cab.camel@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    --cc=nirmoy.das@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox