From: chris Subject: Re:Re: nouveau page_flip function implement not wait vblank, which cause screen garbage Date: Tue, 25 Oct 2011 15:27:32 +0800 (CST) Message-ID: <74648aec.a942.13339fa1d99.Coremail.wwzbwwzb@163.com> References: <5cfc7b09.427d.13339186037.Coremail.wwzbwwzb@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from m13-84.163.com (m13-84.163.com [220.181.13.84]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B2639E81A for ; Tue, 25 Oct 2011 00:42:54 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Maarten Maathuis Cc: "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org It seems that nv04_graph_mthd_page_flip() was called from isr , and page_f= lip ioctl only send a NV_SW_PAGE_FLIP pushbuffer bo to gem. If you don't w= ant the screen show garbage you must make sure not to change frontbuffer or= backbuffer in GPU when nv_set_crtc_base() is called, and not change the = frontbuffer context when it is rendering, am I right? At 2011-10-25 13:45:29,"Maarten Maathuis" wrote: >2011/10/25 chris : >> Can anyone give a suggestion, is wait-vblank fully implemented in >> page_flip() for nouveau drm driver? >> >> >> At 2011-10-24 14:30:55,chris=A0 wrote: >> >> Dear, >> >> I use NVidia Geforce 7300GT graphics card in my PC, and Linux 3.1rc4 ker= nel >> code, git drm 2.4.36. >> =A0 When I run the vbltest program, it prints=A0 "60HZ"=A0 which indicat= ed the >> implementation of drmWaitVBlank() and drm_vblank_wait()=A0 is correct. >> =A0 But when I run modetest with option " -v -s 12:1280x1024" , it print= s high >> fresh rate up to "150 HZ" .=A0 I examing the code , and found that no wa= iting >> vblank operation is processed in nouveau_crtc_ page_flip() function. The >> screen=A0 produced lots of garbage and blink very much. >> =A0int >> nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, >> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct drm_pending_vblank_eve= nt *event) >> { >> ...... >> } >> I study the i915 intel_crtc_page_flip implementation. >> static int intel_crtc_page_flip(stru ct drm_crtc *crtc, >> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct drm_framebuffer *fb, >> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct drm_pending_vblank_= event *event) >> { >> ...... >> >> =A0=A0=A0 ret =3D drm_vblank_get(dev, intel_crtc->pipe); >> =A0=A0=A0 if (ret) >> =A0=A0=A0=A0=A0=A0=A0 goto cleanup_objs; >> >> =A0=A0=A0 work->pending_flip_obj =3D obj; >> >> =A0=A0=A0 work->enable_stall_check =3D true; >> >> =A0=A0=A0 /* Block clients from rendering to the new back buffer until >> =A0=A0=A0=A0 * the flip occurs and the object is no longer visible. >> =A0=A0=A0=A0 */ >> =A0=A0=A0 atomic_add(1 << intel_crtc->plane, &work->old_fb_obj->pending_= flip); >> >> =A0=A0=A0 ret =3D dev_priv->display.queue_flip(dev, crtc, fb, obj); >> =A0&am p;nb sp;=A0 if (ret) >> =A0=A0=A0=A0=A0=A0=A0 goto cleanup_pending; >> ...... >> } >> >> after vblank irq acquired, the interrupt isr will wakup the runqueue. >> 6159 static void do_intel_finish_page_flip(struct drm_device *dev, >> 6160=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 s= truct drm_crtc *crtc) >> 6161 { >> ...... >> 6211=A0=A0=A0=A0=A0=A0=A0=A0 list_add_tail(&e->base.link, >> 6212=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &e->base.file= _priv->event_list); >> 6213=A0=A0=A0=A0=A0=A0=A0=A0 wake_up_interruptible(&e->base.file_priv->e= vent_wait); >> 6214=A0=A0=A0=A0 } >> 6215 >> 6216=A0=A0=A0=A0 drm_vblank_put(dev, intel_crtc->pipe); >> 6217 >> >> >> Is there anyone use the same=A0 driver and foun d this issues can tell m= e "is >> it a bug"? >> >> Thanks! >> >> >> >> >> >> >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel >> >> > >It seems to be, the actual page flipping is done by software method >(see nv04_graph_mthd_page_flip). There is one thing i'm unsure about >and that is that we wait for the rendering to be done to the current >frontbuffer and not the current backbuffer (this is only done if the >page flip channel is different than the rendering channel). Maybe >someone else can comment on that. > >-- = >Far away from the primal instinct, the song seems to fade away, the >river get wider between your thoughts and the things we do and say.