All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 04/26] drm/fb-helper: Add fill_info() functions
Date: Fri, 25 Jan 2019 09:48:40 +0100	[thread overview]
Message-ID: <20190125084840.GA3271@phenom.ffwll.local> (raw)
In-Reply-To: <af557016-66d4-6ebd-52b3-c11d4fb36514@tronnes.org>

On Thu, Jan 24, 2019 at 06:40:52PM +0100, Noralf Trønnes wrote:
> 
> 
> Den 24.01.2019 17.58, skrev Daniel Vetter:
> > The fbdev split between fix and var information is kinda
> > pointless for drm drivers since everything is fixed: The fbdev
> > emulation doesn't support changing modes at all.
> > 
> > Create a new simplified helper and use it in the generic fbdev
> > helper code. Follow-up patches will beef it up more and roll
> > it out to all drivers.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/drm_fb_helper.c | 27 +++++++++++++++++++++++++--
> >  include/drm/drm_fb_helper.h     |  1 +
> >  2 files changed, 26 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> > index 5eaccd202f4f..34c4ed378796 100644
> > --- a/drivers/gpu/drm/drm_fb_helper.c
> > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > @@ -2105,6 +2105,30 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
> >  }
> >  EXPORT_SYMBOL(drm_fb_helper_fill_var);
> >  
> > +/**
> > + * drm_fb_helper_fill_info - initializes fbdev information
> > + * @info: fbdev instance to set up
> > + * @fb_helper: fb helper instance to use as template
> > + *
> > + *
> > + * Sets up the variable and fixed fbdev metainformation from the given fb helper
> > + * instance and the drm framebuffer allocated in &drm_fb_helper.fb.
> > + *
> > + * Drivers should call this (or their equivalent setup code) from their
> > + * &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev
> > + * backing storage framebuffer.
> > + */
> > +void drm_fb_helper_fill_info(struct fb_info *info,
> 
> No need to pass in fb_info it's available as fb_helper->fbdev. Set by
> drm_fb_helper_alloc_fbi().

Uh, I get to edit all the patches. Still, thanks for pointing out.

I also realized that I've forgotten to add the dummy functiont for
!CONFIG_FB, will fix that too.

> > +			     struct drm_fb_helper *fb_helper)
> > +{
> > +	struct drm_framebuffer *fb = fb_helper->fb;
> > +
> > +	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
> > +	drm_fb_helper_fill_var(info, fb_helper, fb->width, fb->height);
> 
> AFAIU fb->width/height can be different from sizes->fb_width/fb_height
> when there's double/triple buffering. I belive you need to use the sizes
> values here.

Yup they're bigger than the actual screen size, but so is sizes: For
overallocting we adjust sizes before we call ->fb_probe, and the
->fb_probe callbacks in turn then call this helper. So I think it should
be all equivalent. Agreed or do I miss something?
-Daniel

> 
> Noralf.
> 
> > +
> > +}
> > +EXPORT_SYMBOL(drm_fb_helper_fill_info);
> > +
> >  static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
> >  						uint32_t maxX,
> >  						uint32_t maxY)
> > @@ -3163,8 +3187,7 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
> >  #endif
> >  	strcpy(fbi->fix.id, "DRM emulated");
> >  
> > -	drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->format->depth);
> > -	drm_fb_helper_fill_var(fbi, fb_helper, sizes->fb_width, sizes->fb_height);
> > +	drm_fb_helper_fill_info(fbi, fb_helper);
> >  
> >  	if (fb->funcs->dirty) {
> >  		struct fb_ops *fbops;
> > diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> > index bb9acea61369..e8d92724f472 100644
> > --- a/include/drm/drm_fb_helper.h
> > +++ b/include/drm/drm_fb_helper.h
> > @@ -292,6 +292,7 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
> >  			    uint32_t fb_width, uint32_t fb_height);
> >  void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
> >  			    uint32_t depth);
> > +void drm_fb_helper_fill_info(struct fb_info *info, struct drm_fb_helper *fb_helper);
> >  
> >  void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);
> >  
> > 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-01-25  8:48 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 16:58 [PATCH 00/26] some cleanups, mostly around fbdev emulation Daniel Vetter
2019-01-24 16:58 ` [PATCH 01/26] drm/irq: Don't check for DRIVER_HAVE_IRQ in drm_irq_(un)install Daniel Vetter
2019-01-24 16:58   ` Daniel Vetter
2019-01-24 16:58   ` Daniel Vetter
2019-01-24 16:58   ` Daniel Vetter
     [not found]   ` <20190124165831.16427-2-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2019-01-25 10:40     ` Sam Ravnborg
2019-01-25 10:40       ` Sam Ravnborg
2019-01-25 10:40       ` Sam Ravnborg
2019-01-25 10:40       ` Sam Ravnborg
2019-01-25 10:40   ` Sam Ravnborg
2019-01-25 15:09   ` Emil Velikov
2019-01-25 15:09     ` Emil Velikov
2019-01-25 15:09     ` Emil Velikov
2019-01-25 15:09     ` Emil Velikov
2019-01-25 15:09   ` Emil Velikov
2019-01-24 16:58 ` [PATCH 02/26] drm: Switch DRIVER_ flags to an enum Daniel Vetter
2019-01-24 17:38   ` Sam Ravnborg
2019-01-25  9:35     ` Daniel Vetter
2019-01-24 16:58 ` [PATCH 03/26] drm/irq: Ditch DRIVER_IRQ_SHARED Daniel Vetter
2019-01-25 14:46   ` Emil Velikov
2019-01-25 16:14     ` [Intel-gfx] " Daniel Vetter
2019-01-28 11:47       ` Emil Velikov
2019-01-24 16:58 ` [PATCH 04/26] drm/fb-helper: Add fill_info() functions Daniel Vetter
2019-01-24 17:40   ` Noralf Trønnes
2019-01-25  8:48     ` Daniel Vetter [this message]
2019-01-25  9:46       ` Noralf Trønnes
2019-01-25 10:15         ` Daniel Vetter
2019-01-24 16:58 ` [PATCH 05/26] drm/fb-helper: set fbi->fix.id in fill_info() Daniel Vetter
2019-01-24 17:28   ` Daniel Vetter
2019-01-24 16:58 ` [PATCH 06/26] drm/fb_helper: set info->par " Daniel Vetter
2019-01-24 17:45   ` Sam Ravnborg
2019-01-25  8:44     ` Daniel Vetter
2019-01-25 18:25       ` Sam Ravnborg
2019-01-24 16:58 ` [PATCH 07/26] drm/amdgpu: Use drm_fb_helper_fill_info Daniel Vetter
2019-01-24 16:58 ` [PATCH 08/26] drm/armada: " Daniel Vetter
2019-01-24 16:58 ` [PATCH 09/26] drm/ast: " Daniel Vetter
2019-01-24 18:00   ` Sam Ravnborg
2019-01-25  8:51     ` Daniel Vetter
2019-01-24 16:58 ` [PATCH 10/26] drm/cirrus: " Daniel Vetter
2019-01-24 16:58 ` [PATCH 11/26] drm/exynos: " Daniel Vetter
2019-01-24 16:58   ` Daniel Vetter
2019-01-24 16:58 ` [PATCH 12/26] drm/gma500: " Daniel Vetter
2019-01-24 16:58 ` [PATCH 13/26] drm/hibmc: " Daniel Vetter
2019-01-24 16:58 ` [PATCH 14/26] drm/i915: " Daniel Vetter
2019-01-24 16:58 ` [PATCH 15/26] drm/mga200g: " Daniel Vetter
     [not found] ` <20190124165831.16427-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2019-01-24 16:58   ` [PATCH 16/26] drm/bochs: " Daniel Vetter
2019-01-24 16:58   ` [PATCH 26/26] drm/<drivers>: Don't set FBINFO_(FLAG_)DEFAULT Daniel Vetter
2019-01-24 16:58     ` Daniel Vetter
2019-01-25 15:02     ` Emil Velikov
2019-01-25 15:02       ` [Intel-gfx] " Emil Velikov
2019-01-29  9:58       ` Daniel Vetter
2019-01-29  9:58         ` Daniel Vetter
2019-01-25 15:14     ` Thierry Reding
2019-01-25 15:14       ` Thierry Reding
2019-01-24 16:58 ` [PATCH 17/26] drm/nouveau: Use drm_fb_helper_fill_info Daniel Vetter
2019-01-24 16:58 ` [PATCH 18/26] drm/omap: " Daniel Vetter
2019-01-24 16:58 ` [PATCH 19/26] drm/qxl: " Daniel Vetter
2019-01-25  6:39   ` Gerd Hoffmann
2019-01-25  6:39   ` Gerd Hoffmann
2019-01-25  8:52     ` Daniel Vetter
2019-01-25  8:52     ` Daniel Vetter
2019-01-24 16:58 ` [PATCH 20/26] drm/radeon: " Daniel Vetter
2019-01-24 16:58 ` [PATCH 21/26] drm/rockchip: " Daniel Vetter
2019-01-27 19:18   ` Heiko Stuebner
2019-01-27 19:18     ` Heiko Stuebner
2019-01-24 16:58 ` [PATCH 22/26] drm/qxl: " Daniel Vetter
2019-01-25 15:14   ` Thierry Reding
2019-01-24 16:58 ` [PATCH 23/26] drm/udl: " Daniel Vetter
2019-01-24 16:58 ` [PATCH 24/26] staging/vboxvideo: " Daniel Vetter
2019-01-25  8:51   ` Greg Kroah-Hartman
2019-01-24 16:58 ` [PATCH 25/26] drm/fb-helper: Unexport fill_{var,info} Daniel Vetter
2019-01-24 17:01 ` ✗ Fi.CI.BAT: failure for some cleanups, mostly around fbdev emulation 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=20190125084840.GA3271@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=noralf@tronnes.org \
    /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.