public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 01/35] drm/i915: Add scaled paramater to update_sprite_watermarks()
Date: Tue, 30 Jul 2013 21:30:40 +0300	[thread overview]
Message-ID: <20130730183040.GX5004@intel.com> (raw)
In-Reply-To: <CA+gsUGQDhkBHex3LePgG2qanFT_Q58jjzE71Z4Qx7mB4ZKWnYg@mail.gmail.com>

On Tue, Jul 30, 2013 at 03:26:12PM -0300, Paulo Zanoni wrote:
> 2013/7/5  <ville.syrjala@linux.intel.com>:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Fro calculating watermarks we want to know whether sprites are
> 
> "Fro"
> 
> > scaled. Pass that information to update_sprite_watermarks() so that
> > eventually we may do some watermark pre-computing.
> 
> On this patch you're also renaming some variables from "enable" to
> "enabled", but not all of them. You should probably either rename them
> all, or none. Example: intel_update_sprite_watermarks definition at
> intel_drv.h says "bool enabled", but the implementation inside
> intel_pm.c says "bool enable", but there are also other examples.

The idea was to use "enabled" consistently, but it seems I messed up.
I can fix that up.

> 
> Besides the styling detail the patch looks correct, so if Daniel/Ville
> consider my suggestion is just a bikeshed, Reviewed-by: Paulo Zanoni
> <paulo.r.zanoni@intel.com>.
> 
> And another bikeshed would be to create variables called "scaled"
> inside the update_plane funcs :)

You mean "bool scaled = crtc_w != src_w || crtc_h != src_h;" or so?

Yeah I suppose could make the code a bit easier to parse.

> 
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h     |  2 +-
> >  drivers/gpu/drm/i915/intel_drv.h    |  7 ++++---
> >  drivers/gpu/drm/i915/intel_pm.c     | 13 +++++++------
> >  drivers/gpu/drm/i915/intel_sprite.c | 11 +++++++----
> >  4 files changed, 19 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index fd0f589..99eb980 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -361,7 +361,7 @@ struct drm_i915_display_funcs {
> >         void (*update_wm)(struct drm_device *dev);
> >         void (*update_sprite_wm)(struct drm_device *dev, int pipe,
> >                                  uint32_t sprite_width, int pixel_size,
> > -                                bool enable);
> > +                                bool enable, bool scaled);
> >         void (*modeset_global_resources)(struct drm_device *dev);
> >         /* Returns the active state of the crtc, and if the crtc is active,
> >          * fills out the pipe-config with the hw state. */
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index 5dfc1a0..3371ecc 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -353,7 +353,8 @@ struct intel_plane {
> >          * for the watermark calculations. Currently only Haswell uses this.
> >          */
> >         struct {
> > -               bool enable;
> > +               bool enabled;
> > +               bool scaled;
> >                 uint8_t bytes_per_pixel;
> >                 uint32_t horiz_pixels;
> >         } wm;
> > @@ -772,8 +773,8 @@ extern void intel_ddi_init(struct drm_device *dev, enum port port);
> >  /* For use by IVB LP watermark workaround in intel_sprite.c */
> >  extern void intel_update_watermarks(struct drm_device *dev);
> >  extern void intel_update_sprite_watermarks(struct drm_device *dev, int pipe,
> > -                                          uint32_t sprite_width,
> > -                                          int pixel_size, bool enable);
> > +                                          uint32_t sprite_width, int pixel_size,
> > +                                          bool enabled, bool scaled);
> >
> >  extern unsigned long intel_gen4_compute_page_offset(int *x, int *y,
> >                                                     unsigned int tiling_mode,
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 7cfd3b7..beca186 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -2388,7 +2388,7 @@ static void hsw_compute_wm_parameters(struct drm_device *dev,
> >                 pipe = intel_plane->pipe;
> >                 p = &params[pipe];
> >
> > -               p->sprite_enabled = intel_plane->wm.enable;
> > +               p->sprite_enabled = intel_plane->wm.enabled;
> >                 p->spr_bytes_per_pixel = intel_plane->wm.bytes_per_pixel;
> >                 p->spr_horiz_pixels = intel_plane->wm.horiz_pixels;
> >
> > @@ -2616,7 +2616,7 @@ static void haswell_update_wm(struct drm_device *dev)
> >
> >  static void haswell_update_sprite_wm(struct drm_device *dev, int pipe,
> >                                      uint32_t sprite_width, int pixel_size,
> > -                                    bool enable)
> > +                                    bool enabled, bool scaled)
> >  {
> >         struct drm_plane *plane;
> >
> > @@ -2624,7 +2624,8 @@ static void haswell_update_sprite_wm(struct drm_device *dev, int pipe,
> >                 struct intel_plane *intel_plane = to_intel_plane(plane);
> >
> >                 if (intel_plane->pipe == pipe) {
> > -                       intel_plane->wm.enable = enable;
> > +                       intel_plane->wm.enabled = enabled;
> > +                       intel_plane->wm.scaled = scaled;
> >                         intel_plane->wm.horiz_pixels = sprite_width + 1;
> >                         intel_plane->wm.bytes_per_pixel = pixel_size;
> >                         break;
> > @@ -2712,7 +2713,7 @@ sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane,
> >
> >  static void sandybridge_update_sprite_wm(struct drm_device *dev, int pipe,
> >                                          uint32_t sprite_width, int pixel_size,
> > -                                        bool enable)
> > +                                        bool enable, bool scaled)
> >  {
> >         struct drm_i915_private *dev_priv = dev->dev_private;
> >         int latency = SNB_READ_WM0_LATENCY() * 100;     /* In unit 0.1us */
> > @@ -2835,13 +2836,13 @@ void intel_update_watermarks(struct drm_device *dev)
> >
> >  void intel_update_sprite_watermarks(struct drm_device *dev, int pipe,
> >                                     uint32_t sprite_width, int pixel_size,
> > -                                   bool enable)
> > +                                   bool enable, bool scaled)
> >  {
> >         struct drm_i915_private *dev_priv = dev->dev_private;
> >
> >         if (dev_priv->display.update_sprite_wm)
> >                 dev_priv->display.update_sprite_wm(dev, pipe, sprite_width,
> > -                                                  pixel_size, enable);
> > +                                                  pixel_size, enable, scaled);
> >  }
> >
> >  static struct drm_i915_gem_object *
> > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > index 1fa5612..5a1f3fd 100644
> > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > @@ -114,7 +114,8 @@ vlv_update_plane(struct drm_plane *dplane, struct drm_framebuffer *fb,
> >         crtc_w--;
> >         crtc_h--;
> >
> > -       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true);
> > +       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
> > +                                      src_w != crtc_w || src_h != crtc_h);
> >
> >         I915_WRITE(SPSTRIDE(pipe, plane), fb->pitches[0]);
> >         I915_WRITE(SPPOS(pipe, plane), (crtc_y << 16) | crtc_x);
> > @@ -268,7 +269,8 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
> >         crtc_w--;
> >         crtc_h--;
> >
> > -       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true);
> > +       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
> > +                                      src_w != crtc_w || src_h != crtc_h);
> >
> >         /*
> >          * IVB workaround: must disable low power watermarks for at least
> > @@ -335,7 +337,7 @@ ivb_disable_plane(struct drm_plane *plane)
> >
> >         dev_priv->sprite_scaling_enabled &= ~(1 << pipe);
> >
> > -       intel_update_sprite_watermarks(dev, pipe, 0, 0, false);
> > +       intel_update_sprite_watermarks(dev, pipe, 0, 0, false, false);
> >
> >         /* potentially re-enable LP watermarks */
> >         if (scaling_was_enabled && !dev_priv->sprite_scaling_enabled)
> > @@ -455,7 +457,8 @@ ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
> >         crtc_w--;
> >         crtc_h--;
> >
> > -       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true);
> > +       intel_update_sprite_watermarks(dev, pipe, crtc_w, pixel_size, true,
> > +                                      src_w != crtc_w || src_h != crtc_h);
> >
> >         dvsscale = 0;
> >         if (IS_GEN5(dev) || crtc_w != src_w || crtc_h != src_h)
> > --
> > 1.8.1.5
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> 
> 
> -- 
> Paulo Zanoni

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2013-07-30 18:30 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05  8:57 [PATCH 00/35] drm/i915: ILK+ watermark rewrite ville.syrjala
2013-07-05  8:57 ` [PATCH 01/35] drm/i915: Add scaled paramater to update_sprite_watermarks() ville.syrjala
2013-07-30 18:26   ` Paulo Zanoni
2013-07-30 18:30     ` Ville Syrjälä [this message]
2013-07-30 18:49       ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 02/35] drm/i915: Pass the actual sprite width to watermarks functions ville.syrjala
2013-07-30 18:32   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 03/35] drm/i915: Calculate the sprite WM based on the source width instead of the destination width ville.syrjala
2013-07-30 19:01   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 04/35] drm/i915: Rename hsw_wm_get_pixel_rate to ilk_pipe_pixel_rate ville.syrjala
2013-07-30 19:20   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 05/35] drm/i915: Rename most wm compute functions to ilk_ prefix ville.syrjala
2013-07-30 19:37   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 06/35] drm/i915: Pass the watermark level to primary WM compute functions ville.syrjala
2013-07-30 19:49   ` Paulo Zanoni
2013-08-01  8:01     ` Ville Syrjälä
2013-07-05  8:57 ` [PATCH 07/35] drm/i915: Don't pass "mem_value" to ilk_compute_fbc_wm ville.syrjala
2013-07-30 19:54   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 08/35] drm/i915: Change the watermark latency type to uint16_t ville.syrjala
2013-07-30 20:01   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 09/35] drm/i915: Split out reading of HSW watermark latency values ville.syrjala
2013-07-05  9:19   ` Chris Wilson
2013-07-05 10:51     ` Ville Syrjälä
2013-07-30 20:09   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 10/35] drm/i915: Don't multiply the watermark latency values too early ville.syrjala
2013-07-30 20:21   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 11/35] drm/i915: Add SNB/IVB support to intel_read_wm_latency ville.syrjala
2013-07-30 21:01   ` Paulo Zanoni
2013-08-05  5:23     ` Daniel Vetter
2013-07-05  8:57 ` [PATCH 12/35] drm/i915: Add ILK " ville.syrjala
2013-07-05  8:57 ` [PATCH 13/35] drm/i915: Store the watermark latency values in dev_priv ville.syrjala
     [not found]   ` <CA+gsUGQ0JqEZiEUsONJh7nr6rPYRfTxJM79oc5tGcexEudB2Og@mail.gmail.com>
2013-07-30 21:42     ` Paulo Zanoni
2013-07-31  9:43       ` Ville Syrjälä
2013-07-05  8:57 ` [PATCH 14/35] drm/i915: Use the stored cursor and plane latencies properly ville.syrjala
2013-07-05  8:57 ` [PATCH 15/35] drm/i915: Print the watermark latencies during init ville.syrjala
2013-07-30 21:49   ` Paulo Zanoni
2013-07-31  9:47     ` Ville Syrjälä
2013-07-05  8:57 ` [PATCH 16/35] drm/i915: Disable specific watermark levels when latency is zero ville.syrjala
2013-07-30 21:51   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 17/35] drm/i915: Pull watermark level validity check out ville.syrjala
2013-07-05  8:57 ` [PATCH 18/35] drm/i915: Split watermark level computation from the code ville.syrjala
2013-07-05  8:57 ` [PATCH 19/35] drm/i915: Kill fbc_enable from hsw_lp_wm_results ville.syrjala
2013-07-05  8:57 ` [PATCH 20/35] drm/i915: Rename hsw_data_buf_partitioning to intel_ddb_partitioning ville.syrjala
2013-07-05  8:57 ` [PATCH 21/35] drm/i915: Rename hsw_lp_wm_result to intel_wm_level ville.syrjala
2013-07-05  8:57 ` [PATCH 22/35] drm/i915: Calculate max watermark levels for ILK+ ville.syrjala
2013-07-05  8:57 ` [PATCH 23/35] drm/i915; Pull some watermarks state into a separate structure ville.syrjala
2013-07-05  8:57 ` [PATCH 24/35] drm/i915: Split plane watermark parameters into a separate struct ville.syrjala
2013-07-05  8:57 ` [PATCH 25/35] drm/i915: Pass crtc to our update/disable_plane hooks ville.syrjala
2013-07-05  8:57 ` [PATCH 26/35] drm/i915: Don't try to disable plane if it's already disabled ville.syrjala
2013-07-05  8:57 ` [PATCH 27/35] drm/i915: Pass plane and crtc to intel_update_sprite_watermarks ville.syrjala
2013-07-05  8:57 ` [PATCH 28/35] drm/i915: Always call intel_update_sprite_watermarks() when disabling a plane ville.syrjala
2013-07-05  8:57 ` [PATCH 29/35] drm/i915: Pass crtc to intel_update_watermarks() and call it in one place during modeset ville.syrjala
2013-07-05  9:32   ` Chris Wilson
2013-07-05  8:57 ` [PATCH 30/35] drm/i915: Replace the ILK/SNB/IVB/HSW watermark code ville.syrjala
2013-07-05  9:37   ` Chris Wilson
2013-07-05 10:49     ` Ville Syrjälä
2013-07-05 17:46       ` Paulo Zanoni
2013-07-05 18:00         ` Ville Syrjälä
2013-07-05 17:51   ` Paulo Zanoni
2013-07-05 18:11     ` Ville Syrjälä
2013-07-05  8:57 ` [PATCH 31/35] drm/i915: Move HSW linetime watermark handling to modeset code ville.syrjala
2013-07-05 17:44   ` Paulo Zanoni
2013-07-05  8:57 ` [PATCH 32/35] hack: Add debug prints to watermark compute funcs ville.syrjala
2013-07-05  8:57 ` [PATCH 33/35] hack: Don't disable underrun reporting on the first error on ILK/SNB/IVB ville.syrjala
2013-07-05 17:19   ` Paulo Zanoni
2013-07-05 17:34     ` Ville Syrjälä
2013-07-05  8:57 ` [PATCH 34/35] hack: Make fifo underruns DRM_ERROR ville.syrjala
2013-07-05 17:19   ` Paulo Zanoni
2013-07-05 17:39     ` Ville Syrjälä
2013-07-05  8:57 ` [PATCH 35/35] hack: Print watermark programming duration ville.syrjala
2013-07-05 16:54 ` [PATCH 00/35] drm/i915: ILK+ watermark rewrite Paulo Zanoni
2013-07-05 17:22   ` Ville Syrjälä
2013-07-05 17:41     ` Paulo Zanoni
2013-07-05 17:54       ` Ville Syrjälä

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=20130730183040.GX5004@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=przanoni@gmail.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