Re: [PATCH 1/6] drm: pre allocate node for create_block

2013-07-04 Thread David Herrmann
Hi On Wed, Jul 3, 2013 at 11:45 PM, Ben Widawsky wrote: > For an upcoming patch where we introduce the i915 VMA, it's ideal to > have the drm_mm_node as part of the VMA struct (ie. it's pre-allocated). > Part of the conversion to VMAs is to kill off obj->gtt_space. Doing this > will break a bunch

[PATCH v2 00/14] Platform Framebuffers and SimpleDRM

2013-07-04 Thread David Herrmann
ysfb_efi.c, too? We could make the DMI table __init then. I tested this (including DRM handover) with vesafb, efifb and simpledrm. It all worked well without problems. More testing is highly welcome! Also feel free to pickup individual fixes which don't directly depend on the series (eg. #

[PATCH v2 01/14] fbdev: simplefb: add init through platform_data

2013-07-04 Thread David Herrmann
it is not needed. The headers provide proper dummies for the case OF is disabled. Furthermore, we move the FORMAT-definitions to the common platform header so initialization code can use it to transform "struct screen_info" to the right format-name. Signed-off-by: David Herrmann --

[PATCH v2 02/14] fbdev: simplefb: mark as fw and allocate apertures

2013-07-04 Thread David Herrmann
for VGA/vesa/EFI framebuffers, but is also of great use for all other systems. Especially with x86 support for simplefb, this information is needed to unload simplefb before a real hw-driver (like i915, radeon, nouveau) is loaded. Signed-off-by: David Herrmann --- drivers/video/simplefb.c | 10

[PATCH v2 03/14] x86: provide platform-devices for boot-framebuffers

2013-07-04 Thread David Herrmann
and provide a generic simple-framebuffer. For backwards-compatibility (if strange formats are used), we still allow vesafb/efifb to be loaded simultaneously and pick up all remaining devices. Signed-off-by: David Herrmann --- arch/x86/Kconfig | 26 +++ arch/x86/in

[PATCH v2 04/14] x86: sysfb: move EFI quirks from efifb to sysfb

2013-07-04 Thread David Herrmann
The EFI FB quirks from efifb.c are useful for simple-framebuffer devices as well. Apply them by default so we can convert efifb.c to use efi-framebuffer platform devices. Signed-off-by: David Herrmann --- arch/x86/include/asm/sysfb.h | 57 +++ arch/x86/kernel/Makefile | 1 + arch

[PATCH v2 05/14] fbdev: simplefb: add 32bit RGB formats

2013-07-04 Thread David Herrmann
32bit XRGB and ARGB are used by modern x86 systems for EFI and VESA framebuffers. Add both variants so simplefb can be used on such systems. Signed-off-by: David Herrmann --- include/linux/platform_data/simplefb.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/platform_data

[PATCH v2 06/14] fbdev: vesafb: bind to platform-framebuffer device

2013-07-04 Thread David Herrmann
x86 creates platform-framebuffer platform devices for every system framebuffer. Use these instead of creating a dummy device. This requires us to remove the __init annotations as hotplugging may occur during runtime. Signed-off-by: David Herrmann --- drivers/video/vesafb.c | 55

[PATCH v2 07/14] fbdev: efifb: bind to efi-framebuffer

2013-07-04 Thread David Herrmann
Instead of creating a dummy device, we now bind to the efi-fb device which is provided by x86 initialization code. Signed-off-by: David Herrmann --- drivers/video/efifb.c | 68 +-- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a

[PATCH v2 08/14] fbdev: fbcon: select VT_HW_CONSOLE_BINDING

2013-07-04 Thread David Herrmann
and I couldn't figure out why. Hence, lets just require console-unbinding so fbdev hotplugging works with fbcon. Signed-off-by: David Herrmann --- drivers/video/console/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/console/Kconfig b/drivers/

[PATCH v2 09/14] drm: add SimpleDRM driver

2013-07-04 Thread David Herrmann
. The buffer is directly mapped into user-space, so we have only resources for a single buffer. Otherwise, shadow buffers plus damage-request would be needed. Signed-off-by: David Herrmann --- MAINTAINERS| 8 + drivers/gpu/drm/Kconfig| 2

[PATCH v2 10/14] drm: simpledrm: add fbdev fallback support

2013-07-04 Thread David Herrmann
Create a simple fbdev device during SimpleDRM setup so legacy user-space and fbcon can use it. Signed-off-by: David Herrmann --- drivers/gpu/drm/simpledrm/Kconfig | 11 ++ drivers/gpu/drm/simpledrm/Makefile | 1 + drivers/gpu/drm/simpledrm/simpledrm.h | 22

[PATCH v2 11/14] drm: add helpers to kick out firmware drivers

2013-07-04 Thread David Herrmann
invalidate the firmware framebuffer. Otherwise, simpledrm could be loaded again, after a real hw-driver was unloaded (which is very unlikely to work, except if hw-drivers reset fw FBs during unload). Note that fbdev doesn't provide such protection against late driver probing. Signed-off-by: David Her

[PATCH v2 12/14] drm: nouveau: kick out firmware drivers during probe

2013-07-04 Thread David Herrmann
Use the new DRM infrastructure to kick out firmware drivers before probing the real driver. Signed-off-by: David Herrmann --- drivers/gpu/drm/nouveau/nouveau_drm.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/nouveau

[PATCH v2 13/14] drm/i915: use new drm_kick_out_firmware()

2013-07-04 Thread David Herrmann
Use the new DRM infrastructure to kick out firmware DRM drivers before loading i915. Signed-off-by: David Herrmann --- drivers/gpu/drm/i915/i915_dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c

[PATCH v2 14/14] drm/radeon: use new drm_kick_out_firmware()

2013-07-04 Thread David Herrmann
Kick out firmware DRM and fbdev drivers via the new drm_kick_out_firmware() before loading radeon. Signed-off-by: David Herrmann --- drivers/gpu/drm/radeon/radeon_drv.c | 28 drivers/gpu/drm/radeon/radeon_kms.c | 30 ++ 2 files changed

Re: [PATCH] [v3] drm: pre allocate node for create_block

2013-07-04 Thread David Herrmann
(David) > Free node, and NULL it in failed create_stolen (David) > Add back accidentally removed newline (David) > > CC: > CC: David Herrmann > Signed-off-by: Ben Widawsky I already suspected that you'd embed drm_mm_node in a follow-up patch but I am not subscribed to in

Re: [PATCH v2 00/14] Platform Framebuffers and SimpleDRM

2013-07-05 Thread David Herrmann
Hi On Thu, Jul 4, 2013 at 7:48 PM, H. Peter Anvin wrote: > On 07/04/2013 05:25 AM, David Herrmann wrote: >> >> - What FB formats are common on x86 that we should add to >> SIMPLEFB_FORMATS? >> (other than ARGB/XRGB32) > > > The common pixel formats on x8

[PATCH v2 00/20] Unified VMA Offset Manager v2 (+Render Node RFC)

2013-07-07 Thread David Herrmann
de driver patches: https://gitorious.org/linux-nouveau-pm/linux-nouveau-pm/commits/render_nodes David Herrmann (20): drm: add unified vma offset manager drm/gem: convert to new unified vma manager drm/ttm: convert to unified vma offset manager drm/vma: provide drm_vma_node_unmap() helper

[PATCH v2 01/20] drm: add unified vma offset manager

2013-07-07 Thread David Herrmann
- use drm_vma_node_reset() for initialization, too Signed-off-by: David Herrmann --- Documentation/DocBook/drm.tmpl| 6 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_vma_manager.c | 260 ++ include/drm/drm_vma_manager.h

[PATCH v2 02/20] drm/gem: convert to new unified vma manager

2013-07-07 Thread David Herrmann
which strictly wouldn't be needed for gem. v2: - rebase on drm-next - init nodes via drm_vma_node_reset() in drm_gem.c Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_gem.c | 90 ++ drivers/gpu/drm/drm_gem_cma_helper.c | 9 +-- driv

[PATCH v2 03/20] drm/ttm: convert to unified vma offset manager

2013-07-07 Thread David Herrmann
e during lookup. However, this lock is not needed during vm-setup as we still hold a reference there. This also drops the addr_space_offset member as it is a copy of vm_start in vma_node objects. Use the accessor functions instead. Signed-off-by: David Herrmann --- drivers/gpu/drm/ast/as

[PATCH v2 04/20] drm/vma: provide drm_vma_node_unmap() helper

2013-07-07 Thread David Herrmann
-by: Daniel Vetter Signed-off-by: David Herrmann --- drivers/gpu/drm/i915/i915_gem.c | 6 +- drivers/gpu/drm/ttm/ttm_bo.c| 11 +-- include/drm/drm_vma_manager.h | 16 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.

[RFC v2 05/20] drm/mm: add "best_match" to drm_mm_insert_node()

2013-07-07 Thread David Herrmann
Add a "best_match" argument similar to the drm_mm_search_*() helpers so we can convert TTM to use them in follow up patches. Also move the non-generic aliases to drm_mm.h header instead of keeping them in the source file. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_mm.c

[RFC v2 06/20] drm/ttm: replace drm_mm_pre_get() by direct alloc

2013-07-07 Thread David Herrmann
Instead of calling drm_mm_pre_get() in a row, we now preallocate the node and then use the atomic insertion functions. This has the exact same semantics and there is no reason to use the racy pre-allocations. Signed-off-by: David Herrmann --- drivers/gpu/drm/ttm/ttm_bo_manager.c | 40

[RFC v2 07/20] drm/i915: pre-alloc instead of drm_mm search/get_block

2013-07-07 Thread David Herrmann
i915 is the last user of the weird search+get_block drm_mm API. Convert it to an explicit kmalloc()+insert_node(). Signed-off-by: David Herrmann --- drivers/gpu/drm/i915/i915_gem.c| 9 +++-- drivers/gpu/drm/i915/i915_gem_stolen.c | 72 ++ 2 files changed

[RFC v2 08/20] drm/mm: remove unused API

2013-07-07 Thread David Herrmann
These calls are no longer used. Remove them. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_mm.c | 116 --- include/drm/drm_mm.h | 74 -- 2 files changed, 19 insertions(+), 171 deletions(-) diff --git a/drivers

[PATCH v2 09/20] drm/vma: add access management helpers

2013-07-07 Thread David Herrmann
node as there is no generic lock available for the caller to protect the node easily. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_vma_manager.c | 148 ++ include/drm/drm_vma_manager.h | 16 + 2 files changed, 164 insertions(+) diff --g

[PATCH v2 10/20] drm/ast: implement mmap access managament

2013-07-07 Thread David Herrmann
Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Cc: Dave Airlie Signed-off-by: David Herrmann --- drivers/gpu/drm/ast/ast_drv.c | 2 ++ drivers/gpu/drm/ast/ast_drv.h | 4 drivers/gpu/drm/ast/ast_main.c | 15 +++ 3 files changed

[PATCH v2 11/20] drm/cirrus: implement mmap access managament

2013-07-07 Thread David Herrmann
Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Cc: Dave Airlie Signed-off-by: David Herrmann --- drivers/gpu/drm/cirrus/cirrus_drv.h | 4 drivers/gpu/drm/cirrus/cirrus_main.c | 15 +++ 2 files changed, 19 insertions(+) diff --git

[PATCH v2 12/20] drm/mgag200: implement mmap access managament

2013-07-07 Thread David Herrmann
Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Cc: Dave Airlie Signed-off-by: David Herrmann --- drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_drv.h | 4 drivers/gpu/drm/mgag200/mgag200_main.c | 15

[PATCH v2 13/20] drm/nouveau: implement mmap access managament

2013-07-07 Thread David Herrmann
Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Cc: Ben Skeggs Signed-off-by: David Herrmann --- drivers/gpu/drm/nouveau/nouveau_gem.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau

[PATCH v2 14/20] drm/radeon: implement mmap access managament

2013-07-07 Thread David Herrmann
Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Cc: Alex Deucher Signed-off-by: David Herrmann --- drivers/gpu/drm/radeon/radeon_gem.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm

[PATCH v2 15/20] drm/qxl: implement mmap access managament

2013-07-07 Thread David Herrmann
Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Cc: Dave Airlie Signed-off-by: David Herrmann --- drivers/gpu/drm/qxl/qxl_gem.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm

[PATCH v2 16/20] drm/vmwgfx: implement mmap access managament

2013-07-07 Thread David Herrmann
Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Also remove unused vmw_user_dmabuf_reference() to prevent from using it later without correctly adding mmap permissions. Cc: Thomas Hellstrom Signed-off-by: David Herrmann --- drivers/gpu/drm/vmwgfx

[PATCH v2 17/20] drm/ttm: prevent mmap access to unauthorized users

2013-07-07 Thread David Herrmann
management now. Signed-off-by: David Herrmann --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 54a67f1..756adc7 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++

[PATCH v2 18/20] drm/gem: implement mmap access management

2013-07-07 Thread David Herrmann
Implement automatic access management for mmap offsets for all GEM drivers. This prevents user-space applications from "guessing" GEM BO offsets and accessing buffers which they don't own. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_gem.c | 21 + 1 f

[PATCH v2 19/20] drm: fix minor number range calculation

2013-07-07 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. Cc: Martin Peres Cc: Kristian Høgsberg Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 12 ++-- 1 file changed, 6 insertions(+), 6

[PATCH v2 20/20] drm: implement render nodes

2013-07-07 Thread David Herrmann
DRM-Master if they support DRIVER_RENDER. Cc: Kristian Høgsberg Signed-off-by: David Herrmann --- Documentation/DocBook/drm.tmpl | 71 ++ drivers/gpu/drm/drm_drv.c | 15 - drivers/gpu/drm/drm_fops.c | 14 - drivers/gpu/drm/drm_pc

Re: [PATCH 0/5] kill omap_gem_helpers

2013-07-07 Thread David Herrmann
licts with my VMA-manager patches, but that should be easily solvable. Anyway, all 5 patches: Reviewed-by: David Herrmann Cheers David > drivers/gpu/drm/drm_gem.c | 119 +++- > drivers/gpu/drm/gma500/gtt.c | 38 +-- > drivers/gpu/drm/o

Re: [PATCH 08/39] drm: remove redundant clears from drm_setup

2013-07-10 Thread David Herrmann
Hi On Wed, Jul 10, 2013 at 2:11 PM, Daniel Vetter wrote: > We kzalloc the driver node at init time, so no need to do this again. > > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_fops.c | 9 - > 1 file changed, 9 deletions(-) > > diff --git a/drivers/gpu/drm/drm_fops.c b/driv

Re: [PATCH 33/39] drm: rip out drm_core_has_MTRR checks

2013-07-10 Thread David Herrmann
Hi On Wed, Jul 10, 2013 at 2:12 PM, Daniel Vetter wrote: > The new arch_phys_wc_add/del functions do the right thing both with > and without MTRR support in the kernel. So we can drop these > additional checks. > > Cc: Andy Lutomirski > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_

Re: [PATCH 34/39] drm: remove the dma_ioctl special-case

2013-07-10 Thread David Herrmann
Hi On Wed, Jul 10, 2013 at 2:12 PM, Daniel Vetter wrote: > We might as well have a real ioctl function which checks for the > callbacks. This seems to be a remnant from back in the days when each > drm driver had their own complete ioctl table, with no shared core > drm table at all. > > To make

Re: [PATCH 00/39] clean out drm cruft and hide it better for kms drivers

2013-07-10 Thread David Herrmann
remove a bunch of unused #defines from drmP.h > drm: rip out drm_core_has_MTRR checks > drm: remove the dma_ioctl special-case > drm/memory: don't export agp helpers > drm: hollow-out GET_CLIENT ioctl > drm: no-op out GET_STATS ioctl > drm: fix locking in gem debug

Re: [PATCH 33/39] drm: rip out drm_core_has_MTRR checks

2013-07-10 Thread David Herrmann
Hi On Wed, Jul 10, 2013 at 5:22 PM, Daniel Vetter wrote: > On Wed, Jul 10, 2013 at 3:51 PM, David Herrmann wrote: >>> -#if __OS_HAS_MTRR >>> -static inline int drm_core_has_MTRR(struct drm_device *dev) >>> -{ >>> - return drm_core_check_feature(d

Re: [PATCH v2 00/14] Platform Framebuffers and SimpleDRM

2013-07-10 Thread David Herrmann
Hi On Tue, Jul 9, 2013 at 11:02 PM, Stephen Warren wrote: > On 07/04/2013 06:25 AM, David Herrmann wrote: >> Hi >> >> This series changes the way we handle firmware framebuffers on x86 systems. >> On >> other architectures the recently introduced "simple-fr

[PATCH 0/2] Anonymous Inode Allocations

2013-07-10 Thread David Herrmann
_inode, I'd be happy to implement it. However, I didn't succeed and I am actually not sure that separate "struct address_space" are actually supported. For instance, DRM core uses code like: container_of(dev_mapping, struct inode, i_data) So I didn't spent much time on th

[PATCH 1/2] anon_inodes: allow external inode allocations

2013-07-10 Thread David Herrmann
FS mount, we extend it to also provide anonymous inodes for use in drivers like DRM. Signed-off-by: David Herrmann --- fs/anon_inodes.c| 36 +--- include/linux/anon_inodes.h | 1 + 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/f

[PATCH 2/2] DRM: use anon_inode instead of delayed inode init

2013-07-10 Thread David Herrmann
r what reason?), but I remember Daniel told me that i810 might. Tested with nouveau on x86_64. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_drv.c | 1 - drivers/gpu/drm/drm_fops.c | 24 +++- drivers/gpu/drm/drm_stub.c | 12 +

[PATCH 1/2] drm/gem: simplify object initialization

2013-07-11 Thread David Herrmann
igned-off-by: David Herrmann --- drivers/gpu/drm/drm_gem.c | 20 drivers/gpu/drm/gma500/framebuffer.c | 6 ++ drivers/gpu/drm/gma500/gem.c | 7 --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 7 +-- drivers/gpu/drm/i915/i915_gem_stolen.c

[PATCH 2/2] drm/pci: remove useles #if 1

2013-07-11 Thread David Herrmann
These don't make any sense, really.. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_pci.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 80c0b2b..a7b46ff 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gp

Re: [PATCH v2 02/20] drm/gem: convert to new unified vma manager

2013-07-11 Thread David Herrmann
Hi On Sun, Jul 7, 2013 at 7:17 PM, David Herrmann wrote: > Use the new vma manager instead of the old hashtable. Also convert all > drivers to use the new convenience helpers. This drops all the > (map_list.hash.key << PAGE_SHIFT) non-sense. > > Locking and access-managemen

Re: [PATCH v2 00/20] Unified VMA Offset Manager v2 (+Render Node RFC)

2013-07-11 Thread David Herrmann
Hi On Thu, Jul 11, 2013 at 1:12 PM, Martin Peres wrote: > On 07/07/2013 19:17, David Herrmann wrote: >> >> Hi >> >> This is v2 of the unified VMA offset manager series. The first draft is >> available at LWN [1]. This series replaces the VMA offset managers in

Re: Questions about TTM buffer object maping

2013-07-11 Thread David Herrmann
Hi On Thu, Jul 11, 2013 at 11:43 PM, Jean-Sébastien Pédron wrote: > Hi, > > Thank you Jérôme and Daniel for your input, that's really helpful! > > I have another question: in ttm_bo_mmap(), a reference to the buffer object > is acquired at the beginning of the function. Another reference is acqui

Re: [PATCH] drm: hollow-out GET_CLIENT ioctl

2013-07-17 Thread David Herrmann
already authenticated or not. > So we need to keep that part of things working. Simplest way is to > just return one entry to keep va_drm_is_authenticated in > libva/va/drm/va_drm_auth.c working. > > Cc: Gwenole Beauchesne > Cc: David Herrmann > Cc: Eric Anholt > Signed-o

Re: [PATCH 10/20] drm/gem: fix up flink name create race

2013-07-17 Thread David Herrmann
aware of the handle, yet. And if user-space already has a handle, then "handle_count" is >0, anyway. And gem_object_handle_unreference can only be called if another handle exists (thus, handle_count > 0). Or am I missing something? > *handlep = ret; > > - d

Re: [PATCH 12/20] drm/gem: make drm_gem_object_handle_unreference_unlocked static

2013-07-17 Thread David Herrmann
e them as handle_reference() is only called by handle_create(). Anyway: Reviewed-by: David Herrmann Cheers David > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_gem.c | 2 +- > include/drm/drmP.h| 1 - > 2 files changed, 1 insertion(+), 2 deletions(-) > >

Re: [PATCH v2 03/14] x86: provide platform-devices for boot-framebuffers

2013-07-17 Thread David Herrmann
Hi Any comments on this? On Thu, Jul 4, 2013 at 2:25 PM, David Herrmann wrote: > The current situation regarding boot-framebuffers (VGA, VESA/VBE, EFI) on > x86 causes troubles when loading multiple fbdev drivers. The global > "struct screen_info" does not provide any state-t

[PATCH v3 0/4] Unified VMA Offset Manager v3

2013-07-17 Thread David Herrmann
intentionally excluded the access-management patches from this series. Please see v2 for information on these. I will resend them once this series gets merged. Comments welcome! Cheers David David Herrmann (4): drm: add unified vma offset manager drm/gem: convert to new unified vma manager drm/ttm

[PATCH v3 1/4] drm: add unified vma offset manager

2013-07-17 Thread David Herrmann
- use drm_vma_node_reset() for initialization, too Signed-off-by: David Herrmann --- Documentation/DocBook/drm.tmpl| 6 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_vma_manager.c | 260 ++ include/drm/drm_vma_manager.h

[PATCH v3 2/4] drm/gem: convert to new unified vma manager

2013-07-17 Thread David Herrmann
which strictly wouldn't be needed for gem. v2: - rebase on drm-next - init nodes via drm_vma_node_reset() in drm_gem.c v3: - fix tegra Cc: Inki Dae Cc: Patrik Jakobsson Cc: Daniel Vetter Cc: Rob Clark Cc: Dave Airlie Cc: Thierry Reding Signed-off-by: David Herrmann --- driv

[PATCH v3 3/4] drm/ttm: convert to unified vma offset manager

2013-07-17 Thread David Herrmann
eres Cc: Alex Deucher Cc: Thomas Hellstrom Signed-off-by: David Herrmann --- drivers/gpu/drm/ast/ast_main.c| 2 +- drivers/gpu/drm/cirrus/cirrus_main.c | 2 +- drivers/gpu/drm/mgag200/mgag200_main.c| 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- drivers/gpu/drm

[PATCH v3 4/4] drm/vma: provide drm_vma_node_unmap() helper

2013-07-17 Thread David Herrmann
lie Cc: Maarten Lankhorst Cc: Thomas Hellstrom Reviewed-by: Daniel Vetter Signed-off-by: David Herrmann --- drivers/gpu/drm/i915/i915_gem.c | 6 +- drivers/gpu/drm/ttm/ttm_bo.c| 11 +-- include/drm/drm_vma_manager.h | 16 3 files changed, 18 insertions(+),

Re: [PATCH v3 3/4] drm/ttm: convert to unified vma offset manager

2013-07-18 Thread David Herrmann
and _unlock_lookup() helpers which just wrap the read_lock() and read_unlock? Thanks! David > Thanks, > Thomas > > > > > On 07/17/2013 08:14 PM, David Herrmann wrote: >> >> Use the new vma-manager infrastructure. This doesn't change any >> implementation

Re: [PATCH v3 3/4] drm/ttm: convert to unified vma offset manager

2013-07-18 Thread David Herrmann
Hi On Thu, Jul 18, 2013 at 1:24 PM, Thomas Hellstrom wrote: > On 07/18/2013 01:07 PM, David Herrmann wrote: >> >> Hi >> >> On Thu, Jul 18, 2013 at 10:53 AM, Thomas Hellstrom >> wrote: >>> >>> A quick look, but not a full review: >>> &g

Re: [PATCH v3 3/4] drm/ttm: convert to unified vma offset manager

2013-07-22 Thread David Herrmann
Sorry, I forgot to CC correctly. On Mon, Jul 22, 2013 at 12:53 PM, David Herrmann wrote: > Hi > > On Fri, Jul 19, 2013 at 11:13 AM, Thomas Hellstrom > wrote: >> On 07/18/2013 10:54 PM, David Herrmann wrote: >>> >>> Hi >>> >>> On Thu

[PATCH v4 0/4] Unified VMA Offset Manager

2013-07-23 Thread David Herrmann
typos and comments - Rebase on drm-next Comments welcome! Cheers David David Herrmann (4): drm: add unified vma offset manager drm/gem: convert to new unified vma manager drm/ttm: convert to unified vma offset manager drm/vma: provide drm_vma_node_unmap() helper Documentation/DocBook

[PATCH v4 1/4] drm: add unified vma offset manager

2013-07-23 Thread David Herrmann
- use drm_vma_node_reset() for initialization, too v4: - allow external locking via drm_vma_offset_un/lock_lookup() - add locked lookup helper drm_vma_offset_lookup_locked() Signed-off-by: David Herrmann --- Documentation/DocBook/drm.tmpl| 6 + drivers/gpu/drm/Makefile | 2 +- driver

[PATCH v4 2/4] drm/gem: convert to new unified vma manager

2013-07-23 Thread David Herrmann
b Clark Cc: Dave Airlie Cc: Thierry Reding Signed-off-by: David Herrmann Acked-by: Patrik Jakobsson --- drivers/gpu/drm/drm_gem.c | 89 +- drivers/gpu/drm/drm_gem_cma_helper.c | 16 ++ drivers/gpu/drm/exynos/exynos_drm_gem.c| 14 ++-

[PATCH v4 3/4] drm/ttm: convert to unified vma offset manager

2013-07-23 Thread David Herrmann
strom Signed-off-by: David Herrmann --- drivers/gpu/drm/ast/ast_main.c| 2 +- drivers/gpu/drm/cirrus/cirrus_main.c | 2 +- drivers/gpu/drm/mgag200/mgag200_main.c| 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- dr

[PATCH v4 4/4] drm/vma: provide drm_vma_node_unmap() helper

2013-07-23 Thread David Herrmann
ook comments Cc: Dave Airlie Cc: Maarten Lankhorst Cc: Thomas Hellstrom Signed-off-by: David Herrmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_gem.c | 6 +- drivers/gpu/drm/ttm/ttm_bo.c| 11 +-- include/drm/drm_vma_manager.h | 22 ++ 3 fi

Re: [PATCH 1/2] anon_inodes: allow external inode allocations

2013-07-24 Thread David Herrmann
Hi Al Any comment on this? Regards David On Thu, Jul 11, 2013 at 1:45 AM, David Herrmann wrote: > DRM core shares a single address_space across all inodes that belong to > the same DRM device. This allows efficient unmapping of user-space > mappings during buffer destruction. However,

[RFC 0/9] DRM: Device Handling Cleanup

2013-07-24 Thread David Herrmann
vers, but I thought I'd just send a first RFC so people can comment on that. Furthermore, the first 6 patches can be applied right away and fix error-paths during allocation and unify all the bus systems to use a single helper for device allocation. Cheers David David Herrmann (9): drm:

[RFC 1/9] drm: add drm_dev_alloc() helper

2013-07-24 Thread David Herrmann
phase, and a registration phase. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_pci.c | 4 +- drivers/gpu/drm/drm_platform.c | 3 +- drivers/gpu/drm/drm_stub.c | 121 + drivers/gpu/drm/drm_usb.c | 7 +-- include/drm/drmP.h

[RFC 2/9] drm: merge device setup into drm_dev_register()

2013-07-24 Thread David Herrmann
called this in any other error path either. Follow up patches will fix AGP error paths. We also keep a DRIVER_MODESET condition around pci_set_drvdata() to keep semantics. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_pci.c | 47 -- drivers/gpu/drm/drm_platform.c

[RFC 4/9] drm: move drm_lastclose() to drm_fops.c

2013-07-24 Thread David Herrmann
ioctl) - drm_drv.c: Global DRM init + ioctl handling Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_drv.c | 49 -- drivers/gpu/drm/drm_fops.c | 49 ++ 2 files changed, 49 insertions(+), 49 deletions

[RFC 5/9] drm: introduce drm_dev_free() to fix error paths

2013-07-24 Thread David Herrmann
_ht_remove(), drm_ctxbitmap_cleanup() and drm_gem_destroy() are all fine in that regard. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_pci.c | 2 +- drivers/gpu/drm/drm_platform.c | 2 +- drivers/gpu/drm/drm_stub.c | 35 +-- drivers/gpu/drm/drm_usb.c

[RFC 6/9] drm: move device unregistration into drm_dev_unregister()

2013-07-24 Thread David Herrmann
wever, drm_dev_put() definitely does not do any kind of ref-counting. Hence, use the more appropriate *_register(), *_unregister(), *_alloc() and *_free() names. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 57 -- include/drm/d

[RFC 7/9] percpu_rw_sempahore: export symbols for modules

2013-07-24 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 8/9] drm: track pending user-space actions

2013-07-24 Thread David Herrmann
r buffer access. The percpu-rwsem avoids this by protecting a whole file-op call and waiting with unplugging a device until all pending calls are finished. FIXME: We still need to update all the driver's fops in case they don't use the DRM core stubs. A quick look showed only custom mmap ca

[RFC 3/9] drm/agp: fix AGP cleanup paths

2013-07-24 Thread David Herrmann
. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_agpsupport.c | 51 drivers/gpu/drm/drm_drv.c| 21 + drivers/gpu/drm/drm_pci.c| 12 ++ drivers/gpu/drm/drm_stub.c | 12 -- include/drm/drmP.h

[RFC 9/9] drm: support immediate unplugging

2013-07-24 Thread David Herrmann
until last put_device() call), but allows immediate device deregistration via unregister_device(). Signed-off-by: David Herrmann --- Documentation/DocBook/drm.tmpl | 5 ++ drivers/gpu/drm/drm_fops.c | 85 +- drivers/gpu/drm/drm_stub.c

Re: [RFC 8/9] drm: track pending user-space actions

2013-07-24 Thread David Herrmann
Hi On Wed, Jul 24, 2013 at 4:03 PM, Maarten Lankhorst wrote: > Op 24-07-13 15:43, David Herrmann schreef: >> If we want to support real hotplugging, we need to block new syscalls from >> entering any drm_* fops. We also need to wait for these to finish before >> u

Re: [PATCH v4 1/4] drm: add unified vma offset manager

2013-07-24 Thread David Herrmann
Hi On Wed, Jul 24, 2013 at 5:35 PM, Daniel Vetter wrote: > On Tue, Jul 23, 2013 at 02:47:13PM +0200, David Herrmann wrote: >> If we want to map GPU memory into user-space, we need to linearize the >> addresses to not confuse mm-core. Currently, GEM and TTM both implement >

Re: [PATCH v4 2/4] drm/gem: convert to new unified vma manager

2013-07-24 Thread David Herrmann
Hi On Wed, Jul 24, 2013 at 5:52 PM, Daniel Vetter wrote: > On Tue, Jul 23, 2013 at 02:47:14PM +0200, David Herrmann wrote: >> Use the new vma manager instead of the old hashtable. Also convert all >> drivers to use the new convenience helpers. This drops all the >&g

[PATCH v5 1/4] drm: add unified vma offset manager

2013-07-24 Thread David Herrmann
) - fix drm_vma_offset_exact_lookup() to actually do what it says - remove redundant vm_pages member (add drm_vma_node_size() helper) - remove unneeded goto - fix documentation Signed-off-by: David Herrmann Reviewed-by: Daniel Vetter --- Documentation/DocBook/drm.tmpl| 6 + drivers/gpu/drm/Makefile

[PATCH v5 2/4] drm/gem: convert to new unified vma manager

2013-07-24 Thread David Herrmann
to kzalloc() - do not allow mapping gem-objects with offsets (backwards compat) - remove unneccessary casts Cc: Inki Dae Cc: Rob Clark Cc: Dave Airlie Cc: Thierry Reding Signed-off-by: David Herrmann Acked-by: Patrik Jakobsson Reviewed-by: Daniel Vetter --- drivers/gpu/dr

[PATCH v5 3/4] drm/ttm: convert to unified vma offset manager

2013-07-24 Thread David Herrmann
strom Signed-off-by: David Herrmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/ast/ast_main.c| 2 +- drivers/gpu/drm/cirrus/cirrus_main.c | 2 +- drivers/gpu/drm/mgag200/mgag200_main.c| 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- drivers/gpu/drm/no

[PATCH v5 4/4] drm/vma: provide drm_vma_node_unmap() helper

2013-07-24 Thread David Herrmann
ook comments v5: use drm_vma_node_size() Cc: Dave Airlie Cc: Maarten Lankhorst Cc: Thomas Hellstrom Signed-off-by: David Herrmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_gem.c | 6 +- drivers/gpu/drm/ttm/ttm_bo.c| 11 +-- include/drm/drm_vma_manager.h |

[PATCH] drm/ttm: inline drm_bo_setup_vm()

2013-07-25 Thread David Herrmann
This helper is used only once and just wraps a call to drm_vma_offset_add(). Remove this unneeded indirection to safe 10 lines of code. Signed-off-by: David Herrmann --- drivers/gpu/drm/ttm/ttm_bo.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a

[PATCH 0/4] DRM: Remove MM "Pre-Alloc"

2013-07-25 Thread David Herrmann
e, so Daniel can tackle his "drm_mm documentation" TODO list. Cheers David David Herrmann (4): drm/mm: add "best_match" to drm_mm_insert_node() drm/ttm: replace drm_mm_pre_get() by direct alloc drm/i915: pre-alloc instead of drm_mm search/get_block drm/mm: remove unu

[PATCH 1/4] drm/mm: add "best_match" to drm_mm_insert_node()

2013-07-25 Thread David Herrmann
Add a "best_match" argument similar to the drm_mm_search_*() helpers so we can convert TTM to use them in follow up patches. We can also inline the non-generic helpers and move them into the header to allow compile-time optimizations. Signed-off-by: David Herrmann --- drivers/gpu/dr

[PATCH 2/4] drm/ttm: replace drm_mm_pre_get() by direct alloc

2013-07-25 Thread David Herrmann
GFP_KERNEL alloc in nouveau/nouveau_ttm.c in nouveau_gart_manager_new(). So we can do the same in ttm_bo_man_get_node(). Signed-off-by: David Herrmann --- drivers/gpu/drm/ttm/ttm_bo_manager.c | 40 +--- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a

[PATCH 4/4] drm/mm: remove unused API

2013-07-25 Thread David Herrmann
rm_mm_node into their objects so no allocation is needed at all. Thus, remove the old pre-alloc API and all the helpers that it provides. Drivers have already been converted and we should not use the old API for new code, anymore. Signed-off-by: David Herrmann --- drivers/gpu/drm

[PATCH 3/4] drm/i915: pre-alloc instead of drm_mm search/get_block

2013-07-25 Thread David Herrmann
i915 is the last user of the weird search+get_block drm_mm API. Convert it to an explicit kmalloc()+insert_node(). This drops the last user of the node-cache in drm_mm. We can remove it now in a follow-up patch. Cc: Daniel Vetter Signed-off-by: David Herrmann --- drivers/gpu/drm/i915

[PATCH] drm/mm: include required headers in drm_mm.h

2013-07-25 Thread David Herrmann
We need BUG_ON(), spinlock_t and standard kernel data-types so include the right headers. Signed-off-by: David Herrmann --- include/drm/drm_mm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index a30c9aa..d3f0aa1 100644 --- a/include/drm

Re: [PATCH] drm/mm: include required headers in drm_mm.h

2013-07-25 Thread David Herrmann
t occur here on my machine, hmm. But I think fixing drm_mm.h is better than changing the include-order in drm_vma_manager.h, so this is what I did. On Thu, Jul 25, 2013 at 6:02 PM, David Herrmann wrote: > We need BUG_ON(), spinlock_t and standard kernel data-types so include the > right h

[PATCH] drm/gem: fix mmap vma size calculations

2013-07-26 Thread David Herrmann
mmap failure reported by Sedat Dilek in: Re: linux-next: Tree for Jul 25 [ call-trace: drm | drm-intel related? ] Cc: Sedat Dilek Cc: Daniel Vetter Cc: Chris Wilson Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH v2] drm/gem: fix mmap vma size calculations

2013-07-26 Thread David Herrmann
: 0de23977cfeb5b357ec884ba15417ae118ff9e9b "drm/gem: convert to new unified vma manager" Fixes i915 gtt mmap failure reported by Sedat Dilek in: Re: linux-next: Tree for Jul 25 [ call-trace: drm | drm-intel related? ] Cc: Daniel Vetter Cc: Chris Wilson Signed-off-by: David Herrmann Reported-by: Sedat Dilek Tested

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

2012-04-01 Thread David Herrmann
Hi On Wed, Mar 28, 2012 at 8:14 PM, Ville Syrj?l? wrote: > On Wed, Mar 28, 2012 at 10:30:20AM -0700, Jesse Barnes wrote: >> On Tue, 27 Mar 2012 16:57:29 +0200 >> David Herrmann wrote: >> >> > Hi >> > >> > Motivated by Jesse's letter to

<    1   2   3   4   5   6   7   8   9   10   >