From: Ville Syrjälä Date: Wed, 15 Feb 2012 13:02:39 +0000 (+0200) Subject: gfx: drv: Move flip trace commands into psb_fb X-Git-Tag: 2.1b_release~293 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63a77d46d725692e68ca871bf2ebdaf913f15b4e;p=kernel%2Fkernel-mfld-blackbay.git gfx: drv: Move flip trace commands into psb_fb The overlay code also manipulates sync object counters these days. Instead of duplicating the same tracing code in two places, move the code to the place where the sync counters are actually manipulated. Signed-off-by: Ville Syrjälä Reviewed-by: Imre Deak Signed-off-by: Kirill A. Shutemov --- diff --git a/drivers/staging/mrst/drv/mdfld_overlay.c b/drivers/staging/mrst/drv/mdfld_overlay.c index 572b9fe..50d75c5 100644 --- a/drivers/staging/mrst/drv/mdfld_overlay.c +++ b/drivers/staging/mrst/drv/mdfld_overlay.c @@ -1858,6 +1858,7 @@ struct drm_flip *mdfld_overlay_atomic_flip(struct drm_plane *plane, int pipe) oflip->vblank_ref = false; psb_fb_increase_read_ops_pending(oflip->old_mem_info); + psb_fb_flip_trace(oflip->old_mem_info, oflip->mem_info); /* we must pipeline the register changes */ memcpy(&oflip->regs, &ovl->regs, sizeof ovl->regs); diff --git a/drivers/staging/mrst/drv/psb_fb.c b/drivers/staging/mrst/drv/psb_fb.c index daff361..633ac81 100644 --- a/drivers/staging/mrst/drv/psb_fb.c +++ b/drivers/staging/mrst/drv/psb_fb.c @@ -43,6 +43,7 @@ #include "mdfld_dsi_dbi.h" #include "mdfld_dsi_output.h" #include "mdfld_output.h" +#include "pvr_trace_cmd.h" extern struct mutex gPVRSRVLock; @@ -847,4 +848,24 @@ psb_fb_increase_read_ops_completed(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo) if (psKernelMemInfo && psKernelMemInfo->psKernelSyncInfo) psKernelMemInfo->psKernelSyncInfo ->psSyncData->ui32ReadOpsComplete++; + + pvr_trcmd_check_syn_completions(PVR_TRCMD_FLPCOMP); +} + +void +psb_fb_flip_trace(PVRSRV_KERNEL_MEM_INFO *old, PVRSRV_KERNEL_MEM_INFO *new) +{ + struct pvr_trcmd_flpreq *fltrace; + + fltrace = pvr_trcmd_reserve(PVR_TRCMD_FLPREQ, task_tgid_nr(current), + current->comm, sizeof(*fltrace)); + if (old && old->psKernelSyncInfo) + pvr_trcmd_set_syn(&fltrace->old_syn, old->psKernelSyncInfo); + else + pvr_trcmd_clear_syn(&fltrace->old_syn); + if (new && new->psKernelSyncInfo) + pvr_trcmd_set_syn(&fltrace->new_syn, new->psKernelSyncInfo); + else + pvr_trcmd_clear_syn(&fltrace->new_syn); + pvr_trcmd_commit(fltrace); } diff --git a/drivers/staging/mrst/drv/psb_fb.h b/drivers/staging/mrst/drv/psb_fb.h index faa393e..ac06c3b 100644 --- a/drivers/staging/mrst/drv/psb_fb.h +++ b/drivers/staging/mrst/drv/psb_fb.h @@ -64,5 +64,8 @@ void psb_fb_gtt_unref(struct drm_device *dev, void psb_fb_increase_read_ops_pending(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo); void psb_fb_increase_read_ops_completed(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo); +void psb_fb_flip_trace(PVRSRV_KERNEL_MEM_INFO *old, + PVRSRV_KERNEL_MEM_INFO *new); + #endif diff --git a/drivers/staging/mrst/drv/psb_page_flip.c b/drivers/staging/mrst/drv/psb_page_flip.c index 3ed6f41..ab0eca7 100644 --- a/drivers/staging/mrst/drv/psb_page_flip.c +++ b/drivers/staging/mrst/drv/psb_page_flip.c @@ -29,7 +29,6 @@ #include "psb_intel_reg.h" #include "psb_page_flip.h" #include "psb_pvr_glue.h" -#include "pvr_trace_cmd.h" #include "mdfld_output.h" #include "mdfld_dsi_output.h" @@ -252,7 +251,6 @@ static void crtc_flip_complete(struct drm_flip *flip) drm_vblank_put(dev, pipe); psb_fb_increase_read_ops_completed(crtc_flip->old_mem_info); - pvr_trcmd_check_syn_completions(PVR_TRCMD_FLPCOMP); PVRSRVScheduleDeviceCallbacks(); } @@ -444,7 +442,6 @@ psb_intel_crtc_page_flip(struct drm_crtc *crtc, struct psb_fpriv *priv; struct psb_fbdev *fbdev = NULL; unsigned long flags; - struct pvr_trcmd_flpreq *fltrace; u32 tgid = psb_get_tgid(); int ret; int pipe = to_psb_intel_crtc(crtc)->pipe; @@ -498,16 +495,7 @@ psb_intel_crtc_page_flip(struct drm_crtc *crtc, new_pending_flip->old_mem_info = current_fb_mem_info; psb_fb_increase_read_ops_pending(current_fb_mem_info); - - fltrace = pvr_trcmd_reserve(PVR_TRCMD_FLPREQ, task_tgid_nr(current), - current->comm, sizeof(*fltrace)); - if (current_fb_mem_info && current_fb_mem_info->psKernelSyncInfo) - pvr_trcmd_set_syn(&fltrace->old_syn, - current_fb_mem_info->psKernelSyncInfo); - else - pvr_trcmd_clear_syn(&fltrace->old_syn); - pvr_trcmd_set_syn(&fltrace->new_syn, new_fb_mem_info->psKernelSyncInfo); - pvr_trcmd_commit(fltrace); + psb_fb_flip_trace(current_fb_mem_info, psbfb->pvrBO); new_pending_flip->tgid = tgid;