dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	ML dri-devel <dri-devel@lists.freedesktop.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>
Subject: Re: [PATCH 3/4] drm/virtio: remove drm_dev_set_unique workaround
Date: Fri, 13 Apr 2018 17:45:53 +0200	[thread overview]
Message-ID: <20180413154553.GY31310@phenom.ffwll.local> (raw)
In-Reply-To: <CACvgo52nkFxR_pUr86wkprVwFw6ZZ_jD8GeYwUvpfLxMaZ_+DQ@mail.gmail.com>

On Mon, Apr 09, 2018 at 12:25:57PM +0100, Emil Velikov wrote:
> On 9 April 2018 at 11:24, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> > On 9 April 2018 at 09:26, Daniel Vetter <daniel@ffwll.ch> wrote:
> >
> >>>  - point drm_device::dev to the parent of the virtio_device
> >>> The biggest hack imaginable, if even possible.
> >>
> >> What would/could break if we do this? Why is this a hack?
> >
> > It _feels_ very hacky to reach/store the parent of the _parent_ device given.
> > Dummy grep for \<dev\> showed hundreds of entries, but many of those
> > are unrelated.
> > Will give it a closer look - might not be as bad, as I originally thought.
> >
> Here are the side-effects:
> 
> Semantic changes
> * using the wrong device for i2c - via drm_dp_add_port
> * passing the wrong device to framebuffer_alloc - via drm_fb_helper_alloc_fbi
> * using the wrong parent device to drm_gem_prime_import_dev
> 
> Visual
> * printing the wrong device on DRM_DEV_ERROR, dev_info, drm_printer, etc
> 
> Needs a pdev_to_virtio() since we have the struct
> virtio_device::struct device::struct device parent - via
> virtio_gpu_driver_load
> 
> One, might get away with the above, by introducing drm_device::device
> bus_device, or alike.
> That one is used solely for the unique magic :-\
> 
> It sounds tad dirty, so I'm leaning with just commenting it. Open to
> alternative suggestions though.

Yeah, big huge comment is probably best. And the 10 year plan to nuke this
all :-)
-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

  reply	other threads:[~2018-04-13 15:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  1:24 [PATCH 1/4] drm/vgem: Fix vgem_init to get drm device avaliable Emil Velikov
2018-03-28  1:24 ` [PATCH 2/4] drm: BUG_ON if passing NULL parent to drm_dev_init Emil Velikov
2018-03-28  7:17   ` Daniel Vetter
2018-03-28  1:24 ` [PATCH 3/4] drm/virtio: remove drm_dev_set_unique workaround Emil Velikov
2018-03-28  7:18   ` Daniel Vetter
2018-03-28 10:27   ` Laszlo Ersek
2018-03-28 14:35     ` Emil Velikov
2018-03-29 11:17       ` Laszlo Ersek
2018-04-03 17:13         ` Emil Velikov
2018-04-04 17:29           ` Laszlo Ersek
2018-04-06 12:15             ` Laszlo Ersek
2018-04-06 12:56               ` Emil Velikov
2018-04-09  8:26                 ` Daniel Vetter
2018-04-09 10:24                   ` Emil Velikov
2018-04-09 11:25                     ` Emil Velikov
2018-04-13 15:45                       ` Daniel Vetter [this message]
2018-04-06 13:06               ` Gerd Hoffmann
2018-03-28  1:24 ` [PATCH 4/4] drm: drm_dev_set_unique private, again Emil Velikov
2018-03-28  7:18   ` Daniel Vetter
2018-03-28  7:16 ` [PATCH 1/4] drm/vgem: Fix vgem_init to get drm device avaliable Daniel Vetter
2018-03-28 14:45   ` Emil Velikov
2018-03-28 14:49 ` Chris Wilson
2018-03-28 15:11   ` Emil Velikov
2018-03-29  7:17     ` Daniel Vetter
2018-04-04 10:46       ` Emil Velikov
2018-04-04 12:07         ` 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=20180413154553.GY31310@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.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