From ab6680375cc6d5efebe8e40816d1906b15678d6e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 7 Nov 2014 09:54:35 +0000 Subject: sna/xv: Give the illusion of hardware progress The number of ports we provide for Xv textured video is arbitrary. The main cost is reservation of a number of XIDs and preallocation of a block of memory. Whatever value we pick, someone will always want more... References: https://bugs.freedesktop.org/show_bug.cgi?id=85974 Signed-off-by: Chris Wilson --- src/sna/sna_video_textured.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/sna/sna_video_textured.c') diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index 81833960..95011939 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -312,7 +312,7 @@ void sna_video_textured_setup(struct sna *sna, ScreenPtr screen) { XvAdaptorPtr adaptor; struct sna_video *video; - int nports = 16, i; + int nports, i; if (!sna->render.video) { xf86DrvMsg(sna->scrn->scrnIndex, X_INFO, @@ -330,6 +330,12 @@ void sna_video_textured_setup(struct sna *sna, ScreenPtr screen) if (adaptor == NULL) return; + nports = 16; + if (sna->kgem.gen >= 060) + nports = 32; + if (sna->kgem.gen >= 0100) + nports = 64; + video = calloc(nports, sizeof(struct sna_video)); adaptor->pPorts = calloc(nports, sizeof(XvPortRec)); if (video == NULL || adaptor->pPorts == NULL) { @@ -339,7 +345,6 @@ void sna_video_textured_setup(struct sna *sna, ScreenPtr screen) return; } - adaptor->type = XvInputMask | XvImageMask; adaptor->pScreen = screen; adaptor->name = (char *)"Intel(R) Textured Video"; -- cgit v1.2.3