From: chris Subject: nouveau page_flip function implement not wait vblank, which cause screen garbage Date: Mon, 24 Oct 2011 14:30:55 +0800 (CST) Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1425153637==" Return-path: Received: from m13-65.163.com (m13-65.163.com [220.181.13.65]) by gabe.freedesktop.org (Postfix) with ESMTP id EC48E9E97F for ; Sun, 23 Oct 2011 23:46:07 -0700 (PDT) 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: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1425153637== Content-Type: multipart/alternative; boundary="----=_Part_200519_286687496.1319437855314" ------=_Part_200519_286687496.1319437855314 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: 7bit Dear, I use NVidia Geforce 7300GT graphics card in my PC, and Linux 3.1rc4 kernel code, git drm 2.4.36. When I run the vbltest program, it prints "60HZ" which indicated the implementation of drmWaitVBlank() and drm_vblank_wait() is correct. But when I run modetest with option " -v -s 12:1280x1024" , it prints high fresh rate up to "150 HZ" . I examing the code , and found that no waiting vblank operation is processed in nouveau_crtc_page_flip() function. The screen produced lots of garbage and blink very much. int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event) { ...... } I study the i915 intel_crtc_page_flip implementation. static int intel_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event) { ...... ret = drm_vblank_get(dev, intel_crtc->pipe); if (ret) goto cleanup_objs; work->pending_flip_obj = obj; work->enable_stall_check = true; /* Block clients from rendering to the new back buffer until * the flip occurs and the object is no longer visible. */ atomic_add(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip); ret = dev_priv->display.queue_flip(dev, crtc, fb, obj); if (ret) 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 struct drm_crtc *crtc) 6161 { ...... 6211 list_add_tail(&e->base.link, 6212 &e->base.file_priv->event_list); 6213 wake_up_interruptible(&e->base.file_priv->event_wait); 6214 } 6215 6216 drm_vblank_put(dev, intel_crtc->pipe); 6217 Is there anyone use the same driver and found this issues can tell me "is it a bug"? Thanks! ------=_Part_200519_286687496.1319437855314 Content-Type: text/html; charset=GBK Content-Transfer-Encoding: 7bit
Dear,

I use NVidia Geforce 7300GT graphics card in my PC, and Linux 3.1rc4 kernel code, git drm 2.4.36. 
  When I run the vbltest program, it prints  "60HZ"  which indicated the implementation of drmWaitVBlank() and drm_vblank_wait()  is correct.
  But when I run modetest with option " -v -s 12:1280x1024" , it prints high fresh rate up to "150 HZ" .  I examing the code , and found that no waiting vblank operation is processed in nouveau_crtc_page_flip() function. The screen  produced lots of garbage and blink very much.
 int
nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
        &nb sp;      struct drm_pending_vblank_event *event)
{
......
}
I study the i915 intel_crtc_page_flip implementation.
static int intel_crtc_page_flip(stru ct drm_crtc *crtc,
                struct drm_framebuffer *fb,
                struct drm_pending_vblank_event *event)
{
......

    ret = drm_vblank_get(dev, intel_crtc->pipe);
    if (ret)
        goto cleanup_objs;

    work->pending_flip_obj = obj;

    work->enable_stall_check = true;

    /* Block clients from rendering to the new back buffer until
     * the flip occurs and the object is no longer visible.
     */
  &n bsp; atomic_add(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip);

    ret = dev_priv->display.queue_flip(dev, crtc, fb, obj);
 &nb sp;  if (ret)
        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                       struct drm_crtc *crtc)
6161 {
......
6211         list_add_tail(&e->base.link,
6212                   &e->base.file_priv->event_list);
6213         wake_up_interruptible(&e->base.file_priv->event_wa it);
6214     }
6215
6216     drm_vblank_put(dev, intel_crtc->pipe);
6217


Is there anyone use the same  driver and foun d this issues can tell me "is it a bug"?

Thanks!




------=_Part_200519_286687496.1319437855314-- --===============1425153637== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1425153637==--