All of lore.kernel.org
 help / color / mirror / Atom feed
* New "xf86-video-armsoc" DDX driver
@ 2012-05-21  8:42 Tom Cooksey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Cooksey @ 2012-05-21  8:42 UTC (permalink / raw)
  To: xorg-devel-go0+a7rfsptAfugRpC6u6w
  Cc: linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi All,

For the last few months we (ARM MPD... "The Mali guys") have been working on
getting X.Org up and running with Mali T6xx (ARM's next-generation GPU IP).
The approach is very similar (well identical I think) to how things work on
OMAP: We use a DRM driver to manage the display controller via KMS. The KMS
driver also allocates both scan-out and pixmap/back buffers via the
DRM_IOCTL_MODE_CREATE_DUMB ioctl which is internally implemented with GEM.
When returning buffers to DRI clients, the x-server uses flink to get a
global handle to a buffer which it passes back to the DRI client (in our
case the Mali-T600 X11 EGL winsys). The client then uses the new PRIME
ioctls to export the GEM buffer it received from the x-server to a dma_buf
fd. This fd is then passed into the T6xx kernel driver via our own job
dispatch user/kernel API (we're not using DRM for driving the GPU, only the
display controller).

Note: ARM doesn't generally provide the display controller IP block, so this
is really for our customers/Linaro to develop, though we do have something
hacked up for ARM's own PL111 display controller on our Versatile Express
development platform which we'll be open sourcing/up-streaming asap via
Linaro. 

We believe most ARM SoCs are likely to work the same way, at least those
with 3rd-party GPU IP blocks/drivers (so everyone except Qualcomm & nVidia).
As mentioned, this is certainly how the OMAP integration works. As such,
we've taken the OMAP DDX driver Rob Clark wrote and hacked on it to make it
work for Mali. The patch is actually relatively small, which is not really
too surprising as all the driver is doing is allocating buffers and managing
a display controller via a device-agnostic interface (KMS). All the
device-specific code is kept in the DRM driver and the client GLES/EGL
library. Given that the DDX driver doesn't contain any device-specific code,
we're going to take the OMAP DDX as a baseline and try and make it more
generic. Our immediate goals are to make it work on our own Versatile
Express development platform and on Samsung's Exynos 5250 SoC, however our
hope is to have a single DDX driver which can cover OMAP, Exynos, ST-E's
Nova/Thor platforms and probably others too. It's even been suggested it
could work with Mesa's sw backend(?).

Anyway, the DDX is very much a work-in-progress and is still heavily branded
OMAP, even though it's working (almost) perfectly on VExpress & Exynos too
(re-branding isn't too high-up our priority list at the moment). We are
actively developing this driver and will be doing so in a public git
repository hosted by Linaro. We will not be maintaining any private
repository behind ARM's firewall or anything like that - you'll see what we
see. The first patches have now been pushed, so if anyone's interested in
seeing what we have so far or wants to track development, the tree is here:

http://git.linaro.org/gitweb?p=arm/xorg/driver/xf86-video-armsoc.git;a=summa
ry

Note: When we originally spoke to Rob Clark about this, he suggested we take
the already-generic xf86-video-modesetting and just add the dri2 code to it.
This is indeed how we started out, however as we progressed it became clear
that the majority of the code we wanted was in the omap driver and were
having to work fairly hard to keep some of the original modesetting code.
This is why we've now changed tactic and just forked the OMAP driver,
something Rob is more than happy for us to do.


One thing the DDX driver isn't doing yet is making use of 2D hw blocks. In
the short-term, we will simply create a branch off of the "generic" master
for each SoC and add 2D hardware support there. We do however want a more
permanent solution which doesn't need a separate branch per SoC. Some of the
suggested solutions are:

* Add a new generic DRM ioctl API for larger 2D operations (I would imagine
small blits/blends would be done in SW).
* Use SW rendering for everything other than solid blits and use v4l2's
blitting API for those (importing/exporting buffers to be blitted using
dma_buf). The theory here is that most UIs are rendered with GLES and so you
only need 2D hardware for blits. I think we'll prototype this approach on
Exynos.
* Define a new x-server sub-module interface to allow a seperate .so 2D
driver to be loaded (this is the approach the current OMAP DDX uses).

We are hoping someone might have some advice & suggestions on how to proceed
with regards to 2D. We're also very interested in any feedback, both on the
DDX driver specifically and on the approach we're taking in general.


Cheers,

Tom




_______________________________________________
xorg-devel-go0+a7rfsptAfugRpC6u6w@public.gmane.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: New "xf86-video-armsoc" DDX driver
       [not found] <4fba0034.e1d9440a.7f33.0bfeSMTPIN_ADDED@mx.google.com>
@ 2012-05-21  8:55 ` Dave Airlie
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Airlie @ 2012-05-21  8:55 UTC (permalink / raw)
  To: Tom Cooksey; +Cc: linaro-mm-sig, xorg-devel, dri-devel

>
> For the last few months we (ARM MPD... "The Mali guys") have been working on
> getting X.Org up and running with Mali T6xx (ARM's next-generation GPU IP).
> The approach is very similar (well identical I think) to how things work on
> OMAP: We use a DRM driver to manage the display controller via KMS. The KMS
> driver also allocates both scan-out and pixmap/back buffers via the
> DRM_IOCTL_MODE_CREATE_DUMB ioctl which is internally implemented with GEM.
> When returning buffers to DRI clients, the x-server uses flink to get a
> global handle to a buffer which it passes back to the DRI client (in our
> case the Mali-T600 X11 EGL winsys). The client then uses the new PRIME
> ioctls to export the GEM buffer it received from the x-server to a dma_buf
> fd. This fd is then passed into the T6xx kernel driver via our own job
> dispatch user/kernel API (we're not using DRM for driving the GPU, only the
> display controller).

So using dumb in this was is probably a bit of an abuse, since dumb is defined
to provide buffers not to be used for acceleration hw. Since when we allocate
dumb buffers, we can't know what special hw layouts are required (tiling etc)
for optimal performance for accel. The logic to work that out is rarely generic.

>
> http://git.linaro.org/gitweb?p=arm/xorg/driver/xf86-video-armsoc.git;a=summa
> ry
>
> Note: When we originally spoke to Rob Clark about this, he suggested we take
> the already-generic xf86-video-modesetting and just add the dri2 code to it.
> This is indeed how we started out, however as we progressed it became clear
> that the majority of the code we wanted was in the omap driver and were
> having to work fairly hard to keep some of the original modesetting code.
> This is why we've now changed tactic and just forked the OMAP driver,
> something Rob is more than happy for us to do.

It does seem like porting to -modesetting, and maybe cleaning up modesetting
if its needs it. The modesetting driver is pretty much just a make it
work port of
the radeon/nouveau/intel code "shared" code.

> One thing the DDX driver isn't doing yet is making use of 2D hw blocks. In
> the short-term, we will simply create a branch off of the "generic" master
> for each SoC and add 2D hardware support there. We do however want a more
> permanent solution which doesn't need a separate branch per SoC. Some of the
> suggested solutions are:
>
> * Add a new generic DRM ioctl API for larger 2D operations (I would imagine
> small blits/blends would be done in SW).

Not going to happen, again the hw isn't generic in this area, some hw requires
3D engines to do 2D ops etc. The limitations on some hw with overlaps etc,
and finally it breaks the rule about generic ioctls for acceleration operations.

> * Use SW rendering for everything other than solid blits and use v4l2's
> blitting API for those (importing/exporting buffers to be blitted using
> dma_buf). The theory here is that most UIs are rendered with GLES and so you
> only need 2D hardware for blits. I think we'll prototype this approach on
> Exynos.

Seems a bit over the top,
> * Define a new x-server sub-module interface to allow a seperate .so 2D
> driver to be loaded (this is the approach the current OMAP DDX uses).

This seems the sanest.

I haven't time this week to review the code, but I'll try and take a look when
time permits.

Dave.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* New "xf86-video-armsoc" DDX driver
@ 2012-05-21  8:42 Tom Cooksey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Cooksey @ 2012-05-21  8:42 UTC (permalink / raw)
  To: xorg-devel; +Cc: linaro-mm-sig, dri-devel

Hi All,

For the last few months we (ARM MPD... "The Mali guys") have been working on
getting X.Org up and running with Mali T6xx (ARM's next-generation GPU IP).
The approach is very similar (well identical I think) to how things work on
OMAP: We use a DRM driver to manage the display controller via KMS. The KMS
driver also allocates both scan-out and pixmap/back buffers via the
DRM_IOCTL_MODE_CREATE_DUMB ioctl which is internally implemented with GEM.
When returning buffers to DRI clients, the x-server uses flink to get a
global handle to a buffer which it passes back to the DRI client (in our
case the Mali-T600 X11 EGL winsys). The client then uses the new PRIME
ioctls to export the GEM buffer it received from the x-server to a dma_buf
fd. This fd is then passed into the T6xx kernel driver via our own job
dispatch user/kernel API (we're not using DRM for driving the GPU, only the
display controller).

Note: ARM doesn't generally provide the display controller IP block, so this
is really for our customers/Linaro to develop, though we do have something
hacked up for ARM's own PL111 display controller on our Versatile Express
development platform which we'll be open sourcing/up-streaming asap via
Linaro. 

We believe most ARM SoCs are likely to work the same way, at least those
with 3rd-party GPU IP blocks/drivers (so everyone except Qualcomm & nVidia).
As mentioned, this is certainly how the OMAP integration works. As such,
we've taken the OMAP DDX driver Rob Clark wrote and hacked on it to make it
work for Mali. The patch is actually relatively small, which is not really
too surprising as all the driver is doing is allocating buffers and managing
a display controller via a device-agnostic interface (KMS). All the
device-specific code is kept in the DRM driver and the client GLES/EGL
library. Given that the DDX driver doesn't contain any device-specific code,
we're going to take the OMAP DDX as a baseline and try and make it more
generic. Our immediate goals are to make it work on our own Versatile
Express development platform and on Samsung's Exynos 5250 SoC, however our
hope is to have a single DDX driver which can cover OMAP, Exynos, ST-E's
Nova/Thor platforms and probably others too. It's even been suggested it
could work with Mesa's sw backend(?).

Anyway, the DDX is very much a work-in-progress and is still heavily branded
OMAP, even though it's working (almost) perfectly on VExpress & Exynos too
(re-branding isn't too high-up our priority list at the moment). We are
actively developing this driver and will be doing so in a public git
repository hosted by Linaro. We will not be maintaining any private
repository behind ARM's firewall or anything like that - you'll see what we
see. The first patches have now been pushed, so if anyone's interested in
seeing what we have so far or wants to track development, the tree is here:

http://git.linaro.org/gitweb?p=arm/xorg/driver/xf86-video-armsoc.git;a=summa
ry

Note: When we originally spoke to Rob Clark about this, he suggested we take
the already-generic xf86-video-modesetting and just add the dri2 code to it.
This is indeed how we started out, however as we progressed it became clear
that the majority of the code we wanted was in the omap driver and were
having to work fairly hard to keep some of the original modesetting code.
This is why we've now changed tactic and just forked the OMAP driver,
something Rob is more than happy for us to do.


One thing the DDX driver isn't doing yet is making use of 2D hw blocks. In
the short-term, we will simply create a branch off of the "generic" master
for each SoC and add 2D hardware support there. We do however want a more
permanent solution which doesn't need a separate branch per SoC. Some of the
suggested solutions are:

* Add a new generic DRM ioctl API for larger 2D operations (I would imagine
small blits/blends would be done in SW).
* Use SW rendering for everything other than solid blits and use v4l2's
blitting API for those (importing/exporting buffers to be blitted using
dma_buf). The theory here is that most UIs are rendered with GLES and so you
only need 2D hardware for blits. I think we'll prototype this approach on
Exynos.
* Define a new x-server sub-module interface to allow a seperate .so 2D
driver to be loaded (this is the approach the current OMAP DDX uses).

We are hoping someone might have some advice & suggestions on how to proceed
with regards to 2D. We're also very interested in any feedback, both on the
DDX driver specifically and on the approach we're taking in general.


Cheers,

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-21  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21  8:42 New "xf86-video-armsoc" DDX driver Tom Cooksey
2012-05-21  8:42 Tom Cooksey
     [not found] <4fba0034.e1d9440a.7f33.0bfeSMTPIN_ADDED@mx.google.com>
2012-05-21  8:55 ` Dave Airlie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.