Skip to content

Commit

Permalink
drm/nouveau/fence: minor api changes for an upcoming rework
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed May 24, 2012
1 parent 875ac34 commit d375e7d
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 158 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/nouveau/nouveau_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "nouveau_dma.h"
#include "nouveau_mm.h"
#include "nouveau_vm.h"
#include "nouveau_fence.h"

#include <linux/log2.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -478,7 +479,7 @@ nouveau_bo_move_accel_cleanup(struct nouveau_channel *chan,
struct nouveau_fence *fence = NULL;
int ret;

ret = nouveau_fence_new(chan, &fence, true);
ret = nouveau_fence_new(chan, &fence);
if (ret)
return ret;

Expand Down Expand Up @@ -1196,7 +1197,7 @@ nouveau_bo_fence_ref(void *sync_obj)
static bool
nouveau_bo_fence_signalled(void *sync_obj, void *sync_arg)
{
return nouveau_fence_signalled(sync_obj);
return nouveau_fence_done(sync_obj);
}

static int
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "nouveau_drm.h"
#include "nouveau_dma.h"
#include "nouveau_ramht.h"
#include "nouveau_fence.h"
#include "nouveau_software.h"

static int
Expand Down Expand Up @@ -369,7 +370,7 @@ nouveau_channel_idle(struct nouveau_channel *chan)
nouveau_fence_update(chan);

if (chan->fence.sequence != chan->fence.sequence_ack) {
ret = nouveau_fence_new(chan, &fence, true);
ret = nouveau_fence_new(chan, &fence);
if (!ret) {
ret = nouveau_fence_wait(fence, false, false);
nouveau_fence_unref(&fence);
Expand Down
9 changes: 6 additions & 3 deletions drivers/gpu/drm/nouveau/nouveau_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "nouveau_connector.h"
#include "nouveau_software.h"
#include "nouveau_gpio.h"
#include "nouveau_fence.h"
#include "nv50_display.h"

static void
Expand Down Expand Up @@ -465,7 +466,7 @@ nouveau_page_flip_emit(struct nouveau_channel *chan,
}
FIRE_RING (chan);

ret = nouveau_fence_new(chan, pfence, true);
ret = nouveau_fence_new(chan, pfence);
if (ret)
goto fail;

Expand All @@ -486,7 +487,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
struct nouveau_bo *old_bo = nouveau_framebuffer(crtc->fb)->nvbo;
struct nouveau_bo *new_bo = nouveau_framebuffer(fb)->nvbo;
struct nouveau_page_flip_state *s;
struct nouveau_channel *chan;
struct nouveau_channel *chan = NULL;
struct nouveau_fence *fence;
int ret;

Expand All @@ -509,7 +510,9 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
new_bo->bo.offset };

/* Choose the channel the flip will be handled in */
chan = nouveau_fence_channel(new_bo->bo.sync_obj);
fence = new_bo->bo.sync_obj;
if (fence)
chan = nouveau_channel_get_unlocked(fence->channel);
if (!chan)
chan = nouveau_channel_get_unlocked(dev_priv->channel);
mutex_lock(&chan->mutex);
Expand Down
26 changes: 6 additions & 20 deletions drivers/gpu/drm/nouveau/nouveau_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1444,26 +1444,12 @@ extern int nouveau_bo_vma_add(struct nouveau_bo *, struct nouveau_vm *,
extern void nouveau_bo_vma_del(struct nouveau_bo *, struct nouveau_vma *);

/* nouveau_fence.c */
struct nouveau_fence;
extern int nouveau_fence_init(struct drm_device *);
extern void nouveau_fence_fini(struct drm_device *);
extern int nouveau_fence_channel_init(struct nouveau_channel *);
extern void nouveau_fence_channel_fini(struct nouveau_channel *);
extern void nouveau_fence_update(struct nouveau_channel *);
extern int nouveau_fence_new(struct nouveau_channel *, struct nouveau_fence **,
bool emit);
extern int nouveau_fence_emit(struct nouveau_fence *);
extern void nouveau_fence_work(struct nouveau_fence *fence,
void (*work)(void *priv, bool signalled),
void *priv);
struct nouveau_channel *nouveau_fence_channel(struct nouveau_fence *);

extern bool nouveau_fence_signalled(struct nouveau_fence *);
extern int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr);
extern void nouveau_fence_unref(struct nouveau_fence **);
extern struct nouveau_fence *nouveau_fence_ref(struct nouveau_fence *);
extern int nouveau_fence_sync(struct nouveau_fence *, struct nouveau_channel *);

int nouveau_fence_init(struct drm_device *);
void nouveau_fence_fini(struct drm_device *);
int nouveau_fence_channel_init(struct nouveau_channel *);
void nouveau_fence_channel_fini(struct nouveau_channel *);
void nouveau_fence_work(struct nouveau_fence *fence,
void (*work)(void *priv, bool signalled), void *priv);
/* nouveau_gem.c */
extern int nouveau_gem_new(struct drm_device *, int size, int align,
uint32_t domain, uint32_t tile_mode,
Expand Down
Loading

0 comments on commit d375e7d

Please sign in to comment.