From: Daniel Vetter <daniel@ffwll.ch>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: airlied@linux.ie, hdegoede@redhat.com,
dri-devel@lists.freedesktop.org, sean@poorly.run
Subject: Re: [PATCH 0/3] drm: Store USB device in struct drm_device
Date: Wed, 21 Oct 2020 22:05:27 +0200 [thread overview]
Message-ID: <20201021200527.GR401619@phenom.ffwll.local> (raw)
In-Reply-To: <20201021200129.GQ401619@phenom.ffwll.local>
On Wed, Oct 21, 2020 at 10:01:29PM +0200, Daniel Vetter wrote:
> On Wed, Oct 21, 2020 at 03:07:29PM +0200, Thomas Zimmermann wrote:
> > The drivers gm12u320 and udl operate on USB devices. They leave the
> > PCI device in struct drm_device empty and store the USB device in their
> > own driver structure.
> >
> > Fix this special case and save a few bytes by putting the USB device
> > into an anonymous union with the PCI data. It's expected that DRM
> > core and helpers only touch the PCI-device field for actual PCI devices.
>
> Uh no.
>
> If you're really concerned about the 8 bytes wasted, use drm_device->dev
> instead, and upcast it to the usb device. I think some drivers do this
> already (at least on the platform side iirc).
>
> But we had this entire drm_bus midlayer stuff already, and it took forever
> to sunset it. I don't want to go back, and saving 8 bytes in a giantic
> structure isn't worth that risk imo.
Typing this I realized that we could even move the pdev pointer to the
legacy chunk of drm_device. Instead of checking for drm_device->pdev we
could instead check for dev_is_pci(drm_device->dev) in the 1-2 core code
places.
But it's a pile of churn to roll that out to drivers, and I'm not sure the
8 bytes saved is even close to paying for that huge effort.
-Daniel
> > Thomas Zimmermann (3):
> > drm: Add reference to USB device to struct drm_device
> > drm/tiny/gm12u320: Store USB device in struct drm_device.udev
> > drm/udl: Store USB device in struct drm_device.udev
> >
> > drivers/gpu/drm/tiny/gm12u320.c | 52 +++++++++++++----------------
> > drivers/gpu/drm/udl/udl_connector.c | 8 ++---
> > drivers/gpu/drm/udl/udl_drv.c | 2 +-
> > drivers/gpu/drm/udl/udl_drv.h | 1 -
> > drivers/gpu/drm/udl/udl_main.c | 15 +++++----
> > include/drm/drm_device.h | 21 ++++++++----
> > 6 files changed, 52 insertions(+), 47 deletions(-)
> >
> > --
> > 2.28.0
> >
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
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:[~2020-10-21 20:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-21 13:07 [PATCH 0/3] drm: Store USB device in struct drm_device Thomas Zimmermann
2020-10-21 13:07 ` [PATCH 1/3] drm: Add reference to USB device to " Thomas Zimmermann
2020-10-21 13:07 ` [PATCH 2/3] drm/tiny/gm12u320: Store USB device in struct drm_device.udev Thomas Zimmermann
2020-10-21 13:07 ` [PATCH 3/3] drm/udl: " Thomas Zimmermann
2020-10-21 20:01 ` [PATCH 0/3] drm: Store USB device in struct drm_device Daniel Vetter
2020-10-21 20:05 ` Daniel Vetter [this message]
2020-10-22 9:20 ` Hans de Goede
2020-10-22 9:30 ` Thomas Zimmermann
2020-10-22 10:17 ` Hans de Goede
2020-10-22 10:57 ` Thomas Zimmermann
2020-10-22 11:32 ` Hans de Goede
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=20201021200527.GR401619@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=hdegoede@redhat.com \
--cc=sean@poorly.run \
--cc=tzimmermann@suse.de \
/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