[PATCH 5/9] drm/gem: add drm_gem_create_mmap_offset_size()

2013-08-08 Thread David Herrmann
of a duplicated and slightly modified version of > drm_gem_create_mmap_offset() in omapdrm. > > Signed-off-by: Rob Clark Reviewed-by: David Herrmann Regards David > --- > drivers/gpu/drm/drm_gem.c | 28 > include/drm/drmP.h| 1 + > 2 fil

[PATCH] drm: fix minor number range calculation

2013-08-08 Thread David Herrmann
Currently, both ranges overlap. Fix the limits so both ranges are mutually exclusive. Also use the occasion to convert whitespaces to tabs. Signed-off-by: Kristian H?gsberg (fixed up tabs and adjust commit-msg accordingly) Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 12

[PATCH] drm: fix minor number range calculation

2013-08-08 Thread David Herrmann
Hi On Thu, Aug 8, 2013 at 7:10 PM, David Herrmann wrote: > Currently, both ranges overlap. Fix the limits so both ranges are mutually > exclusive. Also use the occasion to convert whitespaces to tabs. > > Signed-off-by: Kristian H?gsberg > (fixed up tabs and adjust commit-

Build break due to 28ec711 "drm/agp: move AGP cleanup paths to drm_agpsupport.c"

2013-08-08 Thread David Herrmann
Hi On Thu, Aug 8, 2013 at 8:00 PM, Stephen Warren wrote: > In next-20130808, building tegra_defconfig for ARM yields: > >> drivers/built-in.o: In function `drm_lastclose': >> /home/swarren/shared/git_wa/kernel/kernel.git/drivers/gpu/drm/drm_drv.c:198: >> undefined reference to `drm_agp_clear' >

[PATCH] drm/agp: Fix build for non-AGP platforms

2013-08-08 Thread David Herrmann
Hi On Thu, Aug 8, 2013 at 12:20 PM, Mark Brown wrote: > From: Mark Brown > > Commit 28ec711 (drm/agp: move AGP cleanup paths to drm_agpsupport.c) > broke the build for platforms which do not have AGP since it moved the > AGP cleanup code inside an #ifdef __OS_HAS_AGP which are referenced > uncon

drm/agp linux-next build broken for non-AGP platform

2013-08-08 Thread David Herrmann
Hi On Thu, Aug 8, 2013 at 12:01 PM, Vincent Stehl? wrote: > Hi, > > Linux next-20130808 link breaks for me with ARM config multi_v7defconfig. > > It seems this is due to the following commit: > > 28ec711 drm/agp: move AGP cleanup paths to drm_agpsupport.c > > ...which calls drm_agp_clear() with

Build break due to 28ec711 "drm/agp: move AGP cleanup paths to drm_agpsupport.c"

2013-08-08 Thread David Herrmann
Hi On Thu, Aug 8, 2013 at 9:21 PM, Stephen Warren wrote: > On 08/08/2013 12:13 PM, David Herrmann wrote: >> Hi >> >> On Thu, Aug 8, 2013 at 8:00 PM, Stephen Warren >> wrote: >>> In next-20130808, building tegra_defconfig for ARM yields: >>> >&g

[PATCH v2] drm: provide agp dummies for CONFIG_AGP=n

2013-08-08 Thread David Herrmann
d by: commit 28ec711cd427f8b61f73712a43b8100ba8ca933b Author: David Herrmann Date: Sat Jul 27 16:37:00 2013 +0200 drm/agp: move AGP cleanup paths to drm_agpsupport.c v2: switch #ifdef -> #if (spotted by Stephen) Cc: Laurent Pinchart Cc: Daniel Vetter Cc: Stephen Warren Signed-off-by: David Herrmann ---

[PATCH] drm: drm_drv: Only call drm_agp_clear() in __OS_HAS_AGP case

2013-08-12 Thread David Herrmann
Hi On Fri, Aug 9, 2013 at 12:00 AM, Fabio Estevam wrote: > From: Fabio Estevam > > Commit 28ec711 (drm/agp: move AGP cleanup paths to drm_agpsupport.c) causes > the > following link error on ARM (imx_v6_v7_defconfig): > > drivers/built-in.o: In function `drm_lastclose': > :(.text+0x588a0): unde

dma-buf/fbdev: one-to-many support

2012-07-14 Thread David Herrmann
Hi I am currently working on fblog [1] (a replacement for fbcon without VT dependencies) but this questions does also apply to other fbdev users. Is there a way to share framebuffers between fbdev devices? I was thinking especially of USB devices like DisplayLink. If they share the same screen dim

dma-buf/fbdev: one-to-many support

2012-07-17 Thread David Herrmann
Hi Laurent and Alan On Tue, Jul 17, 2012 at 1:24 PM, Alan Cox wrote: >> The main issue is that fbdev has been designed with the implicit assumption >> that an fbdev driver will always own the graphics memory it uses. All >> components in the stack, from drivers to applications, have been designed

[BUG] gallium-gbm-target requires drm-pipe-loader

2012-06-10 Thread David Herrmann
Hi The recently added gbm gallium target (./src/gallium/targets/gbm/gbm.c) requires HAVE_DRM_PIPE_LOADER for pipe_loader_drm_probe(). Otherwise, the compiler fails with an unresolved function-name. However, HAVE_DRM_PIPE_LOADER is not defined when compiling i915 only, so I need to compile gallium

[PATCH] drm: fix drm_read() returning 0

2012-06-14 Thread David Herrmann
user-space. We can avoid this by waiting for events until we got at least one event or an error occurred. Signed-off-by: David Herrmann --- The patch might look a bit scary but it adds only a single do { } while(!total); around the whole block. drivers/gpu/drm/drm_fops.c |

[PATCH RESEND] drm: fix drm_read() returning 0

2012-06-24 Thread David Herrmann
user-space. We can avoid this by waiting for events until we got at least one event or an error occurred. Signed-off-by: David Herrmann --- The patch might look a bit scary but it adds only a single do { } while(!total); around the whole block. drivers/gpu/drm/drm_fops.c |

[PATCH] xf86drmMode.h: Add header protection

2012-03-08 Thread David Herrmann
xf86drmMode.h is missing a header protection. xf86drm.h has one so just copy it and adjust the name. Signed-off-by: David Herrmann --- I am not sure if this is the correct mailing-list for libdrm nor who the actual maintainer is. Please correct me if I should CC someone else or post it to

[BUG] inconsistent DPMS settings

2012-03-12 Thread David Herrmann
Hi I was tracing down a bug that made drmModePageFlip() fail and I noticed that the DPMS settings are not correctly restored when switching between xorg-server and vtcon. In fact, when enabling a monitor with xrandr in X while DPMS=off for that monitor, then it will stay blank. Switching back to V

[ANNOUNCE] kmscon: Lazy-web's DRM based terminal emulator

2012-03-27 Thread David Herrmann
Hi Motivated by Jesse's letter to the lazyweb [1] I worked on a kmscon program. It provides a terminal-emulator similar to the in-kernel terminal-emulator based on DRM. It is written from scratch and needs as external dependencies only mesa (libdrm, libgbm, libEGL, libGLESv2), udev, xproto (build-

[RFC 4/5] drm: Introduce drm_set_unique()

2014-04-23 Thread David Herrmann
Hi On Wed, Apr 23, 2014 at 10:40 AM, Daniel Vetter wrote: > On Wed, Apr 23, 2014 at 09:17:16AM +0200, Thierry Reding wrote: >> On second thought, wouldn't this be better located in drm_stub.c? It >> isn't really related to the IOCTL code except that one of the IOCTLs now >> uses the information s

[PATCH] drm: remove unused argument from drm_open_helper

2014-04-28 Thread David Herrmann
Hi On Mon, Apr 28, 2014 at 4:23 PM, Ilija Hadzic wrote: > inode argument is no longer in use (cf. f4aede2e3). > Remove it. > > Signed-off-by: Ilija Hadzic > Cc: David Herrmann Reviewed-by: David Herrmann Thanks David

[PATCH] drm: Missed clflushopt in drm_clflush_virt_range

2014-04-29 Thread David Herrmann
Hi On Mon, Apr 21, 2014 at 10:28 PM, Ross Zwisler wrote: > On Wed, 2 Apr 2014, Ross Zwisler wrote: >> With this commit: >> >> 2a0788dc9bc4 x86: Use clflushopt in drm_clflush_virt_range >> >> If clflushopt is available on the system, we use it instead of clflush >> in drm_clflush_virt_range. Ther

[PATCH v3 00/23] AMDKFD Kernel Driver

2014-08-05 Thread David Herrmann
Hi On Tue, Aug 5, 2014 at 5:30 PM, Oded Gabbay wrote: > Hi, > Here is the v3 patch set of amdkfd. > > This version contains changes and fixes to code, as agreed on during the > review > of the v2 patch set. > > The major changes are: > > - There are two new module parameters: # of processes and

[PULL] DRM Cleanups

2014-08-06 Thread David Herrmann
s legacy (2014-08-05 19:38:12 +0200) ---- David Herrmann (8): drm: extract legacy ctxbitmap flushing drm: drop redundant drm_file->is_master drm: don't de-authenticate clients on master-close drm: move module i

[PATCH] drm: Restore drm_file->is_master

2014-08-07 Thread David Herrmann
Hi On Thu, Aug 7, 2014 at 3:04 PM, Chris Wilson wrote: > Despite the claims of > > commit 48ba813701eb14b3008edefef4a0789b328e278c > Author: David Herrmann > Date: Tue Jul 22 18:46:09 2014 +0200 > > drm: drop redundant drm_file->is_master > > drm_file-&

[PATCH] drm: Don't grab an fb reference for the idr

2014-08-08 Thread David Herrmann
Hi On Wed, Aug 6, 2014 at 9:10 AM, Daniel Vetter wrote: > The current refcounting scheme is that the fb lookup idr also holds a > reference. This works out nicely bacause thus far we've always > explicitly cleaned up idr entries for framebuffers: > - Userspace fbs get removed in the rmfb ioctl or

[PATCH] drm/doc: Refer to proper source file

2014-08-08 Thread David Herrmann
g Nice catch. Reviewed-by: David Herrmann Thanks David > --- > Documentation/DocBook/drm.tmpl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl > index f68dbead883e..6a772b2dc514 100644

[PATCH] drm: Update DocBook template references for mv drm_stub.c drm_drv.c

2014-08-12 Thread David Herrmann
Hi On Tue, Aug 12, 2014 at 10:45 AM, Daniel Vetter wrote: > > Yet another one that was missed. > > Signed-off-by: Daniel Vetter This was already sent by Thierry. I have it in my local branch as: commit fc69dcf665ea46115c88d542f806f2780e74a21c Author: Thierry Reding Date: Fri Aug 8 11:33:1

GEM memory DOS (WAS Re: [PATCH 3/3] drm/ttm: under memory pressure minimize the size of memory pool)

2014-08-13 Thread David Herrmann
Hi On Wed, Aug 13, 2014 at 2:35 PM, Thomas Hellstrom wrote: > On 08/13/2014 12:42 PM, Daniel Vetter wrote: >> On Wed, Aug 13, 2014 at 11:06:25AM +0200, Thomas Hellstrom wrote: >>> On 08/13/2014 05:52 AM, J?r?me Glisse wrote: From: J?r?me Glisse When experiencing memory pressure w

drm_mode_create_dumb_ioctl: divide error

2014-08-22 Thread David Herrmann
Hi On Thu, Aug 21, 2014 at 8:18 PM, Tommi Rantala wrote: > Hello, > > Triggered this while fuzzing v3.17-rc1-51-g372b1db with Trinity. > > Tommi > > > [drm:drm_mode_legacy_fb_format] *ERROR* bad bpp, assuming x8r8g8b8 pixel > format > divide error: [#1] SMP DEBUG_PAGEALLOC > CPU: 0 PID: 285

drm_mode_create_dumb_ioctl: divide error

2014-08-24 Thread David Herrmann
Hi On Sun, Aug 24, 2014 at 7:12 PM, Tommi Rantala wrote: > (gdb) info locals > cpp = 0 > stride = 0 > size = > > (gdb) print /x *(struct drm_mode_create_dumb *)data > $13 = { > height = 0x, > width = 0x, > bpp = 0x, > flags = 0x, > handle = 0x, >

[PATCH] drm: fix division-by-zero on dumb_create()

2014-08-24 Thread David Herrmann
.this will obviously overflow if (n + d - 1) is bigger than UINT_MAX. Reported-by: Tommi Rantala Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index fe94cc1..5505

[PATCH v2] drm: fix division-by-zero on dumb_create()

2014-08-28 Thread David Herrmann
.this will obviously overflow if (n + d - 1) is bigger than UINT_MAX. Reported-by: Tommi Rantala Signed-off-by: David Herrmann Reviewed-by: Rob Clark --- v2: add comment that DIV_ROUND_UP() might overflow add Rob's r-b drivers/gpu/drm/drm_crtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[PATCH 00/20] DRM: Core Cleanups

2014-08-29 Thread David Herrmann
egacy stuff around so it's easier to drop it once unused. If someone disagrees with move, let me know and I'll drop the patch. I've pushed this to the 0-day testing bots now. I'll comment on the patches in case something shows up. Comments welcome! David David Herrmann (

[PATCH 01/20] drm/radeon: move drm_buffer to drm/radeon/

2014-08-29 Thread David Herrmann
Radeon UMS is the last user of drm_buffer. Move it out of sight so radeon can drop it together with UMS. Signed-off-by: David Herrmann --- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_buffer.c | 181 -- drivers/gpu/drm/radeon

[PATCH 02/20] drm: mark drm_buf and drm_map as legacy

2014-08-29 Thread David Herrmann
Move internal declarations to drm_legacy.h and add drm_legacy_*() prefix to all legacy functions. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_bufs.c | 89 ++--- drivers/gpu/drm/drm_drv.c | 4 +- drivers/gpu/drm/drm_ioctl.c

[PATCH 03/20] drm: move "struct drm_vma_entry" to drm_vm.c

2014-08-29 Thread David Herrmann
Make all the drm_vma_entry handling local to drm_vm.c and hide it from global headers. This requires to extract the inlined legacy drm_vma_entry cleanup into a small helper and also move a weirdly placed drm_vma_info helper into drm_vm.c. Signed-off-by: David Herrmann --- drivers/gpu/drm

[PATCH 04/20] drm: move "struct drm_magic_entry" to drm_auth.c

2014-08-29 Thread David Herrmann
all of DRM. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_auth.c | 6 ++ drivers/gpu/drm/drm_drv.c | 7 --- include/drm/drmP.h | 6 -- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 3cedae

[PATCH 05/20] drm: drop unused "struct drm_waitlist"

2014-08-29 Thread David Herrmann
This structure is unused, drop it. Signed-off-by: David Herrmann --- include/drm/drmP.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 0fdd813..0bf66f9 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -320,17 +320,6

[PATCH 06/20] drm: move AGP definitions harder

2014-08-29 Thread David Herrmann
Move drm_agp_head to drm_agpsupport.h and drm_agp_mem into drm_legacy.h. Unfortunately, drivers still heavily access drm_agp_head so we cannot move it to drm_legacy.h. However, at least it's no longer visible in drmP.h now (it's directly included from it, though). Signed-off-by: Davi

[PATCH 07/20] drm: replace weird conditional includes

2014-08-29 Thread David Herrmann
/ includes. Furthermore, drop the weird __alpha__ protection. It's safe to include sched.h everywhere (and the wait.h comment doesn't apply, anyway). Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_vm.c | 1 + include/drm/drmP.h | 10 +- 2 files changed, 2 insertions(+), 9

[PATCH 08/20] drm: drop __KERNEL__ protection in drmP.h

2014-08-29 Thread David Herrmann
drmP.h is internal to the kernel. No need to keep the __KERNEL__ protection. Signed-off-by: David Herrmann --- include/drm/drmP.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 31fb300..d3504c6 100644 --- a/include/drm/drmP.h +++ b/include/drm

[PATCH 09/20] drm: merge drm_memory.h into drm_memory.c

2014-08-29 Thread David Herrmann
The drm_memory.h header is only used to define PAGE_AGP, which is only used in drm_memory.c. Fold the header into drm_memory.c and drop it. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_memory.c | 11 + include/drm/drmP.h | 6 ++--- include/drm/drm_memory.h | 59

[PATCH 10/20] drm: move __OS_HAS_AGP into drm_agpsupport.h

2014-08-29 Thread David Herrmann
With drm_memory.h gone, there is no header left that uses __OS_HAS_AGP. Move it into drm_agpsupport.h (which is itself included from drmP.h) to hide it harder from public eyes. Signed-off-by: David Herrmann --- include/drm/drmP.h | 2 -- include/drm/drm_agpsupport.h | 3 +++ 2 files

[PATCH 11/20] drm: order includes alphabetically in drmP.h

2014-08-29 Thread David Herrmann
include a header multiple times. In fact, GCC already does some optimization regarding multiple inclusions if a sorrounding #ifndef is present. Signed-off-by: David Herrmann --- include/drm/drmP.h | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions

[PATCH 12/20] drm: drop DRM_DEBUG_CODE

2014-08-29 Thread David Herrmann
arded pretty fast.. There should hardly be any performance penalty, it's even guarded by unlikely(). Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_debugfs.c| 2 -- drivers/gpu/drm/drm_vm.c | 4 drivers/gpu/drm/radeon/radeon.h | 17 - drive

[PATCH 13/20] drm: inline "struct drm_sigdata"

2014-08-29 Thread David Herrmann
The sigdata structure is only used to group two fields in drm_device. Inline it and make it an unnamed object. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_lock.c | 15 --- include/drm/drmP.h | 12 +--- 2 files changed, 13 insertions(+), 14 deletions

[PATCH 14/20] drm: move remaining includes in drmP.h to the top

2014-08-29 Thread David Herrmann
Including headers somewhere else but at the top is ugly, deprecated and was used in early days only to speed up compile-times. Those days are over. Make headers independent and then move the inclusions to the top. Signed-off-by: David Herrmann --- include/drm/drmP.h | 31

[PATCH 15/20] drm: simplify drm_*_set_unique()

2014-08-29 Thread David Herrmann
Lets use kasprintf() to avoid pre-allocating the buffer. This is really nothing to optimize for speed and the input is trusted, so kasprintf() is just fine. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_pci.c | 30 -- drivers/gpu/drm/drm_platform.c | 31

[PATCH 16/20] drm: drop unused drm_master->unique_size

2014-08-29 Thread David Herrmann
This field is unused and there is really no reason to optimize unique-allocations. Drop it. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_ioctl.c| 1 - drivers/gpu/drm/drm_pci.c | 4 +--- drivers/gpu/drm/drm_platform.c | 1 - include/drm/drmP.h | 2 -- 4 files

[PATCH 18/20] drm: Goody bye, drm_bus!

2014-08-29 Thread David Herrmann
..we will not miss you.. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_ioctl.c| 8 +--- drivers/gpu/drm/drm_pci.c | 6 -- drivers/gpu/drm/drm_platform.c | 5 - drivers/gpu/drm/drm_usb.c | 12 include/drm/drmP.h | 5 - 5 files

[PATCH 19/20] drm: merge drm_usb into udl

2014-08-29 Thread David Herrmann
This merges all the remains of drm_usb into its only user, udl. We can then drop all the drm_usb stuff, including dev->usbdev. Signed-off-by: David Herrmann --- Documentation/DocBook/drm.tmpl | 3 +- drivers/gpu/drm/Kconfig | 6 --- drivers/gpu/drm/Makefile|

[PATCH 17/20] drm: add driver->set_busid() callback

2014-08-29 Thread David Herrmann
ine (unlikely, but lets be safe). Therefore, we create two different drivers for each platform during module_init() and set the set_busid() callback respectively. Signed-off-by: David Herrmann --- drivers/gpu/drm/armada/armada_drv.c | 1 + drivers/gpu/drm/ast/ast_drv.c| 1 + drivers/

[PATCH 20/20] drm: move drm-lock API to drm_legacy.h

2014-08-29 Thread David Herrmann
Same as the other legacy APIs, most of this is internal, so prefix it with drm_legacy_* and move into drm_legacy.h. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_fops.c | 6 +++--- drivers/gpu/drm/drm_ioctl.c | 4 ++-- drivers/gpu/drm/drm_legacy.h| 9

[PATCH 1/2] drm: make idr_mutex a spinlock

2014-08-29 Thread David Herrmann
: David Herrmann --- drivers/gpu/drm/drm_crtc.c | 34 -- include/drm/drm_crtc.h | 4 ++-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 61b6978..97eba56 100644 --- a/drivers/gpu/drm

[PATCH 2/2] drm: don't recycle used modeset IDs

2014-08-29 Thread David Herrmann
, well, is supposed to be sent and probably will be at some point). With this in place, modeset object hotplugging should work fine for all modeset objects in the KMS API. CC'ing stable so we can rely on all kernels with MST to not recycle IDs. Cc: # 3.16+ Signed-off-by: David Herrmann ---

[PATCH 2/2] drm: don't recycle used modeset IDs

2014-08-29 Thread David Herrmann
Hi On Fri, Aug 29, 2014 at 2:51 PM, Daniel Vetter wrote: > On Fri, Aug 29, 2014 at 02:01:01PM +0200, David Herrmann wrote: >> With MST, we now have connector hotplugging, yey! Pretty easy to use in >> user-space, but introduces some nasty races: >> * If a connector is re

[PATCH 1/2] drm: make idr_mutex a spinlock

2014-08-29 Thread David Herrmann
Hi On Fri, Aug 29, 2014 at 2:53 PM, Daniel Vetter wrote: > On Fri, Aug 29, 2014 at 02:01:00PM +0200, David Herrmann wrote: >> There is no reason to use a heavy mutex for idr protection. Use a spinlock >> and make idr-allocation use idr_preload(). >> >> This patch al

[PATCH 2/2] drm: don't recycle used modeset IDs

2014-08-29 Thread David Herrmann
Hi On Fri, Aug 29, 2014 at 2:57 PM, David Herrmann wrote: > Hi > > On Fri, Aug 29, 2014 at 2:51 PM, Daniel Vetter wrote: >> On Fri, Aug 29, 2014 at 02:01:01PM +0200, David Herrmann wrote: >>> With MST, we now have connector hotplugging, yey! Pretty easy to use in >&g

[PATCH 1/2] drm: make idr_mutex a spinlock

2014-08-29 Thread David Herrmann
Hi On Fri, Aug 29, 2014 at 3:10 PM, Thierry Reding wrote: > On Fri, Aug 29, 2014 at 02:01:00PM +0200, David Herrmann wrote: >> There is no reason to use a heavy mutex for idr protection. Use a spinlock >> and make idr-allocation use idr_preload(). >> >> This patch al

[PATCH 1/2] drm: remove agp_init() bus callback

2013-10-19 Thread David Herrmann
ts be safe. Signed-off-by: David Herrmann --- Hi If someone wants to review drm_agpsupport.c and tell me why _all_ calls to drm_agp_*() functions currently hold the global mutex, I'd be happy to hear it. Otherwise, I will just not care for that old stuff and keep the semantics with the kin

[PATCH 2/2] drm: rename agp_destroy() bus-cb to destroy()

2013-10-19 Thread David Herrmann
While the only user of agp_destroy() is the PCI-bus for agp-destruction, this callback is not strictly bound to agp. Rename to destroy() to make clear that any bus can use it to destroy resources once the device is removed. Signed-off-by: David Herrmann --- Hi We currently cannot remove the

[PATCH 1/6] drm: call drm_unplug_minor() from drm_put_minor()

2013-10-20 Thread David Herrmann
-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 33 - 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index c181b71..abc9d49 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm

[PATCH 2/6] drm: simplify drm_put_minor()

2013-10-20 Thread David Herrmann
DRM files, we can make it static, too. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 31 +-- include/drm/drmP.h | 1 - 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index

[PATCH 3/6] drm: make drm_get_minor() static

2013-10-20 Thread David Herrmann
drm_get_minor() is only used in one file. Make it static and add a kernel-doc comment which documents the current semantics. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 19 +++ include/drm/drmP.h | 1 - 2 files changed, 11 insertions(+), 9 deletions

[PATCH 4/6] drm: cleanup debugfs in drm_unplug_minor()

2013-10-20 Thread David Herrmann
There is no reason to delay debugfs-cleanup to drm_put_minor(). We should forbid any access to debugfs files once the device is dead. Chances they oops once a card was unplugged are very high, anyway. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 8 1 file changed, 4

[PATCH 5/6] drm: remove minor-id during unplug

2013-10-20 Thread David Herrmann
mutex so we're fine. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 5bf4339..4bb80cf 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/

[PATCH 6/6] drm: delay minor destruction to drm_dev_free()

2013-10-20 Thread David Herrmann
drm_dev_unregister() on live devices, we need to guarantee that minors are still valid (but unplugged). This way, any open file can still access file_priv->minor->dev to get the DRM device. However, the minor is unplugged so no new users can occur. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_

[RFC v2 0/6] DRM revoke support

2013-10-22 Thread David Herrmann
comments are welcome. Drivers which provide their own f_ops need to be fixed, other than that this is already working. Tested with udl locally. Running applications get poll(HUP) or SIGBUS for mmaps depending on what they're doing if they access the device after unplugging. Thanks David

[RFC v2 1/6] percpu_rw_semaphore: export symbols for modules

2013-10-22 Thread David Herrmann
DRM could make great use of percpu-rwsems to track active users and wait for them during hw hotplugging. Export symbols and allow using them in runtime loadable modules. Signed-off-by: David Herrmann --- lib/Makefile | 2 +- lib/percpu-rwsem.c | 7 +++ 2 files changed, 8 insertions

[RFC v2 2/6] percpu_rw_semaphore: add percpu_down_read_trylock()

2013-10-22 Thread David Herrmann
This is basically a copy of percpu_down_read() but does not sleep if a writer is already active. Same semantics as classic down_read_trylock(). Signed-off-by: David Herrmann --- include/linux/percpu-rwsem.h | 1 + lib/percpu-rwsem.c | 20 2 files changed, 21

[RFC v2 3/6] drm: split drm_release()

2013-10-22 Thread David Herrmann
could simply fake a drm_close() on each open-file now to logically close them. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_fops.c | 65 +++--- include/drm/drmP.h | 1 + 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/dr

[RFC v2 4/6] drm: make dev->unplugged reliable

2013-10-22 Thread David Herrmann
r drivers to allows full hotplugging, all their level-1 fops also need to be fixed. This can be done separately for each driver, though. Signed-off-by: David Herrmann --- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/drm_drv.c | 5 +- drivers/gpu/drm/drm_fops.c | 25

[RFC v2 5/6] drm: make drm_dev_unregister() immediate

2013-10-22 Thread David Herrmann
ll free the DRM-device. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_fops.c| 29 +- drivers/gpu/drm/drm_stub.c| 68 ++- drivers/gpu/drm/udl/udl_drv.c | 2 +- include/drm/drmP.h| 1 - 4 files changed, 65 inser

[RFC v2 6/6] drm: zap mmaps for dead devices

2013-10-22 Thread David Herrmann
can create new mmaps after/during drm_dev_unregister(). Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index e363b72..274a005 100644 --- a/drivers/gpu/drm/drm_stub.c

[PATCH] drm: allow DRM_IOCTL_VERSION on render-nodes

2013-10-28 Thread David Herrmann
e the more reliable way to do this (in case we add new DRM-bus drivers which have no BUSID or similar). Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 21

[PATCH 1/2] drm: Do not drop root privileges for a fancier younger process

2013-10-30 Thread David Herrmann
; diff --git a/include/drm/drmP.h b/include/drm/drmP.h > index 490534c990b7..3a90857bd0ee 100644 > --- a/include/drm/drmP.h > +++ b/include/drm/drmP.h > @@ -412,6 +412,7 @@ struct drm_prime_file_private { > > /** File private data */ > struct drm_file { > + int always_authent

[PATCH 1/2] simplefb: fix unmapping fb during destruction

2013-10-30 Thread David Herrmann
Hi Tomi Could we get this in -next before the merge-window starts? Stephen already ack'ed it. Thanks David On Wed, Oct 2, 2013 at 6:23 PM, David Herrmann wrote: > Hi > > On Wed, Oct 2, 2013 at 6:16 PM, Stephen Warren > wrote: >> On 10/02/2013 08:58 AM, David Herrmann w

[PATCH 2/2] simplefb: use write-combined remapping

2013-10-30 Thread David Herrmann
Hi Tomi Ping? Thanks David On Wed, Oct 2, 2013 at 4:58 PM, David Herrmann wrote: > Framebuffers shouldn't be cached and it is usually very uncommon to read > them. Therefore, use ioremap_wc() to get significant speed improvements on > systems which provide it. On all other system

[PATCH] Allow kmscon to be cross-compiled

2013-09-09 Thread David Herrmann
Hi On Mon, Sep 9, 2013 at 12:27 PM, Thierry Reding wrote: > The genshader and genunifont utilities are run during the build process > to generate source files. In order for that to work when cross-compiling > the files need to be built using the native compiler instead of the > cross-compiler. >

[PATCH] Allow kmscon to be cross-compiled

2013-09-12 Thread David Herrmann
Hi On Mon, Sep 9, 2013 at 1:43 PM, Thierry Reding wrote: > On Mon, Sep 09, 2013 at 12:48:08PM +0200, David Herrmann wrote: >> Hi >> >> On Mon, Sep 9, 2013 at 12:27 PM, Thierry Reding >> wrote: >> > The genshader and genunifont utilities are run during the b

[PATCH 3/6] shm: add memfd_create() syscall

2014-04-02 Thread David Herrmann
Hi On Wed, Apr 2, 2014 at 3:38 PM, Konstantin Khlebnikov wrote: > On Wed, Mar 19, 2014 at 11:06 PM, David Herrmann > wrote: >> memfd_create() is similar to mmap(MAP_ANON), but returns a file-descriptor >> that you can pass to mmap(). It explicitly allows sealing and >&g

[PATCH 07/13] drm/via: Remove unecessary NULL check

2014-04-07 Thread David Herrmann
Hi On Sat, Apr 5, 2014 at 11:44 AM, Daniel Vetter wrote: > The context_dtor callback is only called once we've successfully loaded > the driver, which means dev->dev_private is set up. The check is hence > pointless. > > Also dev->dev_private is deref already above, so compilers are free > to el

[PATCH 00/13] coverity

2014-04-07 Thread David Herrmann
stuff (not enough clue) and one insane > savage > init issue (no desire to wake dragons today). All patches besides "drm/ast: Remove dead code from cbr_scan2" are: Reviewed-by: David Herrmann However, a few notes: - ttm_bo_unref() sets "bo = NULL;", so the following con

WARNING ... drivers/gpu/drm/ttm/ttm_bo_vm.c...

2014-04-09 Thread David Herrmann
Hi Thomas On Tue, Apr 8, 2014 at 7:11 AM, Thomas Hellstrom wrote: > Hi, David, > > Are there any dev_mapping changes in 3.15 that could cause this? > Do we know what happens to vma->vm_file->f_mapping during fork? Sorry, I was traveling. Yes, there have been changes, but I converted all drivers

[PATCH 0/6] File Sealing & memfd_create()

2014-04-09 Thread David Herrmann
Hi On Tue, Apr 8, 2014 at 3:00 PM, Florian Weimer wrote: > How do you keep these promises on network and FUSE file systems? I don't. This is shmem only. Thanks David

[PATCH 0/6] File Sealing & memfd_create()

2014-04-10 Thread David Herrmann
Hi On Thu, Apr 10, 2014 at 10:37 PM, Andy Lutomirski wrote: > It occurs to me that, before going nuts with these kinds of flags, it > may pay to just try to fix the /proc/self/fd issue for real -- we > could just make open("/proc/self/fd/3", O_RDWR) fail if fd 3 is > read-only. That may be enou

[PATCH 0/6] File Sealing & memfd_create()

2014-04-11 Thread David Herrmann
Hi On Thu, Apr 10, 2014 at 11:16 PM, Andy Lutomirski wrote: > Would it make sense for the initial mode on a memfd inode to be 000? > Anyone who finds this to be problematic could use fchmod to fix it. memfd_create() should be subject to umask() just like anything else. That should solve any pos

[PATCH 0/6] File Sealing & memfd_create()

2014-04-11 Thread David Herrmann
Hi On Fri, Apr 11, 2014 at 1:05 AM, Andy Lutomirski wrote: > /proc/pid/fd is a really weird corner case in which the mode of an > inode that doesn't have a name matters. I suspect that almost no one > will ever want to open one of these things out of /proc/self/fd, and > those who do should be m

[PATCH 2/6] shm: add sealing API

2014-04-11 Thread David Herrmann
Hi On Thu, Apr 10, 2014 at 11:33 PM, Tony Battersby wrote: > For O_DIRECT the kernel pins the submitted pages in memory for DMA by > incrementing the page reference counts when the I/O is submitted, > allowing the pages to be modified by DMA even if they are no longer > mapped in the address spa

DRM security flaws and security levels.

2014-04-11 Thread David Herrmann
Hi On Fri, Apr 11, 2014 at 2:42 PM, Thomas Hellstrom wrote: > as was discussed a while ago, there are some serious security flaws with > the current drm master model, that allows a > user that had previous access or current access to an X server terminal > to access the GPU memory of the active

[PATCH 2/6] shm: add sealing API

2014-04-11 Thread David Herrmann
Hi On Fri, Apr 11, 2014 at 3:43 PM, Tony Battersby wrote: > Exactly. For O_DIRECT, that would be the call to get_user_pages_fast() > from dio_refill_pages() in fs/direct-io.c, which is ultimately called > from blkdev_direct_IO(). If you drop mmap_sem after pinning a page without taking a write

[PATCH] drm: Provide drm_set_busid() fallback

2014-04-11 Thread David Herrmann
Hi On Fri, Apr 11, 2014 at 7:43 PM, Daniel Vetter wrote: > Hm, my plan was actually to just provide a drm_dev_setunique to drivers so > that they can set whatever their userspace wants, and then have no > set_busid implementation here at all for !pci. Some userspace at least > uses the unique thi

[PATCH 2/6] shm: add sealing API

2014-04-11 Thread David Herrmann
Hi On Fri, Apr 11, 2014 at 11:36 PM, Andy Lutomirski wrote: > A quick grep of the kernel tree finds exactly zero code paths > incrementing i_mmap_writable outside of mmap and fork. > > Or do you mean a different kind of write ref? What am I missing here? Sorry, I meant i_writecount. Thanks Da

[PATCH 2/6] shm: add sealing API

2014-04-14 Thread David Herrmann
Hi On Sat, Apr 12, 2014 at 12:07 AM, Andy Lutomirski wrote: > I bet this is missing from lots of places. For example, I can't find > any write_access stuff in the rdma code. > > I suspect that the VM_DENYWRITE code is just generally racy. So what does S_IMMUTABLE do to prevent such races? I so

[PATCH 00/18] drm_bus cleanups and other cruft removal

2014-04-22 Thread David Herrmann
Hi On Fri, Apr 11, 2014 at 11:35 PM, Daniel Vetter wrote: > Hi all, > > I've chatted a bit with Thierry about how we could allow drivers to not even > required a drm_bus any more. Which is relevant when e.g. due to the new > master/component no platform device is conveniently around. > > So I've

[PATCH] drm: fix memory leak around mode_group

2014-04-22 Thread David Herrmann
Hi On Fri, Apr 18, 2014 at 2:02 AM, Dave Airlie wrote: > From: Dave Airlie > > This mode group id_list was never being freed. > > Signed-off-by: Dave Airlie > --- > drivers/gpu/drm/drm_crtc.c | 6 ++ > drivers/gpu/drm/drm_stub.c | 1 + > include/drm/drm_crtc.h | 1 + > 3 files changed,

Design review request: DRM color manager

2014-04-22 Thread David Herrmann
Hi On Tue, Apr 22, 2014 at 6:11 AM, Sharma, Shashank wrote: > Gentle reminder Usual approach is to send any proposals as inline plain-text. It's really hard to comment on attachments, especially if it's an MS-office format. Anyhow, some comments on the proposal: 1) Why do you register only a si

Design review request: DRM color manager

2014-04-22 Thread David Herrmann
Hi On Tue, Apr 22, 2014 at 12:21 PM, Sharma, Shashank wrote: > 1) Why do you register only a single property? Why not register a separate > property for each color-correction that is available? This way you can drop > the property-id and use the high-level DRM-prop IDs/names. >>> That?s the who

[PATCH 0/6] File Sealing & memfd_create()

2014-04-22 Thread David Herrmann
Hi On Tue, Apr 22, 2014 at 11:10 AM, Florian Weimer wrote: > Ah. What do you recommend for recipient to recognize such descriptors? > Would they just try to seal them and reject them if this fails? This highly depends on your use-case. Please see the initial email in this thread. It describes 2

[PATCH 0/6] File Sealing & memfd_create()

2014-04-22 Thread David Herrmann
Hi On Tue, Apr 22, 2014 at 2:44 PM, Florian Weimer wrote: > I didn't find that very convincing. But in v2, seals are monotonic, so > checking them should be reliable enough. Ok. > What happens when you create a loop device on a write-sealed descriptor? Any write-back to the loop-device will f

[RFC 00/16] drm/nouveau: initial support for GK20A (Tegra K1)

2014-02-03 Thread David Herrmann
Hi [..snip..] > Finally, support for probing GK20A is added in the last 2 patches. It should > be > noted that contrary to what Nouveau currently expects, GK20A does not embed > any > display hardware (that part being handled by tegradrm). So this driver should > really be only used through DRM

<    3   4   5   6   7   8   9   10   11   12   >