From: Daniel Vetter <daniel@ffwll.ch>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: thomas.petazzoni@free-electrons.com, dri-devel@lists.freedesktop.org
Subject: Re: [RFC 1/5] drm: Add DRM support for tiny LCD displays
Date: Tue, 12 Apr 2016 12:40:48 +0200 [thread overview]
Message-ID: <20160412104048.GB2510@phenom.ffwll.local> (raw)
In-Reply-To: <56FEC8E1.50907@tronnes.org>
On Fri, Apr 01, 2016 at 09:15:45PM +0200, Noralf Trønnes wrote:
> Den 29.03.2016 09:27, skrev Daniel Vetter:
> >I was wondering whether we couldn't avoid the _with_funcs here by setting
> >up fbdefio iff ->dirty is set. Then you could add the generic defio setup
> >code to drm_fbdev_cma_create after helper->fb is allocated, but only if
> >helper->fb->funcs->dirty is set. Makes for a bit less boilerplate.
> >
> >Or did I miss something?
>
> I don't see how I can avoid drm_fbdev_cma_init_with_funcs():
>
> static struct drm_framebuffer_funcs tinydrm_fb_cma_funcs = {
> .destroy = drm_fb_cma_destroy,
> .create_handle = drm_fb_cma_create_handle,
> .dirty = tinydrm_fbdev_dirty,
> };
>
> static int tinydrm_fbdev_create(struct drm_fb_helper *helper,
> struct drm_fb_helper_surface_size *sizes)
> {
> return drm_fbdev_cma_create_with_funcs(helper, sizes,
> &tinydrm_fb_cma_funcs);
> }
>
> static const struct drm_fb_helper_funcs tinydrm_fb_helper_funcs = {
> .fb_probe = tinydrm_fbdev_create,
> };
>
> int tinydrm_fbdev_init(struct tinydrm_device *tdev)
> {
> struct drm_device *dev = tdev->base;
> struct drm_fbdev_cma *cma;
>
> cma = drm_fbdev_cma_init_with_funcs(dev, 16,
> dev->mode_config.num_crtc,
> dev->mode_config.num_connector,
> &tinydrm_fb_helper_funcs);
> if (IS_ERR(cma))
> return PTR_ERR(cma);
>
> tdev->fbdev_cma = cma;
>
> return 0;
> }
>
>
> Thanks for your feedback so far Daniel, I quite like the direction this is
> taking. I'll try and implement it in a new version of the patchset.
Yeah I was dense really. One option to avoid most of this might be to add
a framebuffer_create helper function to dev->mode_config->helpers (we
don't yet have a vtable for global helper hooks, so would need to add
that), which instead of the top-level uin32_t -> drm_framebuffer gets a
struct *drm_gem_object[4] array parameter with already decoded buffer
object handles. Drivers could then use that to add their own dirtyfb hooks
and other special sauce to drm_framebuffer, while cma would just use that
hook (if it's set) instead of calling cma_create_fb directly.
So yeah, essentially go back to one of your original proposals. But it
will still not be entirely clean, so whatever you think looks better I'd
say ;-)
-Daniel
--
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
next prev parent reply other threads:[~2016-04-12 10:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 13:34 [RFC 0/5] drm: Add support for tiny LCD displays Noralf Trønnes
2016-03-16 13:34 ` [RFC 1/5] drm: Add DRM " Noralf Trønnes
2016-03-16 15:11 ` Daniel Vetter
2016-03-17 21:51 ` Noralf Trønnes
2016-03-18 17:47 ` Daniel Vetter
2016-03-23 17:07 ` Noralf Trønnes
2016-03-23 17:28 ` Daniel Vetter
2016-03-25 10:41 ` Noralf Trønnes
2016-03-29 7:27 ` Daniel Vetter
2016-04-01 19:15 ` Noralf Trønnes
2016-04-12 10:40 ` Daniel Vetter [this message]
2016-03-23 17:37 ` David Herrmann
2016-03-25 19:39 ` Noralf Trønnes
2016-03-16 13:34 ` [RFC 2/5] drm/tinydrm: Add lcd register abstraction Noralf Trønnes
2016-03-16 13:34 ` [RFC 3/5] drm/tinydrm/lcdreg: Add SPI support Noralf Trønnes
2016-03-16 13:34 ` [RFC 4/5] drm/tinydrm: Add mipi-dbi support Noralf Trønnes
2016-03-16 13:34 ` [RFC 5/5] drm/tinydrm: Add support for several Adafruit TFT displays Noralf Trønnes
2016-03-16 14:50 ` [RFC 0/5] drm: Add support for tiny LCD displays Daniel Vetter
2016-03-16 18:26 ` Eric Anholt
2016-03-17 22:00 ` Noralf Trønnes
2016-03-18 17:48 ` Daniel Vetter
2016-03-26 19:11 ` Noralf Trønnes
2016-03-29 7:29 ` Daniel Vetter
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=20160412104048.GB2510@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=noralf@tronnes.org \
--cc=thomas.petazzoni@free-electrons.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