From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Liviu Dudau <liviu.dudau@arm.com>
Cc: dri-devel@lists.freedesktop.org,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mali DP Maintainers <malidp@foss.arm.com>
Subject: Re: [PATCH 09/37] drm/arm: Add local 'fb' variables
Date: Tue, 22 Nov 2016 15:48:50 +0200 [thread overview]
Message-ID: <20161122134850.GB31595@intel.com> (raw)
In-Reply-To: <20161121115121.GI1005@e106497-lin.cambridge.arm.com>
On Mon, Nov 21, 2016 at 11:51:21AM +0000, Liviu Dudau wrote:
> On Fri, Nov 18, 2016 at 09:52:45PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Add a local 'fb' variable to a few places to get rid of the
> > 'crtc->primary->fb' stuff. Looks neater and helps me with my ppor
> > coccinelle skills later.
> >
> > In some places the local variable was already there, just not used
> > consistently.
> >
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
>
> Acked-by: Liviu Dudau <liviu.dudau@arm.com>
>
> Are you going to take the series through drm-misc or you want each sub-maintainer
> to cherry pick the patches?
Probably easier to suck it all in one go. Unless drm-misc maintainers
disagree?
>
> Best regards,
> Liviu
>
> > Cc: Brian Starkey <brian.starkey@arm.com>
> > Cc: Mali DP Maintainers <malidp@foss.arm.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/arm/hdlcd_crtc.c | 18 ++++++++++--------
> > drivers/gpu/drm/arm/malidp_planes.c | 6 +++---
> > 2 files changed, 13 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
> > index bbaa55add2d2..8a0fee03aa39 100644
> > --- a/drivers/gpu/drm/arm/hdlcd_crtc.c
> > +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
> > @@ -60,11 +60,12 @@ static int hdlcd_set_pxl_fmt(struct drm_crtc *crtc)
> > {
> > unsigned int btpp;
> > struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
> > + const struct drm_framebuffer *fb = crtc->primary->state->fb;
> > uint32_t pixel_format;
> > struct simplefb_format *format = NULL;
> > int i;
> >
> > - pixel_format = crtc->primary->state->fb->pixel_format;
> > + pixel_format = fb->pixel_format;
> >
> > for (i = 0; i < ARRAY_SIZE(supported_formats); i++) {
> > if (supported_formats[i].fourcc == pixel_format)
> > @@ -221,27 +222,28 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,
> > static void hdlcd_plane_atomic_update(struct drm_plane *plane,
> > struct drm_plane_state *state)
> > {
> > + struct drm_framebuffer *fb = plane->state->fb;
> > struct hdlcd_drm_private *hdlcd;
> > struct drm_gem_cma_object *gem;
> > u32 src_w, src_h, dest_w, dest_h;
> > dma_addr_t scanout_start;
> >
> > - if (!plane->state->fb)
> > + if (!fb)
> > return;
> >
> > src_w = plane->state->src_w >> 16;
> > src_h = plane->state->src_h >> 16;
> > dest_w = plane->state->crtc_w;
> > dest_h = plane->state->crtc_h;
> > - gem = drm_fb_cma_get_gem_obj(plane->state->fb, 0);
> > - scanout_start = gem->paddr + plane->state->fb->offsets[0] +
> > - plane->state->crtc_y * plane->state->fb->pitches[0] +
> > + gem = drm_fb_cma_get_gem_obj(fb, 0);
> > + scanout_start = gem->paddr + fb->offsets[0] +
> > + plane->state->crtc_y * fb->pitches[0] +
> > plane->state->crtc_x *
> > - drm_format_plane_cpp(plane->state->fb->pixel_format, 0);
> > + drm_format_plane_cpp(fb->pixel_format, 0);
> >
> > hdlcd = plane->dev->dev_private;
> > - hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, plane->state->fb->pitches[0]);
> > - hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_PITCH, plane->state->fb->pitches[0]);
> > + hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);
> > + hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_PITCH, fb->pitches[0]);
> > hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_COUNT, dest_h - 1);
> > hdlcd_write(hdlcd, HDLCD_REG_FB_BASE, scanout_start);
> > }
> > diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> > index 63eec8f37cfc..ee7f7663a307 100644
> > --- a/drivers/gpu/drm/arm/malidp_planes.c
> > +++ b/drivers/gpu/drm/arm/malidp_planes.c
> > @@ -137,8 +137,8 @@ static int malidp_de_plane_check(struct drm_plane *plane,
> >
> > /* packed RGB888 / BGR888 can't be rotated or flipped */
> > if (state->rotation != DRM_ROTATE_0 &&
> > - (state->fb->pixel_format == DRM_FORMAT_RGB888 ||
> > - state->fb->pixel_format == DRM_FORMAT_BGR888))
> > + (fb->pixel_format == DRM_FORMAT_RGB888 ||
> > + fb->pixel_format == DRM_FORMAT_BGR888))
> > return -EINVAL;
> >
> > ms->rotmem_size = 0;
> > @@ -147,7 +147,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,
> >
> > val = mp->hwdev->rotmem_required(mp->hwdev, state->crtc_h,
> > state->crtc_w,
> > - state->fb->pixel_format);
> > + fb->pixel_format);
> > if (val < 0)
> > return val;
> >
> > --
> > 2.7.4
> >
>
> --
> ====================
> | I would like to |
> | fix the world, |
> | but they're not |
> | giving me the |
> \ source code! /
> ---------------
> ¯\_(ツ)_/¯
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-11-22 13:48 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 19:52 [PATCH v2 00/37] drm: Deduplicate fb format information (v2) ville.syrjala
2016-11-18 19:52 ` [PATCH 01/37] drm/i915: Add local 'fb' variables ville.syrjala
2016-11-30 14:44 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 02/37] drm/radeon: " ville.syrjala
2016-11-18 19:52 ` [PATCH 03/37] drm/radeon: Use DIV_ROUND_UP() ville.syrjala
2016-11-18 19:52 ` [PATCH 04/37] drm/mgag200: Add local 'fb' variable ville.syrjala
2016-11-30 14:45 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 05/37] drm/ast: Add local 'fb' variables ville.syrjala
2016-11-30 14:47 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 06/37] drm/gma500: Add some " ville.syrjala
2016-11-30 14:49 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 07/37] drm/cirrus: " ville.syrjala
2016-11-30 14:50 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 08/37] drm/arcpgu: Add " ville.syrjala
2016-11-21 15:30 ` Alexey Brodkin
2016-11-23 16:00 ` Alexey Brodkin
2016-11-18 19:52 ` [PATCH 09/37] drm/arm: " ville.syrjala
2016-11-18 20:30 ` Brian Starkey
2016-11-21 11:51 ` Liviu Dudau
2016-11-22 13:48 ` Ville Syrjälä [this message]
2016-11-22 13:57 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 10/37] drm/nouveau: Fix crtc->primary->fb vs. drm_fb fail ville.syrjala
2016-11-30 14:56 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 11/37] drm/nouveau: Add local 'fb' variables ville.syrjala
2016-11-30 14:57 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 12/37] drm/vmwgfx: Populate fb->dev before drm_framebuffer_init() ville.syrjala
2016-11-21 17:10 ` Sinclair Yeh
2016-11-22 13:53 ` [PATCH v2 " ville.syrjala
2016-11-18 19:52 ` [PATCH 13/37] drm: Pass 'dev' to drm_helper_mode_fill_fb_struct() ville.syrjala
2016-12-14 20:48 ` [PATCH v2 " ville.syrjala
2016-11-18 19:52 ` [PATCH 14/37] drm/vmwgfx: Populate fb->pixel_format ville.syrjala
2016-11-21 17:10 ` Sinclair Yeh
2016-11-18 19:52 ` [PATCH 15/37] drm/qxl: Call drm_helper_mode_fill_fb_struct() before drm_framebuffer_init() ville.syrjala
2016-11-18 19:52 ` [PATCH 16/37] drm/virtio: " ville.syrjala
2016-11-30 15:32 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 17/37] drm/i915: Set fb->dev early on for inherited fbs ville.syrjala
2016-11-30 15:36 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH v2 18/37] drm: Populate fb->dev from drm_helper_mode_fill_fb_struct() ville.syrjala
2016-11-18 19:52 ` [PATCH v2 19/37] drm: Store a pointer to drm_format_info under drm_framebuffer ville.syrjala
2016-11-19 2:33 ` Laurent Pinchart
2016-11-18 19:52 ` [PATCH 20/37] drm/vmwgfx: Populate fb->format correctly ville.syrjala
2016-11-30 15:40 ` Daniel Vetter
2016-11-30 16:03 ` Ville Syrjälä
2016-11-30 16:09 ` Laurent Pinchart
2016-11-30 17:22 ` Daniel Vetter
2016-11-30 15:52 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 21/37] drm/i915: Populate fb->format early for inherited fbs ville.syrjala
2016-11-30 15:42 ` Daniel Vetter
2016-11-30 15:57 ` Ville Syrjälä
2016-11-30 16:09 ` Daniel Vetter
2016-11-18 19:52 ` [PATCH 22/37] drm: Reject fbs w/o format info in drm_framebuffer_init() ville.syrjala
2016-11-19 2:36 ` Laurent Pinchart
2016-11-18 19:52 ` [PATCH 23/37] drm: Replace drm_format_num_planes() with fb->format->num_planes ville.syrjala
2016-11-19 2:41 ` Laurent Pinchart
2016-12-14 21:30 ` [PATCH v2 " ville.syrjala
2016-11-18 19:53 ` [PATCH 24/37] drm/i915: Eliminate the ugly 'fb?:' constructs from the ilk/skl wm code ville.syrjala
2016-11-30 15:51 ` [Intel-gfx] " Daniel Vetter
2016-11-30 15:59 ` Ville Syrjälä
2016-11-18 19:53 ` [PATCH 25/37] drm: Replace drm_format_plane_cpp() with fb->format->cpp[] ville.syrjala
2016-11-19 2:44 ` Laurent Pinchart
2016-12-14 21:30 ` [PATCH v2 " ville.syrjala
2016-11-18 19:53 ` [PATCH 26/37] drm/fb_cma_helper: Replace drm_format_info() with fb->format ville.syrjala
2016-11-18 19:53 ` [PATCH 27/37] drm/nouveau: Use fb->format rather than drm_format_info() ville.syrjala
2016-11-30 15:59 ` Daniel Vetter
2016-11-18 19:53 ` [PATCH 28/37] drm/i915: Store a pointer to the pixel format info for fbc ville.syrjala
2016-11-30 16:07 ` [Intel-gfx] " Daniel Vetter
2016-11-18 19:53 ` [PATCH 29/37] drm: Add drm_framebuffer_plane_{width,height}() ville.syrjala
2016-11-18 19:53 ` [PATCH 30/37] drm/i915: Use drm_framebuffer_plane_{width, height}() where possible ville.syrjala
2016-11-30 16:04 ` Daniel Vetter
2016-11-30 16:06 ` [Intel-gfx] " Daniel Vetter
2016-11-18 19:53 ` [PATCH 31/37] drm: Nuke fb->depth ville.syrjala
2016-11-30 16:01 ` Daniel Vetter
2016-12-14 21:31 ` [PATCH v2 " ville.syrjala
2016-11-18 19:53 ` [PATCH v2 32/37] drm: Nuke fb->bits_per_pixel ville.syrjala
2016-12-14 21:32 ` [PATCH v3 " ville.syrjala
2016-11-18 19:53 ` [PATCH v2 33/37] drm: Nuke fb->pixel_format ville.syrjala
2016-11-19 2:55 ` Laurent Pinchart
2016-12-14 21:32 ` [PATCH v3 " ville.syrjala
2016-11-18 19:53 ` [PATCH 34/37] drm: Replace 'format->format' comparisons to just 'format' comparisons ville.syrjala
2016-11-19 2:56 ` Laurent Pinchart
2016-11-18 19:53 ` [PATCH 35/37] drm: Eliminate the useless "non-RGB fb" debug message ville.syrjala
2016-11-19 2:57 ` Laurent Pinchart
2016-11-18 19:53 ` [PATCH 36/37] drm: Add mode_config .get_format_info() hook ville.syrjala
2016-11-20 8:13 ` Laurent Pinchart
2016-11-21 13:18 ` Ville Syrjälä
2016-11-21 13:23 ` Laurent Pinchart
2016-11-21 13:31 ` Ville Syrjälä
2016-11-21 13:42 ` Laurent Pinchart
2016-11-21 14:25 ` Ville Syrjälä
2016-11-22 13:41 ` [PATCH v2 " ville.syrjala
2016-11-18 19:53 ` [PATCH 37/37] drm/i915: Implement .get_format_info() hook for CCS ville.syrjala
2016-11-18 23:31 ` Ben Widawsky
2016-11-21 14:37 ` Ville Syrjälä
2016-11-21 8:42 ` [Intel-gfx] " Tvrtko Ursulin
2016-11-21 13:27 ` Ville Syrjälä
2016-11-21 14:04 ` Tvrtko Ursulin
2016-11-21 11:18 ` [PATCH v2 00/37] drm: Deduplicate fb format information (v2) Christian König
2016-12-14 21:37 ` Ville Syrjälä
2016-12-15 13:41 ` 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=20161122134850.GB31595@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=liviu.dudau@arm.com \
--cc=malidp@foss.arm.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;
as well as URLs for NNTP newsgroup(s).