All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"maarten.lankhorst@linux.intel.com"
	<maarten.lankhorst@linux.intel.com>
Subject: Re: [Intel-xe] [04/10] FIXME drm/i915/display: Use fence->set_deadline to boost requests
Date: Fri, 27 Oct 2023 10:05:39 +0000	[thread overview]
Message-ID: <7653efc180db9df9e81d02d3faa76e63e8ce055f.camel@intel.com> (raw)
In-Reply-To: <20231025102045.817068-5-maarten.lankhorst@linux.intel.com>

Hello Maarten,

We have ongoing discussion in gfx mailing list
(https://patchwork.freedesktop.org/series/125160/). I understood we
have now there clear path forward. I will prepare one more addresing
recent comments from Ville. That patch set which will take care of
this. After getting it merged into drm-intel-next I will backport it to
drm-xe-next and it will solve this.

BR,

Jouni Högander
On Wed, 2023-10-25 at 12:20 +0200, Maarten Lankhorst wrote:
> Instead of using a i915 specific method, use the generic helper to
> combine fences and set the deadline.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  .../gpu/drm/i915/display/intel_atomic_plane.c | 47 ++++-------------
> --
>  drivers/gpu/drm/i915/display/intel_display.c  |  2 +
>  2 files changed, 11 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index dd65498166fbf..98a59445e6f45 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -1033,7 +1033,6 @@ static int
>  intel_prepare_plane_fb(struct drm_plane *_plane,
>                        struct drm_plane_state *_new_plane_state)
>  {
> -       struct i915_sched_attr attr = { .priority =
> I915_PRIORITY_DISPLAY };
>         struct intel_plane *plane = to_intel_plane(_plane);
>         struct intel_plane_state *new_plane_state =
>                 to_intel_plane_state(_new_plane_state);
> @@ -1072,49 +1071,20 @@ intel_prepare_plane_fb(struct drm_plane
> *_plane,
>                 }
>         }
>  
> -       if (new_plane_state->uapi.fence) { /* explicit fencing */
> -               i915_gem_fence_wait_priority(new_plane_state-
> >uapi.fence,
> -                                            &attr);
> -               ret = i915_sw_fence_await_dma_fence(&state-
> >commit_ready,
> -                                                   new_plane_state-
> >uapi.fence,
> -                                                  
> i915_fence_timeout(dev_priv),
> -                                                   GFP_KERNEL);
> -               if (ret < 0)
> +       if (obj) {
> +               ret = intel_plane_pin_fb(new_plane_state);
> +               if (ret)
>                         return ret;
>         }
>  
> -       if (!obj)
> -               return 0;
> -
> -
> -       ret = intel_plane_pin_fb(new_plane_state);
> +       /* prepare after pinning */
> +       ret = drm_gem_plane_helper_prepare_fb(_plane,
> _new_plane_state);
>         if (ret)
> -               return ret;
> +               goto unpin_fb;
>  
> -       i915_gem_object_wait_priority(obj, 0, &attr);
> -
> -       if (!new_plane_state->uapi.fence) { /* implicit fencing */
> -               struct dma_resv_iter cursor;
> -               struct dma_fence *fence;
> -
> -               ret = i915_sw_fence_await_reservation(&state-
> >commit_ready,
> -                                                     obj->base.resv,
> false,
> -                                                    
> i915_fence_timeout(dev_priv),
> -                                                     GFP_KERNEL);
> -               if (ret < 0)
> -                       goto unpin_fb;
> -
> -               dma_resv_iter_begin(&cursor, obj->base.resv,
> -                                   DMA_RESV_USAGE_WRITE);
> -               dma_resv_for_each_fence_unlocked(&cursor, fence) {
> -
>                        intel_display_rps_boost_after_vblank(new_plane_
> state->hw.crtc,
> -                                                            fence);
> -               }
> -               dma_resv_iter_end(&cursor);
> -       } else {
> +       if (new_plane_state->uapi.fence)
>                 intel_display_rps_boost_after_vblank(new_plane_state-
> >hw.crtc,
>                                                      new_plane_state-
> >uapi.fence);
> -       }
>  
>         /*
>          * We declare pageflips to be interactive and so merit a
> small bias
> @@ -1124,7 +1094,8 @@ intel_prepare_plane_fb(struct drm_plane
> *_plane,
>          * that are not quite steady state without resorting to
> forcing
>          * maximum clocks following a vblank miss (see
> do_rps_boost()).
>          */
> -       intel_display_rps_mark_interactive(dev_priv, state, true);
> +       if (obj)
> +               intel_display_rps_mark_interactive(dev_priv, state,
> true);
>  
>         return 0;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index 478b8764101a2..1b66d5adcebee 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6599,6 +6599,8 @@ static int intel_atomic_prepare_commit(struct
> intel_atomic_state *state)
>         if (ret < 0)
>                 return ret;
>  
> +       drm_atomic_helper_set_fence_deadline(state->base.dev, &state-
> >base);
> +
>         for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i)
> {
>                 if (intel_crtc_needs_color_update(crtc_state))
>                         intel_color_prepare_commit(crtc_state);


  reply	other threads:[~2023-10-27 10:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 10:20 [Intel-xe] [PATCH 00/10] Split out most of "FIXME: drm/i915/display: Remaining changes to make xe compile" Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 01/10] revert fixme in intel_atomic_plane.c Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 02/10] drm/atomic: Add drm_atomic_helper_set_fence_deadline() function Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 03/10] drm/i915: Implement fence->set_deadline Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 04/10] FIXME drm/i915/display: Use fence->set_deadline to boost requests Maarten Lankhorst
2023-10-27 10:05   ` Hogander, Jouni [this message]
2023-10-25 10:20 ` [Intel-xe] [PATCH 05/10] fixup xe i915_drv.h compat header Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 06/10] revert intel_frontbuffer changes Maarten Lankhorst
2023-10-27 10:17   ` [Intel-xe] [06/10] " Hogander, Jouni
2023-10-25 10:20 ` [Intel-xe] [PATCH 07/10] Update compat headers Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 08/10] more reverts Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 09/10] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 10/10] revert more (fbc) Maarten Lankhorst
2023-10-27 10:01   ` [Intel-xe] [10/10] " Hogander, Jouni

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=7653efc180db9df9e81d02d3faa76e63e8ce055f.camel@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@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 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.