<s>
The	O
Direct	B-Application
Rendering	I-Application
Infrastructure	I-Application
(	O
DRI	O
)	O
is	O
the	O
framework	B-Architecture
comprising	O
the	O
modern	O
Linux	B-Operating_System
graphics	O
stack	O
which	O
allows	O
unprivileged	O
user-space	O
programs	O
to	O
issue	O
commands	O
to	O
graphics	B-Device
hardware	I-Device
without	O
conflicting	O
with	O
other	O
programs	O
.	O
</s>
<s>
The	O
main	O
use	O
of	O
DRI	O
is	O
to	O
provide	O
hardware	B-General_Concept
acceleration	I-General_Concept
for	O
the	O
Mesa	B-Application
implementation	O
of	O
OpenGL	B-Application
.	O
</s>
<s>
DRI	O
has	O
also	O
been	O
adapted	O
to	O
provide	O
OpenGL	B-Application
acceleration	O
on	O
a	O
framebuffer	B-Language
console	I-Language
without	O
a	O
display	O
server	O
running	O
.	O
</s>
<s>
DRI	O
implementation	O
is	O
scattered	O
through	O
the	O
X	B-Operating_System
Server	I-Operating_System
and	O
its	O
associated	O
client	O
libraries	O
,	O
Mesa	B-Application
3D	I-Application
and	O
the	O
Direct	B-Application
Rendering	I-Application
Manager	I-Application
kernel	B-Operating_System
subsystem	O
.	O
</s>
<s>
All	O
of	O
its	O
source	O
code	O
is	O
free	B-Application
software	I-Application
.	O
</s>
<s>
In	O
the	O
classic	O
X	B-Operating_System
Window	I-Operating_System
System	I-Operating_System
architecture	O
the	O
X	B-Operating_System
Server	I-Operating_System
is	O
the	O
only	O
process	O
with	O
exclusive	O
access	O
to	O
the	O
graphics	B-Device
hardware	I-Device
,	O
and	O
therefore	O
the	O
one	O
which	O
does	O
the	O
actual	O
rendering	O
on	O
the	O
framebuffer	B-Algorithm
.	O
</s>
<s>
All	O
that	O
X	B-Operating_System
clients	O
do	O
is	O
communicate	O
with	O
the	O
X	B-Operating_System
Server	I-Operating_System
to	O
dispatch	O
rendering	O
commands	O
.	O
</s>
<s>
Those	O
commands	O
are	O
hardware	O
independent	O
,	O
meaning	O
that	O
the	O
X11	B-Device
protocol	I-Device
provides	O
an	O
API	B-Application
that	O
abstracts	O
the	O
graphics	O
device	O
so	O
the	O
X	B-Operating_System
clients	O
do	O
n't	O
need	O
to	O
know	O
or	O
worry	O
about	O
the	O
specifics	O
of	O
the	O
underlying	O
hardware	O
.	O
</s>
<s>
Any	O
hardware	O
specific	O
code	O
lives	O
inside	O
the	O
Device	O
Dependent	O
X	B-Operating_System
,	O
the	O
part	O
of	O
the	O
X	B-Operating_System
Server	I-Operating_System
that	O
manages	O
each	O
type	O
of	O
video	B-Device
card	I-Device
or	O
graphics	B-Device
adapter	I-Device
and	O
which	O
is	O
also	O
often	O
called	O
the	O
video	O
or	O
graphics	O
driver	O
.	O
</s>
<s>
3D	O
graphics	O
applications	O
tend	O
to	O
produce	O
large	O
amounts	O
of	O
commands	O
and	O
data	O
,	O
all	O
of	O
which	O
must	O
be	O
dispatched	O
to	O
the	O
X	B-Operating_System
Server	I-Operating_System
for	O
rendering	O
.	O
</s>
<s>
As	O
the	O
amount	O
of	O
inter-process	B-Operating_System
communication	I-Operating_System
(	O
IPC	O
)	O
between	O
the	O
X	B-Operating_System
client	O
and	O
X	B-Operating_System
Server	I-Operating_System
increased	O
,	O
the	O
3D	O
rendering	O
performance	O
suffered	O
to	O
the	O
point	O
that	O
X	B-Operating_System
driver	O
developers	O
concluded	O
that	O
in	O
order	O
to	O
take	O
advantage	O
of	O
3D	O
hardware	O
capabilities	O
of	O
the	O
latest	O
graphics	B-Device
cards	I-Device
a	O
new	O
IPC-less	O
architecture	O
was	O
required	O
.	O
</s>
<s>
X	B-Operating_System
clients	O
should	O
have	O
direct	O
access	O
to	O
graphics	B-Device
hardware	I-Device
rather	O
than	O
relying	O
on	O
a	O
third	O
party	O
process	O
to	O
do	O
so	O
,	O
saving	O
all	O
the	O
IPC	O
overhead	O
.	O
</s>
<s>
This	O
approach	O
is	O
called	O
"	O
direct	O
rendering	O
"	O
as	O
opposed	O
to	O
the	O
"	O
indirect	O
rendering	O
"	O
provided	O
by	O
the	O
classical	O
X	B-Operating_System
architecture	O
.	O
</s>
<s>
The	O
Direct	B-Application
Rendering	I-Application
Infrastructure	I-Application
was	O
initially	O
developed	O
to	O
allow	O
any	O
X	B-Operating_System
client	O
to	O
perform	O
3D	O
rendering	O
using	O
this	O
"	O
direct	O
rendering	O
"	O
approach	O
.	O
</s>
<s>
Nothing	O
prevents	O
DRI	O
from	O
being	O
used	O
to	O
implement	O
accelerated	O
2D	O
direct	O
rendering	O
within	O
an	O
X	B-Operating_System
client	O
.	O
</s>
<s>
The	O
basic	O
architecture	O
of	O
the	O
Direct	B-Application
Rendering	I-Application
Infrastructure	I-Application
involves	O
three	O
main	O
components	O
:	O
</s>
<s>
the	B-Application
DRI	I-Application
client	O
an	O
X	B-Operating_System
client	O
performing	O
"	O
direct	O
rendering	O
"	O
needs	O
a	O
hardware	O
specific	O
"	O
driver	O
"	O
able	O
to	O
manage	O
the	O
current	O
video	B-Device
card	I-Device
or	O
graphics	B-Device
adapter	I-Device
in	O
order	O
to	O
render	O
on	O
it	O
.	O
</s>
<s>
These	O
DRI	O
drivers	O
are	O
typically	O
provided	O
as	O
shared	O
libraries	O
to	O
which	O
the	O
client	O
is	O
dynamically	B-Application
linked	I-Application
.	O
</s>
<s>
Since	O
DRI	O
was	O
conceived	O
to	O
take	O
advantage	O
of	O
3D	O
graphics	B-Device
hardware	I-Device
,	O
the	O
libraries	O
are	O
normally	O
presented	O
to	O
clients	O
as	O
hardware	B-General_Concept
accelerated	I-General_Concept
implementations	O
of	O
a	O
3D	O
API	B-Application
such	O
as	O
OpenGL	B-Application
,	O
provided	O
by	O
either	O
the	O
3D	O
hardware	O
vendor	O
itself	O
or	O
a	O
third	O
party	O
such	O
as	O
the	O
Mesa	B-Application
3D	I-Application
free	B-Application
software	I-Application
project	O
.	O
</s>
<s>
the	O
X	B-Operating_System
Server	I-Operating_System
provides	O
an	O
X11	B-Device
protocol	I-Device
extension	I-Device
the	B-Application
DRI	I-Application
extension	O
that	O
the	B-Application
DRI	I-Application
clients	O
use	O
to	O
coordinate	O
with	O
both	O
the	O
windowing	B-Application
system	I-Application
and	O
the	O
DDX	O
driver	O
.	O
</s>
<s>
As	O
part	O
of	O
the	O
DDX	O
driver	O
,	O
it	O
's	O
quite	O
common	O
that	O
the	O
X	B-Operating_System
Server	I-Operating_System
process	O
also	O
dynamically	O
links	O
to	O
the	O
same	O
DRI	O
driver	O
that	O
the	B-Application
DRI	I-Application
clients	O
,	O
but	O
to	O
provide	O
hardware	B-General_Concept
accelerated	I-General_Concept
3D	O
rendering	O
to	O
the	O
X	B-Operating_System
clients	O
using	O
the	O
GLX	B-Device
extension	I-Device
for	O
indirect	O
rendering	O
(	O
for	O
example	O
remote	O
X	B-Operating_System
clients	O
that	O
ca	O
n't	O
use	O
direct	O
rendering	O
)	O
.	O
</s>
<s>
For	O
2D	O
rendering	O
,	O
the	O
DDX	O
driver	O
must	O
also	O
take	O
into	O
account	O
the	B-Application
DRI	I-Application
clients	O
using	O
the	O
same	O
graphics	O
device	O
.	O
</s>
<s>
the	O
access	O
to	O
the	O
video	B-Device
card	I-Device
or	O
graphics	B-Device
adapter	I-Device
is	O
regulated	O
by	O
a	O
kernel	B-Operating_System
component	O
called	O
the	O
Direct	B-Application
Rendering	I-Application
Manager	I-Application
(	O
DRM	O
)	O
.	O
</s>
<s>
Both	O
the	O
X	B-Operating_System
Server	I-Operating_System
's	O
DDX	O
driver	O
and	O
each	O
X	B-Operating_System
client	O
's	O
DRI	O
driver	O
must	O
use	O
DRM	O
to	O
access	O
to	O
the	O
graphics	B-Device
hardware	I-Device
.	O
</s>
<s>
DRM	O
provides	O
synchronization	O
to	O
the	O
shared	O
resources	O
of	O
the	O
graphics	B-Device
hardware	I-Device
resources	O
such	O
as	O
the	O
command	O
queue	O
,	O
the	O
card	O
registers	O
,	O
the	O
video	O
memory	O
,	O
the	O
DMA	O
engines	O
,	O
...	O
ensuring	O
that	O
the	O
concurrent	O
access	O
of	O
all	O
those	O
multiple	O
competing	O
user	O
space	O
processes	O
do	O
n't	O
interfere	O
with	O
each	O
other	O
.	O
</s>
<s>
DRM	O
also	O
serves	O
as	O
a	O
basic	O
security	O
enforcer	O
that	O
does	O
n't	O
allow	O
any	O
X	B-Operating_System
client	O
to	O
access	O
the	O
hardware	O
beyond	O
what	O
it	O
needs	O
to	O
perform	O
the	O
3D	O
rendering	O
.	O
</s>
<s>
In	O
the	O
original	O
DRI	O
architecture	O
,	O
due	O
to	O
the	O
memory	O
size	O
of	O
video	B-Device
cards	I-Device
at	O
that	O
time	O
,	O
there	O
was	O
a	O
single	O
instance	O
of	O
the	O
screen	O
front	O
buffer	O
and	O
back	O
buffer	O
(	O
also	O
of	O
the	O
ancillary	O
depth	O
buffer	O
and	O
stencil	O
buffer	O
)	O
,	O
shared	O
by	O
all	O
the	B-Application
DRI	I-Application
clients	O
and	O
the	O
X	B-Operating_System
Server	I-Operating_System
.	O
</s>
<s>
In	O
order	O
to	O
render	O
to	O
the	O
back	O
buffer	O
,	O
a	O
DRI	O
process	O
should	O
ensure	O
that	O
the	O
rendering	O
was	O
clipped	B-Algorithm
to	O
the	O
area	O
reserved	O
for	O
its	O
window	O
.	O
</s>
<s>
The	O
synchronization	O
with	O
the	O
X	B-Operating_System
Server	I-Operating_System
was	O
done	O
through	O
signals	B-General_Concept
and	O
a	O
shared	B-Operating_System
memory	I-Operating_System
buffer	O
called	O
the	O
SAREA	O
.	O
</s>
<s>
The	O
access	O
to	O
the	O
DRM	O
device	O
was	O
exclusive	O
,	O
so	O
any	O
DRI	O
client	O
had	O
to	O
lock	B-Operating_System
it	O
at	O
the	O
beginning	O
of	O
a	O
rendering	O
operation	O
.	O
</s>
<s>
Other	O
users	O
of	O
the	O
device	O
including	O
the	O
X	B-Operating_System
Server	I-Operating_System
were	O
blocked	O
in	O
the	O
meantime	O
,	O
and	O
they	O
had	O
to	O
wait	O
until	O
the	O
lock	B-Operating_System
was	O
released	O
at	O
the	O
end	O
of	O
the	O
current	O
rendering	O
operation	O
,	O
even	O
if	O
it	O
would	O
n't	O
be	O
any	O
conflict	O
between	O
both	O
operations	O
.	O
</s>
<s>
Another	O
drawback	O
was	O
that	O
operations	O
did	O
n't	O
retain	O
memory	B-General_Concept
allocations	I-General_Concept
after	O
the	O
current	O
DRI	O
process	O
released	O
its	O
lock	B-Operating_System
on	O
the	O
device	O
,	O
so	O
any	O
data	O
uploaded	O
to	O
the	O
graphics	O
memory	O
such	O
as	O
textures	O
were	O
lost	O
for	O
upcoming	O
operations	O
,	O
causing	O
a	O
significant	O
impact	O
on	O
graphics	O
performance	O
.	O
</s>
<s>
Due	O
to	O
the	O
increasing	O
popularity	O
of	O
compositing	B-Operating_System
window	I-Operating_System
managers	I-Operating_System
like	O
Compiz	B-Language
,	O
the	O
Direct	B-Application
Rendering	I-Application
Infrastructure	I-Application
had	O
to	O
be	O
redesigned	O
so	O
that	O
X	B-Operating_System
clients	O
could	O
also	O
support	O
redirection	O
to	O
"	O
offscreen	O
pixmaps	O
"	O
while	O
doing	O
direct	O
rendering	O
.	O
</s>
<s>
Regular	O
X	B-Operating_System
clients	O
already	O
respected	O
the	O
redirection	O
to	O
a	O
separate	O
pixmap	O
provided	O
by	O
the	O
X	B-Operating_System
Server	I-Operating_System
as	O
a	O
render	O
target	O
the	O
so-called	O
offscreen	O
pixmap	O
,	O
but	O
DRI	O
clients	O
continued	O
to	O
do	O
the	O
rendering	O
directly	O
into	O
the	O
shared	O
backbuffer	O
,	O
effectively	O
bypassing	O
the	O
compositing	B-Operating_System
window	I-Operating_System
manager	I-Operating_System
.	O
</s>
<s>
The	O
ultimate	O
solution	O
was	O
to	O
change	O
the	O
way	O
DRI	O
handled	O
the	O
render	O
buffers	O
,	O
which	O
led	O
to	O
a	O
completely	O
different	O
DRI	O
extension	O
with	O
a	O
new	O
set	O
of	O
operations	O
,	O
and	O
also	O
major	O
changes	O
in	O
the	O
Direct	B-Application
Rendering	I-Application
Manager	I-Application
.	O
</s>
<s>
The	O
new	O
extension	O
was	O
named	O
"	O
DRI2	B-Application
"	O
,	O
although	O
it	O
's	O
not	O
a	O
later	O
version	O
but	O
a	O
different	O
extension	O
not	O
even	O
compatible	O
with	O
the	O
original	O
DRI	O
in	O
fact	O
both	O
have	O
coexisted	O
within	O
the	O
X	B-Operating_System
Server	I-Operating_System
for	O
a	O
long	O
time	O
.	O
</s>
<s>
In	O
DRI2	B-Application
,	O
instead	O
of	O
a	O
single	O
shared	O
(	O
back	O
)	O
buffer	O
,	O
every	O
DRI	O
client	O
gets	O
its	O
own	O
private	O
back	O
buffer	O
along	O
with	O
their	O
associated	O
depth	O
and	O
stencil	O
buffers	O
to	O
render	O
its	O
window	O
content	O
using	O
the	O
hardware	B-General_Concept
acceleration	I-General_Concept
.	O
</s>
<s>
The	B-Application
DRI	I-Application
client	O
then	O
swaps	O
it	O
with	O
a	O
false	O
"	O
front	O
buffer	O
"	O
,	O
which	O
is	O
used	O
by	O
the	O
compositing	B-Operating_System
window	I-Operating_System
manager	I-Operating_System
as	O
one	O
of	O
the	O
sources	O
to	O
compose	O
(	O
build	O
)	O
the	O
final	O
screen	O
back	O
buffer	O
to	O
be	O
swapped	O
at	O
the	O
VBLANK	O
interval	O
with	O
the	O
real	O
front	O
buffer	O
.	O
</s>
<s>
To	O
handle	O
all	O
these	O
new	O
buffers	O
,	O
the	O
Direct	B-Application
Rendering	I-Application
Manager	I-Application
had	O
to	O
incorporate	O
new	O
functionality	O
,	O
specifically	O
a	O
graphics	O
memory	B-General_Concept
manager	I-General_Concept
.	O
</s>
<s>
DRI2	B-Application
was	O
initially	O
developed	O
using	O
the	O
experimental	O
TTM	O
memory	B-General_Concept
manager	I-General_Concept
,	O
but	O
it	O
was	O
later	O
rewritten	O
to	O
use	O
GEM	O
after	O
it	O
was	O
chosen	O
as	O
the	O
definitive	O
DRM	O
memory	B-General_Concept
manager	I-General_Concept
.	O
</s>
<s>
The	O
new	O
DRI2	B-Application
internal	O
buffer	O
management	O
model	O
also	O
solved	O
two	O
major	O
performance	O
bottlenecks	O
present	O
in	O
the	O
original	O
DRI	O
implementation	O
:	O
</s>
<s>
DRI2	B-Application
clients	O
no	O
longer	O
lock	B-Operating_System
the	O
entire	O
DRM	O
device	O
while	O
using	O
it	O
for	O
rendering	O
,	O
since	O
now	O
each	O
client	O
gets	O
a	O
separate	O
render	O
buffer	O
independent	O
from	O
the	O
other	O
processes	O
.	O
</s>
<s>
DRI2	B-Application
clients	O
can	O
allocate	O
their	O
own	O
buffers	O
(	O
with	O
textures	O
,	O
vertex	O
lists	O
,	O
...	O
)	O
in	O
the	O
video	O
memory	O
and	O
keep	O
them	O
as	O
long	O
as	O
they	O
want	O
,	O
which	O
significantly	O
reduces	O
video	O
memory	B-General_Concept
bandwidth	I-General_Concept
consumption	O
.	O
</s>
<s>
In	O
DRI2	B-Application
,	O
the	O
allocation	O
of	O
the	O
private	O
offscreen	O
buffers	O
(	O
back	O
buffer	O
,	O
fake	O
front	O
buffer	O
,	O
depth	O
buffer	O
,	O
stencil	O
buffer	O
,	O
...	O
)	O
for	O
a	O
window	O
is	O
done	O
by	O
the	O
X	B-Operating_System
Server	I-Operating_System
itself	O
.	O
</s>
<s>
DRI	O
clients	O
retrieve	O
those	O
buffers	O
to	O
do	O
the	O
rendering	O
into	O
the	O
window	O
by	O
calling	O
operations	O
such	O
as	O
and	O
available	O
in	O
the	O
DRI2	B-Application
extension	O
.	O
</s>
<s>
Internally	O
,	O
DRI2	B-Application
uses	O
GEM	O
names	O
a	O
type	O
of	O
global	O
handle	O
provided	O
by	O
the	O
GEM	O
API	B-Application
that	O
allows	O
two	O
processes	O
accessing	O
a	O
DRM	O
device	O
to	O
refer	O
to	O
the	O
same	O
buffer	O
for	O
passing	O
around	O
"	O
references	O
"	O
to	O
those	O
buffers	O
through	O
the	O
X11	B-Device
protocol	I-Device
.	O
</s>
<s>
The	O
reason	O
why	O
the	O
X	B-Operating_System
Server	I-Operating_System
is	O
in	O
charge	O
of	O
the	O
buffer	O
allocation	O
of	O
the	O
render	O
buffers	O
of	O
a	O
window	O
is	O
that	O
the	O
GLX	B-Device
extension	I-Device
allows	O
for	O
multiple	O
X	B-Operating_System
clients	O
to	O
do	O
OpenGL	B-Application
rendering	O
cooperatively	O
in	O
the	O
same	O
window	O
.	O
</s>
<s>
This	O
way	O
,	O
the	O
X	B-Operating_System
Server	I-Operating_System
manages	O
the	O
whole	O
lifecycle	O
of	O
the	O
render	O
buffers	O
along	O
the	O
entire	O
rendering	O
process	O
and	O
knows	O
when	O
it	O
can	O
safely	O
recycle	O
or	O
discard	O
them	O
.	O
</s>
<s>
When	O
a	O
window	O
resize	O
is	O
performed	O
,	O
the	O
X	B-Operating_System
Server	I-Operating_System
is	O
also	O
responsible	O
for	O
allocating	O
new	O
render	O
buffers	O
matching	O
the	O
new	O
window	O
size	O
,	O
and	O
notifying	O
the	O
change	O
to	O
the	B-Application
DRI	I-Application
client(s )	O
rendering	O
into	O
the	O
window	O
using	O
an	O
InvalidateBuffers	O
event	O
,	O
so	O
they	O
would	O
retrieve	O
the	O
GEM	O
names	O
of	O
the	O
new	O
buffers	O
.	O
</s>
<s>
The	O
DRI2	B-Application
extension	O
provides	O
other	O
core	O
operations	O
for	O
the	B-Application
DRI	I-Application
clients	O
,	O
such	O
as	O
finding	O
out	O
which	O
DRM	O
device	O
and	O
driver	O
should	O
they	O
use	O
(	O
)	O
or	O
getting	O
authenticated	O
by	O
the	O
X	B-Operating_System
Server	I-Operating_System
in	O
order	O
to	O
be	O
able	O
to	O
use	O
the	O
rendering	O
and	O
buffer	O
facilities	O
of	O
the	O
DRM	O
device	O
(	O
)	O
.	O
</s>
<s>
,	O
on	O
the	O
other	O
hand	O
,	O
performs	O
a	O
VBLANK-synchronized	O
swap	O
between	O
back	O
and	O
front	O
buffer	O
,	O
if	O
it	O
's	O
supported	O
and	O
both	O
buffers	O
have	O
the	O
same	O
size	O
,	O
or	O
a	O
copy	O
(	O
blit	B-Algorithm
)	O
otherwise	O
.	O
</s>
<s>
Although	O
DRI2	B-Application
was	O
a	O
significant	O
improvement	O
over	O
the	O
original	O
DRI	O
,	O
the	O
new	O
extension	O
also	O
introduced	O
some	O
new	O
issues	O
.	O
</s>
<s>
In	O
2013	O
,	O
a	O
third	O
iteration	O
of	O
the	O
Direct	B-Application
Rendering	I-Application
Infrastructure	I-Application
known	O
as	O
DRI3	O
was	O
developed	O
in	O
order	O
to	O
fix	O
those	O
issues	O
.	O
</s>
<s>
The	O
main	O
differences	O
of	O
DRI3	O
compared	O
to	O
DRI2	B-Application
are	O
:	O
</s>
<s>
DRI3	O
clients	O
allocate	O
themselves	O
their	O
render	O
buffers	O
instead	O
of	O
relying	O
on	O
the	O
X	B-Operating_System
Server	I-Operating_System
for	O
doing	O
the	O
allocation	O
that	O
was	O
the	O
method	O
supported	O
by	O
DRI2	B-Application
.	O
</s>
<s>
DRI3	O
gets	O
rid	O
of	O
the	O
old	O
insecure	O
GEM	O
buffer	O
sharing	O
mechanism	O
based	O
on	O
GEM	O
names	O
(	O
global	O
GEM	O
handles	O
)	O
for	O
passing	O
buffer	O
objects	O
between	O
a	O
DRI	O
client	O
and	O
the	O
X	B-Operating_System
Server	I-Operating_System
in	O
favor	O
of	O
the	O
one	O
more	O
secure	O
and	O
versatile	O
based	O
on	O
PRIME	O
DMA-BUFs	O
,	O
which	O
uses	O
file	B-Application
descriptors	I-Application
instead	O
.	O
</s>
<s>
Buffer	O
allocation	O
on	O
the	O
client	O
side	O
breaks	O
GLX	B-Device
assumptions	O
in	O
the	O
sense	O
that	O
it	O
's	O
no	O
longer	O
possible	O
for	O
multiple	O
GLX	B-Device
applications	O
to	O
render	O
cooperatively	O
in	O
the	O
same	O
window	O
.	O
</s>
<s>
On	O
the	O
plus	O
side	O
,	O
the	O
fact	O
that	O
the	B-Application
DRI	I-Application
client	O
is	O
in	O
charge	O
of	O
its	O
own	O
buffers	O
throughout	O
their	O
lifetime	O
brings	O
many	O
advantages	O
.	O
</s>
<s>
For	O
example	O
,	O
it	O
is	O
easy	O
for	O
the	O
DRI3	O
client	O
to	O
ensure	O
that	O
the	O
size	O
of	O
the	O
render	O
buffers	O
always	O
match	O
the	O
current	O
size	O
of	O
the	O
window	O
,	O
and	O
thereby	O
eliminate	O
the	O
artifacts	O
due	O
to	O
the	O
lack	O
of	O
synchronization	O
of	O
buffer	O
sizes	O
between	O
client	O
and	O
server	O
that	O
plagued	O
window	O
resizing	O
in	O
DRI2	B-Application
.	O
</s>
<s>
A	O
better	O
performance	O
is	O
also	O
achieved	O
because	O
now	O
DRI3	O
clients	O
save	O
the	O
extra	O
round	O
trip	O
waiting	O
for	O
the	O
X	B-Operating_System
Server	I-Operating_System
to	O
send	O
the	O
render	O
buffers	O
.	O
</s>
<s>
The	O
DRI3	O
extension	O
no	O
longer	O
needs	O
to	O
be	O
modified	O
to	O
support	O
new	O
particular	O
buffer	O
formats	O
,	O
since	O
they	O
are	O
now	O
handled	O
directly	O
between	O
the	B-Application
DRI	I-Application
client	O
driver	O
and	O
the	O
DRM	O
kernel	B-Operating_System
driver	O
.	O
</s>
<s>
The	O
use	O
of	O
file	B-Application
descriptors	I-Application
,	O
on	O
the	O
other	O
hand	O
,	O
allows	O
the	O
kernel	B-Operating_System
to	O
perform	O
a	O
safe	O
cleanup	O
of	O
any	O
unused	O
GEM	O
buffer	O
object	O
one	O
with	O
no	O
reference	O
to	O
it	O
.	O
</s>
<s>
The	O
main	O
purpose	O
of	O
the	O
DRI3	O
extension	O
is	O
to	O
implement	O
the	O
mechanism	O
to	O
share	O
direct	O
rendered	O
buffers	O
between	O
DRI	O
clients	O
and	O
the	O
X	B-Operating_System
Server	I-Operating_System
.	O
</s>
<s>
DRI	O
clients	O
allocate	O
and	O
use	O
GEM	O
buffers	O
objects	O
as	O
rendering	O
targets	O
,	O
while	O
the	O
X	B-Operating_System
Server	I-Operating_System
represents	O
these	O
render	O
buffers	O
using	O
a	O
type	O
of	O
X11	B-Operating_System
object	O
called	O
"	O
pixmap	O
"	O
.	O
</s>
<s>
DRI3	O
provides	O
two	O
operations	O
,	O
and	O
,	O
one	O
to	O
create	O
a	O
pixmap	O
(	O
in	O
"	O
X	B-Operating_System
Server	I-Operating_System
space	O
"	O
)	O
from	O
a	O
GEM	O
buffer	O
object	O
(	O
in	O
"	O
DRI	O
client	O
space	O
"	O
)	O
,	O
and	O
the	O
other	O
to	O
do	O
the	O
reverse	O
and	O
get	O
a	O
GEM	O
buffer	O
object	O
from	O
an	O
X	B-Operating_System
pixmap	O
.	O
</s>
<s>
In	O
these	O
DRI3	O
operations	O
GEM	O
buffer	O
objects	O
are	O
passed	O
as	O
DMA-BUF	O
file	B-Application
descriptors	I-Application
instead	O
of	O
GEM	O
names	O
.	O
</s>
<s>
DRI3	O
also	O
provides	O
a	O
way	O
to	O
share	O
synchronization	O
objects	O
between	O
the	B-Application
DRI	I-Application
client	O
and	O
the	O
X	B-Operating_System
Server	I-Operating_System
,	O
allowing	O
both	O
a	O
serialized	O
access	O
to	O
the	O
shared	O
buffer	O
.	O
</s>
<s>
Unlike	O
DRI2	B-Application
,	O
the	O
initial	O
operation	O
the	O
first	O
every	O
DRI	O
client	O
must	O
request	O
to	O
know	O
which	O
DRM	O
device	O
to	O
use	O
returns	O
an	O
already	O
open	O
file	B-Application
descriptor	I-Application
to	O
the	O
device	O
node	O
instead	O
of	O
the	O
device	O
node	O
filename	O
,	O
with	O
any	O
required	O
authentication	O
procedure	O
already	O
performed	O
in	O
advance	O
by	O
the	O
X	B-Operating_System
Server	I-Operating_System
.	O
</s>
<s>
Present	O
is	O
so	O
named	O
because	O
its	O
main	O
task	O
is	O
to	O
"	O
present	O
"	O
buffers	O
on	O
the	O
screen	O
,	O
meaning	O
that	O
it	O
handles	O
the	O
update	O
of	O
the	O
framebuffer	B-Algorithm
using	O
the	O
contents	O
of	O
the	O
rendered	O
buffers	O
delivered	O
by	O
client	O
applications	O
.	O
</s>
<s>
It	O
also	O
keeps	O
the	O
X	B-Operating_System
client	O
informed	O
about	O
the	O
instant	O
each	O
buffer	O
is	O
really	O
shown	O
on	O
the	O
screen	O
using	O
events	O
,	O
so	O
the	O
client	O
can	O
synchronize	O
its	O
rendering	O
process	O
with	O
the	O
current	O
screen	O
refresh	O
rate	O
.	O
</s>
<s>
Present	O
accepts	O
any	O
X	B-Operating_System
pixmap	O
as	O
the	O
source	O
for	O
a	O
screen	O
update	O
.	O
</s>
<s>
Since	O
pixmaps	O
are	O
standard	O
X	B-Operating_System
objects	O
,	O
Present	O
can	O
be	O
used	O
not	O
only	O
by	O
DRI3	O
clients	O
performing	O
direct	O
rendering	O
,	O
but	O
also	O
by	O
any	O
X	B-Operating_System
client	O
rendering	O
on	O
a	O
pixmap	O
by	O
any	O
means	O
.	O
</s>
<s>
For	O
example	O
,	O
most	O
existing	O
non-GL	O
based	O
GTK+	B-Application
and	O
Qt	B-Language
applications	O
used	O
to	O
do	O
double	O
buffered	O
pixmap	O
rendering	O
using	O
XRender	B-Device
.	O
</s>
<s>
Apart	O
from	O
allowing	O
non-GL	O
X	B-Operating_System
clients	O
to	O
synchronize	O
with	O
VBLANK	O
,	O
Present	O
brings	O
other	O
advantages	O
.	O
</s>
<s>
DRI3	O
graphics	O
performance	O
is	O
better	O
because	O
Present	O
is	O
more	O
efficient	O
than	O
DRI2	B-Application
in	O
swapping	O
buffers	O
.	O
</s>
<s>
A	O
number	O
of	O
OpenGL	B-Application
extensions	O
that	O
were	O
n't	O
available	O
with	O
DRI2	B-Application
are	O
now	O
supported	O
based	O
on	O
new	O
features	O
provided	O
by	O
Present	O
.	O
</s>
<s>
Present	O
provides	O
two	O
main	O
operations	O
to	O
X	B-Operating_System
clients	O
:	O
update	O
a	O
region	O
of	O
a	O
window	O
using	O
part	O
of	O
or	O
all	O
the	O
contents	O
of	O
a	O
pixmap	O
(	O
)	O
and	O
set	O
the	O
type	O
of	O
presentation	O
events	O
related	O
to	O
a	O
certain	O
window	O
that	O
the	O
client	O
wants	O
to	O
be	O
notified	O
about	O
(	O
)	O
.	O
</s>
<s>
There	O
are	O
three	O
presentation	O
events	O
about	O
which	O
a	O
window	O
can	O
notify	O
an	O
X	B-Operating_System
client	O
:	O
when	O
an	O
ongoing	O
presentation	O
operation	O
normally	O
from	O
a	O
call	O
to	O
has	O
been	O
completed	O
(	O
)	O
,	O
when	O
a	O
pixmap	O
used	O
by	O
a	O
operation	O
is	O
ready	O
to	O
be	O
reused	O
(	O
)	O
and	O
when	O
the	O
window	O
configuration	O
mostly	O
window	O
size	O
changes	O
(	O
)	O
.	O
</s>
<s>
Whether	O
a	O
operation	O
performs	O
a	O
direct	O
copy	O
(	O
blit	B-Algorithm
)	O
onto	O
the	O
front	O
buffer	O
or	O
a	O
swap	O
of	O
the	O
entire	O
back	O
buffer	O
with	O
the	O
front	O
buffer	O
is	O
an	O
internal	O
detail	O
of	O
the	O
Present	O
extension	O
implementation	O
,	O
instead	O
of	O
an	O
explicit	O
choice	O
of	O
the	O
X	B-Operating_System
client	O
as	O
it	O
was	O
in	O
DRI2	B-Application
.	O
</s>
<s>
Several	O
open	O
source	O
DRI	O
drivers	O
have	O
been	O
written	O
,	O
including	O
ones	O
for	O
ATI	O
Mach64	O
,	O
ATI	O
Rage128	O
,	O
ATI	O
Radeon	O
,	O
3dfx	O
Voodoo3	O
through	O
Voodoo5	O
,	O
Matrox	B-Application
G200	O
through	O
G400	O
,	O
SiS	O
300-series	O
,	O
Intel	O
i810	O
through	O
i965	O
,	O
S3	O
Savage	O
,	O
VIA	O
UniChrome	O
graphics	O
chipsets	O
,	O
and	O
nouveau	B-Application
for	O
Nvidia	O
.	O
</s>
<s>
Some	O
graphics	O
vendors	O
have	O
written	O
closed-source	O
DRI	O
drivers	O
,	O
including	O
ATI	O
and	O
PowerVR	B-Device
Kyro	O
.	O
</s>
<s>
The	O
various	O
versions	O
of	O
DRI	O
have	O
been	O
implemented	O
by	O
various	O
operating	O
systems	O
,	O
amongst	O
others	O
by	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
,	O
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
,	O
OpenBSD	B-Operating_System
,	O
and	O
OpenSolaris	B-Operating_System
.	O
</s>
<s>
It	O
was	O
first	O
made	O
widely	O
available	O
as	O
part	O
of	O
XFree86	B-Device
4.0	O
and	O
is	O
now	O
part	O
of	O
the	O
X.Org	B-Operating_System
Server	I-Operating_System
.	O
</s>
<s>
It	O
is	O
currently	O
maintained	O
by	O
the	O
free	B-Application
software	I-Application
community	O
.	O
</s>
<s>
Work	O
on	O
DRI2	B-Application
started	O
at	O
the	O
2007	O
X	B-Operating_System
Developers	O
 '	O
Summit	O
from	O
a	O
Kristian	O
Høgsberg	O
's	O
proposal	O
.	O
</s>
<s>
Høgsberg	O
himself	O
wrote	O
the	O
new	O
DRI2	B-Application
extension	O
and	O
the	O
modifications	O
to	O
Mesa	B-Application
and	O
GLX	B-Device
.	O
</s>
<s>
In	O
March	O
2008	O
DRI2	B-Application
was	O
mostly	O
done	O
,	O
but	O
it	O
could	O
n't	O
make	O
into	O
X.Org	B-Operating_System
Server	I-Operating_System
version	O
1.5	O
and	O
had	O
to	O
wait	O
until	O
version	O
1.6	O
from	O
February	O
2009	O
.	O
</s>
<s>
The	O
DRI2	B-Application
extension	O
was	O
officially	O
included	O
in	O
the	O
X11R7.5	O
release	O
of	O
October	O
2009	O
.	O
</s>
<s>
The	O
first	O
public	O
version	O
of	O
the	O
DRI2	B-Application
protocol	O
(	O
2.0	O
)	O
was	O
announced	O
in	O
April	O
2009	O
.	O
</s>
<s>
Due	O
to	O
several	O
limitations	O
of	O
DRI2	B-Application
,	O
a	O
new	O
extension	O
called	O
DRI-Next	O
was	O
proposed	O
by	O
Keith	O
Packard	O
and	O
Emma	O
Anholt	O
at	O
the	O
X.Org	O
Developer	O
's	O
Conference	O
2012	O
.	O
</s>
<s>
The	O
extension	O
was	O
proposed	O
again	O
as	O
DRI3000	B-Application
at	O
Linux.conf.au	O
2013	O
.	O
</s>
<s>
DRI3	O
and	O
Present	O
extensions	O
were	O
developed	O
during	O
2013	O
and	O
merged	O
into	O
the	O
X.Org	B-Operating_System
Server	I-Operating_System
1.15	O
release	O
from	O
December	O
2013	O
.	O
</s>
