<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/drm_fops.c, branch v3.0.5</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/gpu/drm/drm_fops.c?h=v3.0.5</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/gpu/drm/drm_fops.c?h=v3.0.5'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-01-05T03:45:30Z</updated>
<entry>
<title>drm/switcheroo: track state of switch in drivers.</title>
<updated>2011-01-05T03:45:30Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2010-12-06T23:20:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5bcf719b7db0f9366cedaf102b081f99b1c325ae'/>
<id>urn:sha1:5bcf719b7db0f9366cedaf102b081f99b1c325ae</id>
<content type='text'>
We need to track the state of the switch in drivers, so that after s/r
we don't resume the card we've explicitly switched off before. Also
don't allow a userspace open to occur if we've switched the gpu off.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>BKL: remove extraneous #include &lt;smp_lock.h&gt;</title>
<updated>2010-11-17T16:59:32Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-11-17T15:26:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=451a3c24b0135bce54542009b5fde43846c7cf67'/>
<id>urn:sha1:451a3c24b0135bce54542009b5fde43846c7cf67</id>
<content type='text'>
The big kernel lock has been removed from all these files at some point,
leaving only the #include.

Remove this too as a cleanup.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into drm-fixes</title>
<updated>2010-08-26T23:09:46Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2010-08-26T23:09:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5afda9e9a4625d771795a5f540fb202eec08a49c'/>
<id>urn:sha1:5afda9e9a4625d771795a5f540fb202eec08a49c</id>
<content type='text'>
* 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next:
  drm/nouveau: drop drm_global_mutex before sleeping in submission path
  drm: export drm_global_mutex for drivers to use
  drm/nv20: Don't use pushbuf calls on the original nv20.
  drm/nouveau: Fix TMDS on some DCB1.5 boards.
  drm/nouveau: Fix backlight control on PPC machines with an internal TMDS panel.
  drm/nv30: Apply modesetting to the correct slave encoder
  drm/nouveau: Use a helper function to match PCI device/subsystem IDs.
  drm/nv50: add dcb type 14 to enum to prevent compiler complaint
</content>
</entry>
<entry>
<title>drm: export drm_global_mutex for drivers to use</title>
<updated>2010-08-26T22:39:22Z</updated>
<author>
<name>Ben Skeggs</name>
<email>bskeggs@redhat.com</email>
</author>
<published>2010-08-26T04:58:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e3461a2bc0d67ce60a915e0f26e2a6eb4a4d4b99'/>
<id>urn:sha1:e3461a2bc0d67ce60a915e0f26e2a6eb4a4d4b99</id>
<content type='text'>
Nouveau needs to be able to drop the mutex before sleeping to prevent a
deadlock from occuring.

Signed-off-by: Ben Skeggs &lt;bskeggs@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm: Remove count_lock for calling lastclose() after 58474713 (v2)</title>
<updated>2010-08-11T23:22:19Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2010-08-11T13:41:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1a72d65d6291ec248cbc5f05df2487edd714aba6'/>
<id>urn:sha1:1a72d65d6291ec248cbc5f05df2487edd714aba6</id>
<content type='text'>
When removing of the BKL the locking around lastclose() was rearranged
and resulted in the holding of the open_count spinlock over the call
into drm_lastclose(). The drivers were not ready for this path to be
atomic - it may indeed involve long waits to release old objects and
cleanup the GPU - and so we ended up scheduling whilst atomic.

[   54.625598] BUG: scheduling while atomic: X/3546/0x00000002
[   54.625600] Modules linked in: sco bridge stp llc input_polldev rfcomm bnep l2cap crc16 sch_sfq ipv6 md_mod acpi_cpufreq mperf cryptd aes_x86_64 aes_generic xts gf128mul dm_crypt dm_mod btusb bluetooth usbhid hid zaurus cdc_ether usbnet mii cdc_wdm cdc_acm uvcvideo videodev v4l1_compat v4l2_compat_ioctl32 snd_hda_codec_conexant arc4 pcmcia ecb snd_hda_intel joydev sdhci_pci sdhci snd_hda_codec tpm_tis firewire_ohci mmc_core e1000e uhci_hcd thinkpad_acpi nvram yenta_socket pcmcia_rsrc pcmcia_core tpm wmi sr_mod firewire_core iwlagn ehci_hcd snd_hwdep snd_pcm usbcore tpm_bios thermal led_class snd_timer iwlcore snd soundcore ac snd_page_alloc pcspkr psmouse serio_raw battery sg mac80211 evdev cfg80211 i2c_i801 iTCO_wdt iTCO_vendor_support cdrom processor crc_itu_t rfkill xfs exportfs sd_mod crc_t10dif ahci libahci libata scsi_mod [last unloaded: scsi_wait_scan]
[   54.625663] Pid: 3546, comm: X Not tainted 2.6.35-04771-g1787985 #301
[   54.625665] Call Trace:
[   54.625671]  [&lt;ffffffff8102d599&gt;] __schedule_bug+0x57/0x5c
[   54.625675]  [&lt;ffffffff81384141&gt;] schedule+0xe5/0x832
[   54.625679]  [&lt;ffffffff81163e77&gt;] ? put_dec+0x20/0x3c
[   54.625682]  [&lt;ffffffff81384dd4&gt;] schedule_timeout+0x275/0x29f
[   54.625686]  [&lt;ffffffff810455e1&gt;] ? process_timeout+0x0/0xb
[   54.625688]  [&lt;ffffffff81384e17&gt;] schedule_timeout_uninterruptible+0x19/0x1b
[   54.625691]  [&lt;ffffffff81045893&gt;] msleep+0x16/0x1d
[   54.625695]  [&lt;ffffffff812a2e53&gt;] i9xx_crtc_dpms+0x273/0x2ae
[   54.625698]  [&lt;ffffffff812a18be&gt;] intel_crtc_dpms+0x28/0xe7
[   54.625702]  [&lt;ffffffff811ec0fa&gt;] drm_helper_disable_unused_functions+0xf0/0x118
[   54.625705]  [&lt;ffffffff811ecde3&gt;] drm_crtc_helper_set_config+0x644/0x7c8
[   54.625708]  [&lt;ffffffff811f12dd&gt;] ? drm_copy_field+0x40/0x50
[   54.625711]  [&lt;ffffffff811ebca2&gt;] drm_fb_helper_force_kernel_mode+0x3e/0x85
[   54.625713]  [&lt;ffffffff811ebcf2&gt;] drm_fb_helper_restore+0x9/0x24
[   54.625717]  [&lt;ffffffff81290a41&gt;] i915_driver_lastclose+0x2b/0x5c
[   54.625720]  [&lt;ffffffff811f14a7&gt;] drm_lastclose+0x44/0x2ad
[   54.625722]  [&lt;ffffffff811f1ed2&gt;] drm_release+0x5c6/0x609
[   54.625726]  [&lt;ffffffff810d1275&gt;] fput+0x109/0x1c7
[   54.625728]  [&lt;ffffffff810ce5e4&gt;] filp_close+0x61/0x6b
[   54.625731]  [&lt;ffffffff810ce680&gt;] sys_close+0x92/0xd4
[   54.625734]  [&lt;ffffffff81002a2b&gt;] system_call_fastpath+0x16/0x1b

v2: The spinlock is actually superfluous as access to open_count is
entirely serialised by drm_global_mutex and so can be dropped. The
count_lock spinlock instead appears to be used to protect access to
dev-&gt;buf_alloc and dev-&gt;buf_use.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm: kill BKL from common code</title>
<updated>2010-08-05T01:54:40Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-07-10T21:51:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=58374713c9dfb4d231f8c56cac089f6fbdedc2ec'/>
<id>urn:sha1:58374713c9dfb4d231f8c56cac089f6fbdedc2ec</id>
<content type='text'>
This restricts the use of the big kernel lock to the i830 and i810
device drivers. The three remaining users in common code (open, ioctl
and release) get converted to a new mutex, the drm_global_mutex,
making the locking stricter than the big kernel lock.

This may have a performance impact, but only in those cases that
currently don't use DRM_UNLOCKED flag in the ioctl list and would
benefit from that anyway.

The reason why i810 and i830 cannot use drm_global_mutex in their
mmap functions is a lock-order inversion problem between the current
use of the BKL and mmap_sem in these drivers. Since the BKL has
release-on-sleep semantics, it's harmless but it would cause trouble
if we replace the BKL with a mutex.

Instead, these drivers get their own ioctl wrappers that take the
BKL around every ioctl call and then set their own handlers as
DRM_UNLOCKED.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drivers/gpu/drm: Use kzalloc</title>
<updated>2010-05-18T05:57:05Z</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2010-05-13T19:58:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6ebc22e6d06760466859b79d7b3b3edad264a230'/>
<id>urn:sha1:6ebc22e6d06760466859b79d7b3b3edad264a230</id>
<content type='text'>
Use kzalloc rather than the combination of kmalloc and memset.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
 if (x == NULL) S
-memset(x, 0, size);
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Reviewed-by: Corbin Simpson &lt;MostAwesomeDude@gmail.com&gt;
Reviewed-by: Matt Turner &lt;mattst88@gmail.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'master' into export-slabh</title>
<updated>2010-04-05T02:37:28Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-04-05T02:37:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=336f5899d287f06d8329e208fc14ce50f7ec9698'/>
<id>urn:sha1:336f5899d287f06d8329e208fc14ce50f7ec9698</id>
<content type='text'>
</content>
</entry>
<entry>
<title>drm: Return ENODEV if the inode mapping changes</title>
<updated>2010-03-31T03:12:00Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2010-03-18T11:56:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=da58405860b992d2bb21ebae5d685fe3204dd3f0'/>
<id>urn:sha1:da58405860b992d2bb21ebae5d685fe3204dd3f0</id>
<content type='text'>
Replace a BUG_ON with an error code in the event that the inode mapping
changes between calls to drm_open. This may happen for instance if udev
is loaded subsequent to the original opening of the device:

[  644.291870] kernel BUG at drivers/gpu/drm/drm_fops.c:146!
[  644.291876] invalid opcode: 0000 [#1] SMP
[  644.291882] last sysfs file: /sys/kernel/uevent_seqnum
[  644.291888]
[  644.291895] Pid: 7276, comm: lt-cairo-test-s Not tainted 2.6.34-rc1 #2 N150/N210/N220             /N150/N210/N220
[  644.291903] EIP: 0060:[&lt;c11c70e3&gt;] EFLAGS: 00210283 CPU: 0
[  644.291912] EIP is at drm_open+0x4b1/0x4e2
[  644.291918] EAX: f72d8d18 EBX: f790a400 ECX: f73176b8 EDX: 00000000
[  644.291923] ESI: f790a414 EDI: f790a414 EBP: f647ae20 ESP: f647adfc
[  644.291929]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[  644.291937] Process lt-cairo-test-s (pid: 7276, ti=f647a000 task=f73f5c80 task.ti=f647a000)
[  644.291941] Stack:
[  644.291945]  00000000 f7bb7400 00000080 f6451100 f73176b8 f6479214 f6451100 f73176b8
[  644.291957] &lt;0&gt; c1297ce0 f647ae34 c11c6c04 f73176b8 f7949800 00000000 f647ae54 c1080ac5
[  644.291969] &lt;0&gt; f7949800 f6451100 00000000 f6451100 f73176b8 f6452780 f647ae70 c107d1e6
[  644.291982] Call Trace:
[  644.291991]  [&lt;c11c6c04&gt;] ? drm_stub_open+0x8a/0xb8
[  644.292000]  [&lt;c1080ac5&gt;] ? chrdev_open+0xef/0x106
[  644.292008]  [&lt;c107d1e6&gt;] ? __dentry_open+0xd4/0x1a6
[  644.292015]  [&lt;c107d35b&gt;] ? nameidata_to_filp+0x31/0x45
[  644.292022]  [&lt;c10809d6&gt;] ? chrdev_open+0x0/0x106
[  644.292030]  [&lt;c10864e2&gt;] ? do_last+0x346/0x423
[  644.292037]  [&lt;c108789f&gt;] ? do_filp_open+0x190/0x415
[  644.292046]  [&lt;c1071eb5&gt;] ? handle_mm_fault+0x214/0x710
[  644.292053]  [&lt;c107d008&gt;] ? do_sys_open+0x4d/0xe9
[  644.292061]  [&lt;c1016462&gt;] ? do_page_fault+0x211/0x23f
[  644.292068]  [&lt;c107d0f0&gt;] ? sys_open+0x23/0x2b
[  644.292075]  [&lt;c1002650&gt;] ? sysenter_do_call+0x12/0x26
[  644.292079] Code: 89 f0 89 55 dc e8 8d 96 0a 00 8b 45 e0 8b 55 dc 83 78 04 01 75 28 8b 83 18 02 00 00 85 c0 74 0f 8b 4d ec 3b 81 ac 00 00 00 74 13 &lt;0f&gt; 0b eb fe 8b 4d ec 8b 81 ac 00 00 00 89 83 18 02 00 00 89 f0
[  644.292143] EIP: [&lt;c11c70e3&gt;] drm_open+0x4b1/0x4e2 SS:ESP 0068:f647adfc
[  644.292175] ---[ end trace 2ddd476af89a60fa ]---

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: stable@kernel.org
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h</title>
<updated>2010-03-30T13:02:32Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-03-24T08:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5a0e3ad6af8660be21ca98a971cd00f331318c05'/>
<id>urn:sha1:5a0e3ad6af8660be21ca98a971cd00f331318c05</id>
<content type='text'>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</content>
</entry>
</feed>
