diff options
-rw-r--r-- | src/sna/kgem.h | 1 | ||||
-rw-r--r-- | src/sna/sna.h | 2 | ||||
-rw-r--r-- | src/sna/sna_display.c | 29 | ||||
-rw-r--r-- | src/sna/sna_dri.c | 3 | ||||
-rw-r--r-- | src/sna/sna_video_textured.c | 3 |
5 files changed, 16 insertions, 22 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 0a95da74..fdabfae9 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -141,7 +141,6 @@ struct kgem { uint16_t nexec; uint16_t nreloc; uint16_t nfence; - uint16_t wait; uint16_t batch_size; uint16_t min_alignment; diff --git a/src/sna/sna.h b/src/sna/sna.h index 5f7b526a..1f2d085d 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -299,6 +299,7 @@ extern void sna_mode_hotplug(struct sna *sna); extern void sna_mode_fini(struct sna *sna); extern int sna_crtc_id(xf86CrtcPtr crtc); +extern bool sna_crtc_is_bound(struct sna *sna, xf86CrtcPtr crtc); extern int sna_output_dpms_status(xf86OutputPtr output); extern int sna_page_flip(struct sna *sna, @@ -353,7 +354,6 @@ extern xf86CrtcPtr sna_covering_crtc(ScrnInfoPtr scrn, extern bool sna_wait_for_scanline(struct sna *sna, PixmapPtr pixmap, xf86CrtcPtr crtc, const BoxRec *clip); -extern bool sna_crtc_is_bound(struct sna *sna, xf86CrtcPtr crtc); Bool sna_dri_open(struct sna *sna, ScreenPtr pScreen); void sna_dri_wakeup(struct sna *sna); diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index f1fcdbc0..4b142a3e 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -389,6 +389,19 @@ mode_to_kmode(drmModeModeInfoPtr kmode, DisplayModePtr mode) kmode->name[DRM_DISPLAY_MODE_LEN-1] = 0; } +bool sna_crtc_is_bound(struct sna *sna, xf86CrtcPtr crtc) +{ + struct drm_mode_crtc mode; + + mode.crtc_id = crtc_id(crtc->driver_private); + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode)) + return false; + + DBG(("%s: mode valid?=%d, fb attached?=%d\n", __FUNCTION__, + mode.mode_valid, sna->mode.fb_id == mode.fb_id)); + return mode.mode_valid && sna->mode.fb_id == mode.fb_id; +} + static Bool sna_crtc_apply(xf86CrtcPtr crtc) { @@ -2110,7 +2123,6 @@ static void sna_emit_wait_for_scanline_gen6(struct sna *sna, b[1] = pipe; b[2] = y2 - 1; b[3] = MI_WAIT_FOR_EVENT | event; - sna->kgem.wait = sna->kgem.nbatch + 3; kgem_advance_batch(&sna->kgem, 4); } @@ -2140,7 +2152,6 @@ static void sna_emit_wait_for_scanline_gen4(struct sna *sna, b[2] = b[0] = MI_LOAD_SCAN_LINES_INCL | pipe << 20; b[3] = b[1] = (y1 << 16) | (y2-1); b[4] = MI_WAIT_FOR_EVENT | event; - sna->kgem.wait = sna->kgem.nbatch + 4; kgem_advance_batch(&sna->kgem, 5); } @@ -2168,7 +2179,6 @@ static void sna_emit_wait_for_scanline_gen2(struct sna *sna, b[4] = MI_WAIT_FOR_EVENT | MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW; else b[4] = MI_WAIT_FOR_EVENT | MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW; - sna->kgem.wait = sna->kgem.nbatch + 4; kgem_advance_batch(&sna->kgem, 5); } @@ -2233,19 +2243,6 @@ sna_wait_for_scanline(struct sna *sna, return true; } -bool sna_crtc_is_bound(struct sna *sna, xf86CrtcPtr crtc) -{ - struct drm_mode_crtc mode; - - mode.crtc_id = crtc_id(crtc->driver_private); - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode)) - return false; - - DBG(("%s: mode valid?=%d, fb attached?=%d\n", __FUNCTION__, - mode.mode_valid, sna->mode.fb_id == mode.fb_id)); - return mode.mode_valid && sna->mode.fb_id == mode.fb_id; -} - void sna_mode_hotplug(struct sna *sna) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(sna->scrn); diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 4fa43209..a1f671ac 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -493,8 +493,7 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region, DBG(("%s: flushing? %d\n", __FUNCTION__, flush)); if (flush) { /* STAT! */ - if (!sna_crtc_is_bound(sna, crtc)) - sna->kgem.batch[sna->kgem.wait] = 0; + assert(sna_crtc_is_bound(sna, ctrc)); kgem_submit(&sna->kgem); } diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index 4975f55f..9247e88d 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -308,8 +308,7 @@ sna_video_textured_put_image(ScrnInfoPtr scrn, * we can hit the next vsync. */ if (flush) { - if (!sna_crtc_is_bound(sna, crtc)) - sna->kgem.batch[sna->kgem.wait] = 0; + assert(sna_crtc_is_bound(sna, ctrc)); kgem_submit(&sna->kgem); } |