dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@amd.com>
To: Jerome Glisse <j.glisse@gmail.com>, dri-devel@lists.freedesktop.org
Subject: Re: AMD GPU new API for new module
Date: Thu, 9 Oct 2014 09:54:14 +0300	[thread overview]
Message-ID: <54363116.2050900@amd.com> (raw)
In-Reply-To: <20141008160026.GA7643@gmail.com>

Hi Jerome,

Do you think your proposed change should also be applied to amdkfd's
IOCTLs ?

	Oded

On 08/10/14 19:00, Jerome Glisse wrote:
> Hi,
> 
> So if i do not start the discussion now it might be already too late. Given
> plan to converge open source driver and closed source driver to use a single
> common kernel driver and that this would be a new kernel driver. This is an
> opportunity to fix some of the radeon design issues (at least things that i
> would have done differently if only i could get some gas for my DeLorean).
> 
> Among the thing that i will not do is the chunk stuff associated with cs
> ioctl. I find it ugly, if my memory serve me well i was trying to be future
> proof and allow the cs ioctl to be extended. While this original aim have
> been somewhat successfully, i think it was the wrong day to do it.
> 
> My lastest (and what i still believe to be a good idea until proven wrong),
> is to change the way we do ioctl and use a little trick. This idea was also
> spark by the continuous additions we do to info ioctl which is getting ugly.
> 
> So idea is simple, each ioctl would use some struct like :
> 
> struct radeon_ioctl {
> 	u32	version;
> 	u32	size;
> };
> 
> The version field is the key here, think of it as an index into an array of
> ioctl dispatch functions. So something like :
> 
> struct radeon_ioctls {
> 	int (*iotcl)[MAX_IOCTL_NUM](void *data, ...);
> };
> 
> struct radeon_ioctls rdispatch_ioctls[N];
> 
> And now all ioctl go through this single entry point :
> 
> int radeon_ioctl_stub(int ioctl, void *data, ...)
> {
> 	struct radeon_ioctl *rio = data;
> 
> 	return rdispatch_ioctls[rio->version][ioctl](data, ...);
> }
> 
> So this is rough idea but the point is that we can do proper ioctl versioning
> and have separate functions for each new versions and avoid ioctl cruft, or
> at least this is the theory.
> 
> The two things this gave us, is feedback from userspace as we the version the
> kernel will know which version of userspace it is dealing with. The others one
> is that it does allow you to introduce a completely new API either for new
> generation of hardware or just as an evolution. And small bonus is that it
> does allow to slowly phase out API that we consider broken (ioctl per ioctl).
> 
> So this is the main design change that i would do. I should probably rought
> up something that goes deeper for the cs ioctl.
> 
> Cheers,
> Jérôme
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2014-10-09  6:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 16:00 AMD GPU new API for new module Jerome Glisse
2014-10-08 16:43 ` Christian König
2014-10-09  6:54 ` Oded Gabbay [this message]
2014-10-09  8:02   ` Jerome Glisse
2014-10-09 10:15     ` Oded Gabbay
2014-10-09 15:55       ` Daniel Vetter
2014-10-09 18:33         ` Oded Gabbay
2014-10-11 18:30           ` Daniel Vetter
2014-10-12  8:13             ` Oded Gabbay
2014-10-12  9:33             ` Christian König
2014-10-09  7:32 ` Rob Clark
2014-10-09  7:54   ` Jerome Glisse
2014-10-09  9:49     ` Christian König
2014-10-09 12:13     ` Rob Clark
2014-10-09  9:20 ` Daniel Vetter
2014-10-13 21:13   ` Dave Airlie
2014-10-10  2:25 ` Olaf Buddenhagen

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=54363116.2050900@amd.com \
    --to=oded.gabbay@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j.glisse@gmail.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