<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/gpu/drm/drm_fops.c, branch v2.6.31</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>drm: Remove memory debugging infrastructure.</title>
<updated>2009-06-18T20:00:33+00:00</updated>
<author>
<name>Eric Anholt</name>
<email>eric@anholt.net</email>
</author>
<published>2009-03-24T19:23:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9a298b2acd771d8a5c0004d8f8e4156c65b11f6b'/>
<id>9a298b2acd771d8a5c0004d8f8e4156c65b11f6b</id>
<content type='text'>
It hasn't been used in ages, and having the user tell your how much
memory is being freed at free time is a recipe for disaster even if it
was ever used.

Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It hasn't been used in ages, and having the user tell your how much
memory is being freed at free time is a recipe for disaster even if it
was ever used.

Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: drm_fops.c unlock missing on error path</title>
<updated>2009-03-29T08:31:47+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2009-03-27T10:34:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=dba5ed0cd12d8db5c0d2e1c869c2a50c5bcf6743'/>
<id>dba5ed0cd12d8db5c0d2e1c869c2a50c5bcf6743</id>
<content type='text'>
drm_open_helper() from drm_fops.c had a missing mutex_unlock in a error
path.

This was caught by smatch (http://repo.or.cz/w/smatch.git/).  Compile
tested.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
drm_open_helper() from drm_fops.c had a missing mutex_unlock in a error
path.

This was caught by smatch (http://repo.or.cz/w/smatch.git/).  Compile
tested.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Rationalize fasync return values</title>
<updated>2009-03-16T14:34:35+00:00</updated>
<author>
<name>Jonathan Corbet</name>
<email>corbet@lwn.net</email>
</author>
<published>2009-02-01T21:52:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=60aa49243d09afc873f082567d2e3c16634ced84'/>
<id>60aa49243d09afc873f082567d2e3c16634ced84</id>
<content type='text'>
Most fasync implementations do something like:

     return fasync_helper(...);

But fasync_helper() will return a positive value at times - a feature used
in at least one place.  Thus, a number of other drivers do:

     err = fasync_helper(...);
     if (err &lt; 0)
             return err;
     return 0;

In the interests of consistency and more concise code, it makes sense to
map positive return values onto zero where -&gt;fasync() is called.

Cc: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most fasync implementations do something like:

     return fasync_helper(...);

But fasync_helper() will return a positive value at times - a feature used
in at least one place.  Thus, a number of other drivers do:

     err = fasync_helper(...);
     if (err &lt; 0)
             return err;
     return 0;

In the interests of consistency and more concise code, it makes sense to
map positive return values onto zero where -&gt;fasync() is called.

Cc: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Avoid client deadlocks when the master disappears.</title>
<updated>2009-03-02T23:50:20+00:00</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thellstrom@vmware.com</email>
</author>
<published>2009-03-02T10:10:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fda714c29cdf360464059044b221450decb4b913'/>
<id>fda714c29cdf360464059044b221450decb4b913</id>
<content type='text'>
This is done by
1) Wake up lock waiters when we close the master file descriptor.
   Not when the master structure is removed, since the latter
   requires the waiters themselves to release the refcount on the
   master structure -&gt; Deadlock.
2) Send a SIGTERM to all clients waiting for the lock.
   Normally these clients will get a SIGPIPE when the X server dies,
   but clients may also spin trying to grab the DRM lock, without
   getting any sort of notification.

Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is done by
1) Wake up lock waiters when we close the master file descriptor.
   Not when the master structure is removed, since the latter
   requires the waiters themselves to release the refcount on the
   master structure -&gt; Deadlock.
2) Send a SIGTERM to all clients waiting for the lock.
   Normally these clients will get a SIGPIPE when the X server dies,
   but clients may also spin trying to grab the DRM lock, without
   getting any sort of notification.

Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Release user fbs in drm_release</title>
<updated>2009-02-20T02:21:11+00:00</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@redhat.com</email>
</author>
<published>2009-02-12T19:37:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ea39f835168f60b01e59d0f348da25d297e7cf94'/>
<id>ea39f835168f60b01e59d0f348da25d297e7cf94</id>
<content type='text'>
Avoids leaking fbs and associated buffers on release.

Signed-off-by: Kristian Høgsberg &lt;krh@redhat.com&gt;
Tested-by: Tested-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoids leaking fbs and associated buffers on release.

Signed-off-by: Kristian Høgsberg &lt;krh@redhat.com&gt;
Tested-by: Tested-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Check fops_get() return value</title>
<updated>2009-01-06T23:59:11+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart@skynet.be</email>
</author>
<published>2009-01-06T22:40:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f41ced8f108cc80f16509b907cd7ac93944459bc'/>
<id>f41ced8f108cc80f16509b907cd7ac93944459bc</id>
<content type='text'>
Several subsystem open handlers dereference the fops_get() return value
without checking it for nullness.  This opens a race condition between the
open handler and module unloading.

A module can be marked as being unloaded (MODULE_STATE_GOING) before its
exit function is called and gets the chance to unregister the driver.
During that window open handlers can still be called, and fops_get() will
fail in try_module_get() and return a NULL pointer.

This change checks the fops_get() return value and returns -ENODEV if NULL.

Reported-by: Alan Jenkins &lt;alan-jenkins@tuffmail.co.uk&gt;
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@skynet.be&gt;
Acked-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Dave Airlie &lt;airlied@linux.ie&gt;
Acked-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Several subsystem open handlers dereference the fops_get() return value
without checking it for nullness.  This opens a race condition between the
open handler and module unloading.

A module can be marked as being unloaded (MODULE_STATE_GOING) before its
exit function is called and gets the chance to unregister the driver.
During that window open handlers can still be called, and fops_get() will
fail in try_module_get() and return a NULL pointer.

This change checks the fops_get() return value and returns -ENODEV if NULL.

Reported-by: Alan Jenkins &lt;alan-jenkins@tuffmail.co.uk&gt;
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@skynet.be&gt;
Acked-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Dave Airlie &lt;airlied@linux.ie&gt;
Acked-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>DRM: add mode setting support</title>
<updated>2008-12-29T07:47:23+00:00</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2008-11-07T22:05:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f453ba0460742ad027ae0c4c7d61e62817b3e7ef'/>
<id>f453ba0460742ad027ae0c4c7d61e62817b3e7ef</id>
<content type='text'>
Add mode setting support to the DRM layer.

This is a fairly big chunk of work that allows DRM drivers to provide
full output control and configuration capabilities to userspace.  It was
motivated by several factors:
  - the fb layer's APIs aren't suited for anything but simple
    configurations
  - coordination between the fb layer, DRM layer, and various userspace
    drivers is poor to non-existent (radeonfb excepted)
  - user level mode setting drivers makes displaying panic &amp; oops
    messages more difficult
  - suspend/resume of graphics state is possible in many more
    configurations with kernel level support

This commit just adds the core DRM part of the mode setting APIs.
Driver specific commits using these new structure and APIs will follow.

Co-authors: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;, Jakob Bornecrantz &lt;jakob@tungstengraphics.com&gt;
Contributors: Alan Hourihane &lt;alanh@tungstengraphics.com&gt;, Maarten Maathuis &lt;madman2003@gmail.com&gt;

Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add mode setting support to the DRM layer.

This is a fairly big chunk of work that allows DRM drivers to provide
full output control and configuration capabilities to userspace.  It was
motivated by several factors:
  - the fb layer's APIs aren't suited for anything but simple
    configurations
  - coordination between the fb layer, DRM layer, and various userspace
    drivers is poor to non-existent (radeonfb excepted)
  - user level mode setting drivers makes displaying panic &amp; oops
    messages more difficult
  - suspend/resume of graphics state is possible in many more
    configurations with kernel level support

This commit just adds the core DRM part of the mode setting APIs.
Driver specific commits using these new structure and APIs will follow.

Co-authors: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;, Jakob Bornecrantz &lt;jakob@tungstengraphics.com&gt;
Contributors: Alan Hourihane &lt;alanh@tungstengraphics.com&gt;, Maarten Maathuis &lt;madman2003@gmail.com&gt;

Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: GEM mmap support</title>
<updated>2008-12-29T07:47:22+00:00</updated>
<author>
<name>Jesse Barnes</name>
<email>jbarnes@virtuousgeek.org</email>
</author>
<published>2008-11-05T18:31:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a2c0a97b784f837300f7b0869c82ab712c600952'/>
<id>a2c0a97b784f837300f7b0869c82ab712c600952</id>
<content type='text'>
Add core support for mapping of GEM objects.  Drivers should provide a
vm_operations_struct if they want to support page faulting of objects.
The code for handling GEM object offsets was taken from TTM, which was
written by Thomas Hellström.

Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add core support for mapping of GEM objects.  Drivers should provide a
vm_operations_struct if they want to support page faulting of objects.
The code for handling GEM object offsets was taken from TTM, which was
written by Thomas Hellström.

Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: move to kref per-master structures.</title>
<updated>2008-12-29T07:47:22+00:00</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2008-11-28T04:22:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7c1c2871a6a3a114853ec6836e9035ac1c0c7f7a'/>
<id>7c1c2871a6a3a114853ec6836e9035ac1c0c7f7a</id>
<content type='text'>
This is step one towards having multiple masters sharing a drm
device in order to get fast-user-switching to work.

It splits out the information associated with the drm master
into a separate kref counted structure, and allocates this when
a master opens the device node. It also allows the current master
to abdicate (say while VT switched), and a new master to take over
the hardware.

It moves the Intel and radeon drivers to using the sarea from
within the new master structures.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is step one towards having multiple masters sharing a drm
device in order to get fast-user-switching to work.

It splits out the information associated with the drm master
into a separate kref counted structure, and allocates this when
a master opens the device node. It also allows the current master
to abdicate (say while VT switched), and a new master to take over
the hardware.

It moves the Intel and radeon drivers to using the sarea from
within the new master structures.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>saner FASYNC handling on file close</title>
<updated>2008-11-01T16:49:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2008-10-31T23:28:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=233e70f4228e78eb2f80dc6650f65d3ae3dbf17c'/>
<id>233e70f4228e78eb2f80dc6650f65d3ae3dbf17c</id>
<content type='text'>
As it is, all instances of -&gt;release() for files that have -&gt;fasync()
need to remember to evict file from fasync lists; forgetting that
creates a hole and we actually have a bunch that *does* forget.

So let's keep our lives simple - let __fput() check FASYNC in
file-&gt;f_flags and call -&gt;fasync() there if it's been set.  And lose that
crap in -&gt;release() instances - leaving it there is still valid, but we
don't have to bother anymore.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As it is, all instances of -&gt;release() for files that have -&gt;fasync()
need to remember to evict file from fasync lists; forgetting that
creates a hole and we actually have a bunch that *does* forget.

So let's keep our lives simple - let __fput() check FASYNC in
file-&gt;f_flags and call -&gt;fasync() there if it's been set.  And lose that
crap in -&gt;release() instances - leaving it there is still valid, but we
don't have to bother anymore.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
