From: Gerd Hoffmann <kraxel@redhat.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"open list:ABI/API" <linux-api@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
ML dri-devel <dri-devel@lists.freedesktop.org>,
"open list:VIRTIO GPU DRIVER"
<virtualization@lists.linux-foundation.org>,
Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH 3/5] update virtio gpu driver: add 3d/virgl support
Date: Thu, 10 Sep 2015 16:45:31 +0200 [thread overview]
Message-ID: <1441896331.11233.21.camel@redhat.com> (raw)
In-Reply-To: <CACvgo51Y7j0ka46Rfq2eBvXzP4q8Jc6x4j-JrYHDLkH6_xOh7w@mail.gmail.com>
Hi,
> Just a FYI - Daniel Vetter has a series in flight which deprecates
> DRM_UNLOCKED for KMS drivers.
Thanks for the heads up.
>
> > --- /dev/null
> > +++ b/include/uapi/drm/virtgpu_drm.h
> > @@ -0,0 +1,163 @@
>
> > +
> > +struct drm_virtgpu_3d_box {
> > + uint32_t x, y, z;
> > + uint32_t w, h, d;
> > +};
> > +
> There was a similar case (multiple variables declared on a single
> line) in drm core that caused confusion and we broke the 32bit compat.
> I thought I mention it - not advocating for/against the above declaration.
I highly doubt we'll ever change that.
But we can give each struct field its own row, sure.
> > +struct drm_virtgpu_3d_transfer_to_host {
> > + uint32_t bo_handle;
> > + struct drm_virtgpu_3d_box box;
> > + uint32_t level;
> > + uint32_t offset;
> > +};
> > +
> > +struct drm_virtgpu_3d_transfer_from_host {
> > + uint32_t bo_handle;
> > + struct drm_virtgpu_3d_box box;
> > + uint32_t level;
> > + uint32_t offset;
> > +};
> > +
> Afaics these seems to be used by the ioctls. If so the current
> declarations are not 32bit compat safe.
Why? As long as we have only 32bit fields in the struct the struct
itself gets a 32bit alignment too. So no layout differences between
32bit and 64bit.
> Things will also go badly if you consider expanding
> struct drm_virtgpu_3d_box in the distant future.
See above, very unlikely. And should that really happen we have bigger
problems anyway because it is quite likely that we have to touch the
virtio wire protocol too.
> A u32 pad after bo_handle and a 'pointer' to struct
> drm_virtgpu_3d_box might be the more flexible solution.
IMO this makes things more complicated for no good reason.
cheers,
Gerd
next prev parent reply other threads:[~2015-09-10 14:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1441798946-26233-1-git-send-email-kraxel@redhat.com>
2015-09-09 11:42 ` [PATCH 1/5] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_nolock Gerd Hoffmann
2015-09-09 11:42 ` [PATCH 2/5] virtio-gpu: add & use virtio_gpu_queue_fenced_ctrl_buffer Gerd Hoffmann
2015-09-09 11:42 ` [PATCH 3/5] update virtio gpu driver: add 3d/virgl support Gerd Hoffmann
2015-09-09 11:42 ` [PATCH 4/5] virtio_gpu: add basic prime support Gerd Hoffmann
2015-09-09 11:42 ` [PATCH 5/5] virtgpu: mark as a render gpu Gerd Hoffmann
[not found] ` <1441798946-26233-2-git-send-email-kraxel@redhat.com>
2015-09-10 8:39 ` [PATCH 1/5] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_nolock Emil Velikov
[not found] ` <CACvgo53bZnLoKHu_Gh-+mBVxs0MX07LckGc-hVxCpYxXmSTwRg@mail.gmail.com>
2015-09-10 14:04 ` Gerd Hoffmann
[not found] ` <1441798946-26233-4-git-send-email-kraxel@redhat.com>
2015-09-10 8:56 ` [PATCH 3/5] update virtio gpu driver: add 3d/virgl support Emil Velikov
[not found] ` <CACvgo51Y7j0ka46Rfq2eBvXzP4q8Jc6x4j-JrYHDLkH6_xOh7w@mail.gmail.com>
2015-09-10 10:32 ` Dave Airlie
[not found] ` <CAPM=9txn4yGwQg+ZdL5Z9ZtFzSnw3QfUtAWT5mSXgB_JL00pYA@mail.gmail.com>
2015-09-10 12:15 ` Emil Velikov
2015-09-10 14:45 ` Gerd Hoffmann [this message]
[not found] ` <1441798946-26233-6-git-send-email-kraxel@redhat.com>
2015-09-10 8:59 ` [PATCH 5/5] virtgpu: mark as a render gpu Emil Velikov
[not found] ` <CACvgo53wYvAk_bVouPZ-F7wNm=Diyouue8m1AvO0=U+PvL61_Q@mail.gmail.com>
2015-09-10 14:23 ` Gerd Hoffmann
2015-09-10 14:33 ` Emil Velikov
[not found] ` <CACvgo50SU46SYXBbVe+VGcAb6uFSj-iBY0E4=Vuuzf5RKbE+2Q@mail.gmail.com>
2015-09-10 14:52 ` Gerd Hoffmann
[not found] ` <1441896765.11233.25.camel@redhat.com>
2015-09-10 15:04 ` Emil Velikov
[not found] ` <CACvgo51skbWdw8E8RftZZjA2wUV0_RHPCiPbSR42XPY9aCfg6w@mail.gmail.com>
2015-09-11 6:32 ` Dave Airlie
[not found] ` <CAPM=9tz_4NSXnmmT6EuXGWp5wUK0vZfUhk-zhnhQ6QTgtEuVfQ@mail.gmail.com>
2015-09-11 9:16 ` Gerd Hoffmann
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=1441896331.11233.21.camel@redhat.com \
--to=kraxel@redhat.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.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 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).