[Intel-gfx] [PATCH] Initialize flip_count before using it

Jesse Barnes jbarnes at virtuousgeek.org
Mon Mar 22 19:30:27 CET 2010


On Sat, 20 Mar 2010 00:21:48 +0800
Li Peng <peng.li at linux.intel.com> wrote:

> Otherwise it would be a random value and drmmode_page_flip_handler()
> won't have a chance to call I830DRI2FlipEventHandler() and indicate
> a full page flip is complete.
> 
> Signed-off-by: Li Peng <peng.li at intel.com>
> ---
>  src/drmmode_display.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index ae200ca..0172a2e 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -1464,6 +1464,7 @@ Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp)
>  		xf86DrvMsg(scrn->scrnIndex, X_INFO,
>  			   "Kernel page flipping support detected, enabling\n");
>  		intel->use_pageflipping = TRUE;
> +		drmmode->flip_count = 0;
>  		drmmode->event_context.version = DRM_EVENT_CONTEXT_VERSION;
>  		drmmode->event_context.vblank_handler = drmmode_vblank_handler;
>  		drmmode->event_context.page_flip_handler =

Ouch, good catch.  Why don't we use calloc for our drmmode structure?
We seem to use it everywhere else...

-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the Intel-gfx mailing list