Re: [Intel-gfx] [PATCH 1/3] drm: Export routines for inserting preallocated nodes into the mm manager

2012-12-12 Thread Jani Nikula
On Fri, 07 Dec 2012, Chris Wilson wrote: > Required by i915 in order to avoid the allocation in the middle of > manipulating the drm_mm lists. > > Use a pair of stubs to preserve the existing EXPORT_SYMBOLs for > backporting; to be removed later. Regardless of whether you choose to do anything ab

Re: [Intel-gfx] [PATCH 2/3] drm/i915: Preallocate the drm_mm_node prior to manipulating the GTT drm_mm manager

2012-12-12 Thread Jani Nikula
On Fri, 07 Dec 2012, Chris Wilson wrote: > As we may reap neighbouring objects in order to free up pages for > allocations, we need to be careful not to allocate in the middle of the > drm_mm manager. To accomplish this, we can simply allocate the > drm_mm_node up front and then use the combined s

Re: [Intel-gfx] [PATCH 2/3] drm/i915: Preallocate the drm_mm_node prior to manipulating the GTT drm_mm manager

2012-12-12 Thread Chris Wilson
On Wed, 12 Dec 2012 12:18:35 +0200, Jani Nikula wrote: > On Fri, 07 Dec 2012, Chris Wilson wrote: > > As we may reap neighbouring objects in order to free up pages for > > allocations, we need to be careful not to allocate in the middle of the > > drm_mm manager. To accomplish this, we can simpl

Re: [Intel-gfx] [PATCH 3/3] drm/i915: Preallocate mm node for GTT mmap offset

2012-12-12 Thread Jani Nikula
On Fri, 07 Dec 2012, Chris Wilson wrote: > As the shrinker may be invoked for the allocation, and it may reap > neighbouring objects in the offset range mm, we need to be careful in > the order in which we allocate the node, search for free space and then > insert the node into the mmap offset ran

Re: [Intel-gfx] [PATCH 3/3] drm/i915: Preallocate mm node for GTT mmap offset

2012-12-12 Thread Chris Wilson
On Wed, 12 Dec 2012 12:48:43 +0200, Jani Nikula wrote: > On Fri, 07 Dec 2012, Chris Wilson wrote: > > As the shrinker may be invoked for the allocation, and it may reap > > neighbouring objects in the offset range mm, we need to be careful in > > the order in which we allocate the node, search f

[Intel-gfx] [PATCH 00/37] [RFC] revamped modeset locking

2012-12-12 Thread Daniel Vetter
Hi all, First thing first: It works, I now no longer have a few dropped frames every 10s on my testbox here with the pageflip i-g-t tests. Random notes: - New design has per-crtc locks to protect the crtc input-side (pageflip, cursor) for r/w and the output state of the crtc (mode, dpms) as re

[Intel-gfx] [PATCH 01/37] drm: review locking rules in drm_crtc.c

2012-12-12 Thread Daniel Vetter
- config_cleanup was confused: It claimed that callers need to hold the modeset lock, but the connector|encoder_cleanup helpers grabbed that themselves (note that crtc_cleanup did _not_ grab the modeset lock). Which resulted in all drivers _not_ hodling the lock. Since this is for single-th

[Intel-gfx] [PATCH 02/37] drm/doc: integrate drm_crtc.c kerneldoc

2012-12-12 Thread Daniel Vetter
And do a quick pass to adjust them to the last few (years?) of changes ... This time actually compile-tested ;-) Signed-off-by: Daniel Vetter --- Documentation/DocBook/drm.tmpl |4 ++ drivers/gpu/drm/drm_crtc.c | 92 +++- 2 files changed, 48 inserti

[Intel-gfx] [PATCH 03/37] drm: add drm_modeset_lock|unlock_all

2012-12-12 Thread Daniel Vetter
This is the first step towards introducing the new modeset locking scheme. The plan is to put helper functions into place at all the right places step-by-step, so that the final patch to switch on the new locking scheme doesn't need to touch every single driver. This helper here will serve as the

[Intel-gfx] [PATCH 04/37] drm/i915: rework locking for intel_dpio|sbi_read|write

2012-12-12 Thread Daniel Vetter
Spinning for up to 200 us with interrupts locked out is not good. So let's just spin (and even that seems to be excessive). And we don't call these functions from interrupt context, so this is not required. Besides that doing anything in interrupt contexts which might take a few hundred us is a no

[Intel-gfx] [PATCH 05/37] drm/i915: use drm_modeset_lock_all

2012-12-12 Thread Daniel Vetter
Two exceptions: - debugfs files only read information which is not related to crtc, so can stay on the modeset_config lock. - Same holds for the edp vdd work in intel_dp.c. Add a corresponding WARN_ON and a comment next to the intel_dp struct fields for documentation. Signed-off-by: Daniel V

[Intel-gfx] [PATCH 06/37] drm/gma500: use drm_modeset_lock_all

2012-12-12 Thread Daniel Vetter
Only two places: - suspend/resume - Some really strange mode validation tool with too much funny-lucking hand-rolled conversion code. Better safe than sorry, so convert both places to keep the locking semantics as much as possible. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/gma500/psb_d

[Intel-gfx] [PATCH 07/37] drm/ast: use drm_modeset_lock_all

2012-12-12 Thread Daniel Vetter
Just a call to drm_helper_resume_force_mode, obviously wants full locking for that. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/ast/ast_drv.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index 31123b

[Intel-gfx] [PATCH 08/37] drm/shmobile: use drm_modeset_lock_all

2012-12-12 Thread Daniel Vetter
Only a resume method to account for. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/shmobile/shmob_drm_drv.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index 1c350fc..e77f255 10

[Intel-gfx] [PATCH 09/37] drm/vmgfx: use drm_modeset_lock_all

2012-12-12 Thread Daniel Vetter
Ok, this one here is a bit more complicated, but for an RFC I've figured I can be a bit sloppy. So just convert ever mutex_lock call, including the interruptible one. Since other places (e.g. in the execbuf ioctl) take the mode_config.mutex without bothering with interruptible handling, I've figure

[Intel-gfx] [PATCH 10/37] drm: add per-crtc locks

2012-12-12 Thread Daniel Vetter
*drumroll* The basic idea is to protect per-crtc state which can change without touching the output configuration with separate mutexes, i.e. all the input side state to a crtc like framebuffers, cursor settings or plane configuration. Holding such a crtc lock gives a read-lock on all the other c

[Intel-gfx] [PATCH 17/37] drm: revamp locking around fb creation/destruction

2012-12-12 Thread Daniel Vetter
Well, at least step 1. The goal here is that framebuffer objects can survive outside of the mode_config lock, with just a reference held as protection. The first step to get there is to introduce a special fb_lock which protects fb lookup, creation and destruction, to make them appear atomic. This

[Intel-gfx] [PATCH 36/37] drm: only grab the crtc lock for pageflips

2012-12-12 Thread Daniel Vetter
The pagelip ioctl itself is rather simply, so the hard work for this patch is auditing all the drivers: - exynos: Pageflip is protect with dev->struct_mutex and ... synchronous. But nothing fancy going on, besides a check whether the crtc is enabled, which should probably be somewhere in the d

[Intel-gfx] [PATCH 37/37] drm: don't hold crtc mutexes for connector ->detect callbacks

2012-12-12 Thread Daniel Vetter
The coup de grace of the entire journey. No more dropped frames every 10s on my testbox! I've tried to audit all ->detect and ->get_modes callbacks, but things became a bit fuzzy after trying to piece together the umpteenth implemenation. Afaict most drivers just have bog-standard output register

[Intel-gfx] [PATCH 25/37] drm: don't take modeset locks in getfb ioctl

2012-12-12 Thread Daniel Vetter
We only need to push the fb unreference a bit down. While at it, properly pass the return value from ->create_handle back to userspace. Most drivers either return -ENODEV if they don't have a concept of buffer objects (ast, cirrus, ...) or just install a handle for the underlying gem object (which

[Intel-gfx] [PATCH 34/37] drm/ttm: fix fence locking in ttm_buffer_object_transfer

2012-12-12 Thread Daniel Vetter
Noticed while reviewing the fence locking in the radone pageflip handler. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/ttm/ttm_bo_util.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index b9c4e51..5c8b207 1006

[Intel-gfx] [PATCH 13/37] drm/nouveau: protect evo_wait/evo_kick sections with a channel mutex

2012-12-12 Thread Daniel Vetter
With per-crtc locks modeset operations can run in parallel, and the cursor code uses the device-global evo master channel for hw frobbing. But the pageflip code can also sync with the master under some circumstances. Hence just wrap things up in a mutex to ensure that pushbuf access doesn't intermi

[Intel-gfx] [PATCH 31/37] drm/vmwgfx: add proper framebuffer refcounting

2012-12-12 Thread Daniel Vetter
Afact vmwgfx already has all the right refcounting implemented on the backing storage, and we only need to ensure that the drm fb doesn't disappear untimely. So holding onto the fb reference from _lookup until vmw_kms_present has completed should be enough. Signed-off-by: Daniel Vetter --- drive

[Intel-gfx] [PATCH 18/37] drm: create drm_framebuffer_lookup

2012-12-12 Thread Daniel Vetter
And replace all fb lookups with it. Also add a WARN to drm_mode_object_find since that is now no longer the blessed interface to look up an fb. And add kerneldoc to both functions. This only updates all callsites, but immediately drops the acquired refence again. Hence all callers still rely on th

[Intel-gfx] [PATCH 19/37] drm/gma500: move fbcon restore to lastclose

2012-12-12 Thread Daniel Vetter
Doing this within the fb->destroy callback leads to a locking nightmare. And all other drm drivers that restore the fbcon do it in lastclose, too. With this adjustments all fb->destroy callbacks optionally drop references to any gem objects used as backing storage, call drm_framebuffer_cleanup and

[Intel-gfx] [PATCH 27/37] drm: refcounting for sprite framebuffers

2012-12-12 Thread Daniel Vetter
Now plane->fb holds a reference onto it's framebuffer. Nothing too fancy going on here: - Extract __drm_framebuffer_unreference to be called when we know we're not dropping the last reference, e.g. useful in the fb cleanup code. - Reduce the locked sections in the set_plane ioctl to only protec

[Intel-gfx] [PATCH 24/37] drm: push modeset_lock_all into ->fb_create driver callbacks

2012-12-12 Thread Daniel Vetter
And drop it where it's not needed. Most driver just lookup the gem object, allocate an fb struct, fill in all the useful fields and then register it with drm_framebuffer_init. All of these operations are already separately locked, and since we only put the fb into the fpriv->fbs list _after_ havin

[Intel-gfx] [PATCH 23/37] drm/i915: fixup overlay stolen memory leak

2012-12-12 Thread Daniel Vetter
We need to clean up the overlay first, before taking down the stolen memory allocator. This regression has been introducec in commit 8040513870399f1cb032cb8bc805df5042fedcdf Author: Chris Wilson Date: Thu Nov 15 11:32:29 2012 + drm/i915: Allocate overlay registers from stolen memory

[Intel-gfx] [PATCH 32/37] drm: optimize drm_framebuffer_remove

2012-12-12 Thread Daniel Vetter
Now that all framebuffer usage is properly refcounted, we are no longer required to hold the modeset locks while dropping the last reference. Hence implemented a fastpath which avoids the potential stalls associated with grabbing mode_config.lock for the case where there's no other reference around

[Intel-gfx] [PATCH 15/37] drm: only take the crtc lock for ->cursor_move

2012-12-12 Thread Daniel Vetter
->cursor_move uses mostly the same facilities in drivers as ->cursor_set, so pretty much nothing to fix up: - ast/gma500/i915: They all use per-crtc registers to update the cursor position. ast again touches the global cursor cache, but that's ok since there's only one crtc. - nouveau: nv50+

[Intel-gfx] [PATCH 30/37] drm/i915: dump refcount into framebuffer debugfs file

2012-12-12 Thread Daniel Vetter
Useful for checking whether the new refcounting works as advertised. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_debugfs.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c in

[Intel-gfx] [PATCH 29/37] drm: refcounting for crtc framebuffers

2012-12-12 Thread Daniel Vetter
With the prep patch to encapsulate ->set_crtc calls, this is now rather easy. Hooray for inconsistent semantics between ->set_crtc and ->page_flip, where the driver callback is supposed to update the fb pointer, and ->update_plane, where the drm core does the same. Also, since the drm core functio

[Intel-gfx] [PATCH 14/37] drm: only take the crtc lock for ->cursor_set

2012-12-12 Thread Daniel Vetter
First convert ->cursor_set to only take the crtc lock, since that seems to be the function with the least amount of state - the core ioctl function doesn't check anything which can change at runtime, so we don't have any object lifetime issues to contend. The only thing which is important is that

[Intel-gfx] [PATCH 35/37] drm/radeon: fix fence locking in the pageflip callback

2012-12-12 Thread Daniel Vetter
We need to hold bdev->fence_lock while grabbing a reference to the fence, to prevent concurrent clearing/changing of the ttm_bo->sync_obj field. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/radeon/radeon_display.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/rad

[Intel-gfx] [PATCH 16/37] drm/: reorder framebuffer init sequence

2012-12-12 Thread Daniel Vetter
With more fine-grained locking we can no longer rely on the big mode_config lock to prevent concurrent access to mode resources like framebuffers. Instead a framebuffer becomes accessible to other threads as soon as it is added to the relevant lookup structures. Hence it needs to be fully set up by

[Intel-gfx] [PATCH 11/37] drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesss

2012-12-12 Thread Daniel Vetter
Just refactoring to make the next patche simpler. Now all indirect register access in the new modesetting driver should go through the r100_mm_(w|r)reg fucntions. RADEON_READ_MM from the old driver seems to be totally unused, so just kill it. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/rad

[Intel-gfx] [PATCH 20/37] drm: revamp framebuffer cleanup interfaces

2012-12-12 Thread Daniel Vetter
We have two classes of framebuffer - Created by the driver (atm only for fbdev), and the driver holds onto the last reference count until destruction. - Created by userspace and associated with a given fd. These framebuffers will be reaped when their assoiciated fb is closed. Now these two cas

[Intel-gfx] [PATCH 12/37] drm/radeon: make indirect register access concurrency-safe

2012-12-12 Thread Daniel Vetter
With the new per-crtc locking mutliple set-cursor calls could happen in parallel. Out of sheer paranoia I've opted for an irqsave spinlock. But if there's indeed an access from interrupt contexts to these regs it's already broken with the old code, so this can likely just be reduced to a normal spi

[Intel-gfx] [PATCH 33/37] drm/nouveau: try to protect nbo->pin_refcount

2012-12-12 Thread Daniel Vetter
... by moving the bo_pin/bo_unpin manipulation of the pin_refcount under the protection of the ttm reservation lock. pin/unpin seems to get called from all over the place, so atm this is completely racy. After this patch there are only a few places in cleanup functions left which access ->pin_refc

[Intel-gfx] [PATCH 26/37] drm: fb refcounting for dirtyfb_ioctl

2012-12-12 Thread Daniel Vetter
We only need to ensure that the fb stays around for long enough. While at it, only grab the modeset locks when we need them (since most drivers don't implement the dirty callback, this should help jitter and stalls when using the generic modeset driver). Signed-off-by: Daniel Vetter --- drivers/

[Intel-gfx] [PATCH 21/37] drm: reference framebuffers which are on the idr

2012-12-12 Thread Daniel Vetter
Since otherwise looking and reference-counting around drm_framebuffer_lookup will be an unmanageable mess. With this change, an object can either be found in the idr and will stay around once we incremented the reference counter. Or it will be gone for good and can't be looked up using its id any m

[Intel-gfx] [PATCH 22/37] drm: nest modeset locks within fpriv->fbs_lock

2012-12-12 Thread Daniel Vetter
Atm we still need to unconditionally take the modeset locks in the rmfb paths. But eventually we only want to take them if there are other users around as a slow-path. This way sane userspace avoids blocking on edid reads and other stuff in rmfb if it ensures that the fb isn't used anywhere by a cr

[Intel-gfx] [PATCH 28/37] drm: encapsulate crtc->set_config calls

2012-12-12 Thread Daniel Vetter
With refcounting we need to adjust framebuffer refcounts at each callsite - much easier to do if they all call the same little helper function. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc.c | 19 +-- drivers/gpu/drm/drm_fb_helper.c|6 +++---

[Intel-gfx] [PATCH] tests/gem_seqno_wrap: dont sync when crossing half of seqno space

2012-12-12 Thread Mika Kuoppala
For seqno comparison to work they have to be less than UINT32_MAX/2 apart. So when crossing the half way of seqno space, be careful not to sync anything as this causes gpu hangs. Do real test with syncing only when we are about to wrap. --- tests/gem_seqno_wrap.c | 161 +++

Re: [Intel-gfx] [PATCH 00/37] [RFC] revamped modeset locking

2012-12-12 Thread Daniel Vetter
On Wed, Dec 12, 2012 at 02:06:40PM +0100, Daniel Vetter wrote: > Hi all, > > First thing first: It works, I now no longer have a few dropped frames every > 10s > on my testbox here with the pageflip i-g-t tests. > > Random notes: > > - New design has per-crtc locks to protect the crtc input-sid

Re: [Intel-gfx] [PATCH 34/37] drm/ttm: fix fence locking in ttm_buffer_object_transfer

2012-12-12 Thread Daniel Vetter
On Wed, Dec 12, 2012 at 3:48 PM, Jerome Glisse wrote: > Instead of that i would just move the call to > ttm_buffer_object_transfer to happen before releasing the fence_lock > in ttm_bo_move_accel_cleanup , something like : Yeah, looks better. Fixed up locally. -Daniel -- Daniel Vetter Software E

[Intel-gfx] gfx context switch

2012-12-12 Thread Zhang, Xiong Y
Hi, all: When gfx executes batch buffer in render ring buffer, it will do context switch . Since only when the previous batch buffer has finished, the next batch buffer can start. the batch buffer is executed in order. So I think there is no need to do context switch. Why i915 driver introduc

[Intel-gfx] [PATCH 00/81] drm/i915: Atomic mode setting / page flip, yet again

2012-12-12 Thread ville . syrjala
Another month, another massive atomic patchset. I managed to clean up warts left over from the modeset-rework rebase, but other than that I haven't really found the time to touch this too much since the last time I posted patches from this set. Seeing as my schedule isn't getting any less busy in

[Intel-gfx] [PATCH 01/81] drm: Add struct drm_region and assorted utility functions

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä struct drm_region represents a two dimensional region. The utility functions are there to help driver writers. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 155 include/drm/drm_crtc.h | 24 +++ 2 files

[Intel-gfx] [PATCH 02/81] drm: Add drm_calc_{hscale, vscale}() utility functions

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 102 include/drm/drm_crtc.h |4 ++ 2 files changed, 106 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c ind

[Intel-gfx] [PATCH 03/81] drm: Keep a copy of last plane coordinates

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä If the update_plane() operation succeeds, make a copy of the requested src and crtc coordinates, so that the the plane may be reclipped if the display mode changed later. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c |8 include/drm/drm_crtc.h

[Intel-gfx] [PATCH 04/81] drm: Add restore_fbdev_mode() hook to drm_fb_helper

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Add an optional driver specific restore_fbdev_mode() hook to drm_fb_helper. If the driver doesn't provide the hook, drm_fb_helper_restore_fbdev_mode() is called directly as before. In this hook the driver can disable additional planes, cursors etc. that shouldn't be visible w

[Intel-gfx] [PATCH 05/81] drm: Export drm_property_create_blob() and drm_property_destroy_blob()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c |8 +--- include/drm/drm_crtc.h |4 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 3164131..38b8ce3 100644 --- a/dri

[Intel-gfx] [PATCH 06/81] drm: Allow signed values for range properties

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Treat a range property as signed when the unsigned minimum value is larger than the unsigned maximum value. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 17 ++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/

[Intel-gfx] [PATCH 07/81] drm: Allow drm_mode_object_find() to look up an object of any type

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä To avoid having to pass object types from userspace for atomic mode setting ioctl, allow drm_mode_object_find() to look up an object of any type. This will only work as long as the all object types share the ID space. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crt

[Intel-gfx] [PATCH 08/81] drm: Export drm_encoder_crtc_ok

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä --- drivers/gpu/drm/drm_crtc_helper.c |5 +++-- include/drm/drm_crtc_helper.h |3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 7b2d378..0d62c94 100644 --- a/drivers/

[Intel-gfx] [PATCH 09/81] drm: Export drm_crtc_prepare_encoders()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä --- drivers/gpu/drm/drm_crtc_helper.c |3 ++- include/drm/drm_crtc_helper.h |1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 0d62c94..30eb557 100644 --- a/drivers/gpu/

[Intel-gfx] [PATCH 10/81] drm: Refactor object property check code

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Refactor the code to check whether an object has a specific property to a new function. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 20 ++-- 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/driv

[Intel-gfx] [PATCH 11/81] drm: Export mode<->umode conversion functions

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Export drm_crtc_convert_to_umode() and drm_crtc_convert_umode(). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 10 ++ include/drm/drm_crtc.h |4 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c

[Intel-gfx] [PATCH 12/81] drm: Make blobs resizeable

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä When first allocated blobs can be given a maximum size for which memory is allocated. Later the data inside the blob can be replaced, assuming that the maximum size is not exceeded. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 45 +

[Intel-gfx] [PATCH 13/81] drm: Add drm_flip helper

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä The drm_flip mechanism can be used to implement robust page flipping support, and also to synchronize the flips on multiple hardware scanout engines (eg. CRTCs and overlays). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/Makefile |2 +- drivers/gpu/drm/drm_flip.c |

[Intel-gfx] [PATCH 15/81] drm: Add the atomic modeset ioctl

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä This new ioctl can be used to update an arbitrary set of object properties in one operation. The ioctl simply takes a list of object IDs and property IDs and their values. For setting values of blob properties, the property value indicates the length of the data, and the actu

[Intel-gfx] [PATCH 14/81] drm: Add mode_blob and connector_ids_blob to drm_crtc

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä These will be ued by standard properties MODE and CONNECTOR_IDS. Signed-off-by: Ville Syrjälä --- include/drm/drm_crtc.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 5b8b1b7..d05d302 100644

[Intel-gfx] [PATCH 16/81] drm/i915: Use drm_format_plane_cpp() rather than bits_per_pixel/8

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä bits_per_pixel may not be populated for all pixel formats, so let's just use drm_format_plane_cpp(). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i91

[Intel-gfx] [PATCH 17/81] drm/i915: Implement proper clipping for video sprites

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Properly clip the source when the destination gets clipped by the pipe dimensions. Sadly the video sprite hardware is rather limited so it can't do proper sub-pixel postitioning. Resort to a best effort approach, where the source coordinates are rounded to the nearest (macro)

[Intel-gfx] [PATCH 18/81] drm/i915: Implement restore_fbdev_mode hook

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Convert intel_fb_restore_mode to be useable as the drm_fb_helper.restore_fbdev_mode hook. This will cause all planes to be disabled when swithing back to fbcon. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_dma.c |2 +- drivers/gpu/drm/i915/intel_drv.h |

[Intel-gfx] [PATCH 19/81] drm/i915: Split clipping and checking from update_plane hook

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Split the update_plane() codepath into two separate steps. The first step checkis and clips the plane, and the second step actually commits the changes to the hardware. This allows the atomic modesetting code to perform all checks before clobering hardware state. The update_p

[Intel-gfx] [PATCH 20/81] drm/i915: Factor out i9xx_compute_clocks() like ironlake_compute_clocks()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Split the clock stuff out. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 128 -- 1 files changed, 75 insertions(+), 53 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_di

[Intel-gfx] [PATCH 21/81] drm/i915: Consitify adjusted_mode parameter

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä i9xx_adjust_sdvo_tv_clock(), i9xx_compute_clocks() and ironlake_compute_clocks() do not modify the adjusted_mode passed in, so pass it as const. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletion

[Intel-gfx] [PATCH 23/81] drm/i915: store cursor_handle in struct intel_crtc

2012-12-12 Thread ville . syrjala
From: Ander Conselvan de Oliveira This way it is possible to check if the cursor changed without doing any setup. Will be useful for the atomic modesetting api. --- drivers/gpu/drm/i915/intel_display.c |1 + drivers/gpu/drm/i915/intel_drv.h |2 +- 2 files changed, 2 insertions(+), 1

[Intel-gfx] [PATCH 24/81] drm/i915: split cursor setting code into prepare/commit/unref parts

2012-12-12 Thread ville . syrjala
From: Ander Conselvan de Oliveira The atomic mode setting API will need to pin the cursor bo without making changes to the current setup. Only on a later stage the cursor registers can be written and the previous bo released. This patch splits intel_crtc_cursor_set() into three parts: prepare, c

[Intel-gfx] [PATCH 25/81] drm/i915: unstatic cursor functions for use with atomic modesetting

2012-12-12 Thread ville . syrjala
From: Ander Conselvan de Oliveira --- drivers/gpu/drm/i915/intel_display.c | 24 drivers/gpu/drm/i915/intel_drv.h | 13 + 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/int

[Intel-gfx] [PATCH 26/81] drm/i915: Unstatic intel_finish_fb()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä intel_finish_fb() will be used by the atomic modeset code, so make it non-static. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |2 +- drivers/gpu/drm/i915/intel_drv.h |1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/d

[Intel-gfx] [PATCH 22/81] drm/i915: Add intel_check_clock()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä intel_check_clock() can be used to check clock validity w/o modifying hardware state. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_drv.h |2 ++ drivers/gpu/drm/i915/intel_display.c | 34 ++ 2 files changed, 36 inserti

[Intel-gfx] [PATCH 29/81] drm/i915: Unstatic intel_crtc_update_sarea_pos()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Make intel_crtc_update_sarea_pos() available to the atomic mode setting code. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |2 +- drivers/gpu/drm/i915/intel_drv.h |1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drive

[Intel-gfx] [PATCH 28/81] drm/i915: Unstatic intel_crtc_update_sarea()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Make intel_crtc_update_sarea() available for the atomic mode setting code. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |4 ++-- drivers/gpu/drm/i915/intel_drv.h |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drive

[Intel-gfx] [PATCH 30/81] drm/i915: Constify mode argument to intel_modeset_adjusted_mode()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä intel_modeset_adjusted_mode() doesn't modify the passed display mode. So pass it as const. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b

[Intel-gfx] [PATCH 31/81] drm/i915: Unstatic intel_crtc_mode_fixup()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Make intel_crtc_mode_fixup() available for the upcoming atomic modesetting code. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |6 +++--- drivers/gpu/drm/i915/intel_drv.h |4 2 files changed, 7 insertions(+), 3 deletions(-) diff --g

[Intel-gfx] [PATCH 32/81] drm/i915: Introduce intel_plane_regs

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä intel_plane_regs can be used to shadow all the typical plane registers. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_drv.h | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/dr

[Intel-gfx] [PATCH 27/81] drm/i915: Pull intel_pipe_set_base() out of the crtc_mode_set() functions

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä intel_pipe_set_base() (un)pins the buffers, so it can't be called from the atomic modeset paths. Pull the intel_pipe_set_base() and watermark modifications out of i9xx_crtc_mode_set() and ironlake_crtc_mode_set() into intel_crtc_mode_set(), so that the former two can be used f

[Intel-gfx] [PATCH 34/81] drm/i915: Split sprite update_plane() into calc+commit phases

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Separate the part that calculates the register values from the part that writes the registers. This will be useful in the atomic page flip code. Also move the watermark magic into a prepare function that can be performed outside the critical parts of the atomic page flip code.

[Intel-gfx] [PATCH 36/81] drm/i915: Add support for atomic modesetting completion events

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Send completion events when the atomic modesetting operations has finished succesfully. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 195 ++- 1 files changed, 192 insertions(+), 3 deletions(-) diff --git a/drivers/

[Intel-gfx] [PATCH 37/81] drm/i915: Add atomic page flip support

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Add support for the DRM_MODE_ATOMIC_NONBLOCK flag. The drm_flip helper provides the necessary logic to track the progress of the flips. drm_flip is driven by a few extra calls from the interrupt handling and crtc_disable code paths. Since the hardware doesn't provide inter-p

[Intel-gfx] [PATCH 38/81] drm/i915: Unstatic intel_enable_primary() and intel_disable_primary()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä intel_enable_primary() and intel_disable_primary() are needed in the atomic mode setting code. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_drv.h|3 +++ drivers/gpu/drm/i915/intel_sprite.c |4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)

[Intel-gfx] [PATCH 33/81] drm/i915: Split primary plane update_plane() into calc+commit phases

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Separate the part that calculates the register values from the part that writes the registers. This will be useful in the atomic page flip code. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_drv.h |3 + drivers/gpu/drm/i915/intel_display.c | 154 +

[Intel-gfx] [PATCH 39/81] drm/i915: Respect primary_disabled in crtc_enable()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Check primary_disabled state before enabling the primary plane in crtc_enable() hooks. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c

[Intel-gfx] [PATCH 40/81] drm/i915: Enable/disable primary plane in calc_plane()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Check the active and primary_disabled flags and set the DISPLAY_PLANE_ENABLE bit accordingly in calc_plane() hook for the primary plane. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-

[Intel-gfx] [PATCH 41/81] drm/i915: Add primary plane disable logic to atomic mode setting code

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Enable/disable the primary plane accordingly when the sprite plane coverage changes. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 41 +++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/

[Intel-gfx] [PATCH 42/81] drm: Add missing EXPORT_SYMBOL()s for drm_flip

2012-12-12 Thread ville . syrjala
From: Ander Conselvan de Oliveira --- drivers/gpu/drm/drm_flip.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_flip.c b/drivers/gpu/drm/drm_flip.c index 6ccc3f8..a20e6a4 100644 --- a/drivers/gpu/drm/drm_flip.c +++ b/drivers/gpu/drm/drm_fl

[Intel-gfx] [PATCH 45/81] drm/i915: Move standard properties under mode_config

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Standard connector properties are kept in the mode_config structure. Move the CRTC and plane properties there as well. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 293 +++ include/drm/drm_crtc.h | 19

[Intel-gfx] [PATCH 48/81] drm/i915: Update CRTC properties after modeset

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Update cursor related CRTC properties after a modeset. The cursor properties aren't handled by the drm core since not all CRTCs have cursors. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 15 +++ 1 files changed, 15 insertions(+), 0 d

[Intel-gfx] [PATCH 43/81] drm/i915: Clear flip helpers for sprites too

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Don't leave stale flips hanging around the sprites' flip helpers when the crtc is being disabled. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 15 +++ drivers/gpu/drm/i915/intel_display.c |4 ++-- drivers/gpu/drm/i915/intel_drv.h

[Intel-gfx] [PATCH 51/81] drm/i915: Unstatic intel_modeset_update_staged_output_state()

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä The atomic code needs intel_modeset_update_staged_output_state(). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |2 +- drivers/gpu/drm/i915/intel_drv.h |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/

[Intel-gfx] [PATCH 52/81] drm/i915: Update new_crtc and new_encoder fields after atomic modeset

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä The i915 modeset logic requires that these be kept in sync with the other crtc and encoder pointers. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ato

[Intel-gfx] [PATCH 47/81] drm: Update standard plane properties after update_plane/disable_plane

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Keep the new plane properties when doing operations through the legacy code paths. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc

[Intel-gfx] [PATCH 44/81] drm/i915: Refactor property handling in atomic code

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Move the property code around a bit to make it easier to move it out to the drm core later. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 423 --- drivers/gpu/drm/i915/intel_drv.h|3 + include/drm/drm_crtc.h

[Intel-gfx] [PATCH 54/81] drm/i915: Kill the pending_flip counter manipulations

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä The pending_flip counter is probably going to be remove entirely, along with i915_gem_execbuffer_wait_for_flips() so don't even try to use it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 74 +-- 1 files changed, 2

[Intel-gfx] [PATCH 49/81] drm: Move standard crtc/plane prop handling to drm_crtc.c

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Move some of the property code to drm_crtc.c since it should be shared by everyone. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 235 +++ drivers/gpu/drm/i915/intel_atomic.c | 256 --

[Intel-gfx] [PATCH 50/81] drm/i915: Use intel_best_encoder() directly

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä All connectors use intel_best_encoder() as their best_encoder() func, so just call it directly w/o the indirection. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_atomic.c | 10 ++ 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers

[Intel-gfx] [PATCH 46/81] drm_crtc_helper: Update standard crtc properties after modeset

2012-12-12 Thread ville . syrjala
From: Ville Syrjälä Keep the new CRTC properties when doing modeset through the legacy code paths. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc_helper.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/

  1   2   >