From d5c80240f4d9affccefec5049ca2bad099da94e0 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Thu, 19 Dec 2013 04:21:53 +0000 Subject: [PATCH] intel-2D: sna vsync api git-svn-id: svn://kolibrios.org@4377 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/sdk/sources/Intel-2D/Makefile | 2 +- contrib/sdk/sources/Intel-2D/pixdriver.h | 17 ++++++++++++++ contrib/sdk/sources/Intel-2D/pixlib.c | 18 ++++----------- contrib/sdk/sources/Intel-2D/sna/sna.c | 28 +++++------------------- contrib/sdk/sources/Intel-2D/sna/sna.h | 2 ++ 5 files changed, 30 insertions(+), 37 deletions(-) create mode 100644 contrib/sdk/sources/Intel-2D/pixdriver.h diff --git a/contrib/sdk/sources/Intel-2D/Makefile b/contrib/sdk/sources/Intel-2D/Makefile index 09424bf705..9ebbd8f58e 100644 --- a/contrib/sdk/sources/Intel-2D/Makefile +++ b/contrib/sdk/sources/Intel-2D/Makefile @@ -69,7 +69,7 @@ endif # targets -all:$(LIBRARY).dll intel-sna.drv intel-uxa.drv +all:$(LIBRARY).dll intel-sna.drv uxa:$(LIBRARY).dll ebox:$(LIBRARY).dll diff --git a/contrib/sdk/sources/Intel-2D/pixdriver.h b/contrib/sdk/sources/Intel-2D/pixdriver.h new file mode 100644 index 0000000000..308a4ed779 --- /dev/null +++ b/contrib/sdk/sources/Intel-2D/pixdriver.h @@ -0,0 +1,17 @@ +#ifndef __PIXDRIVER_H__ +#define __PIXDRIVER_H__ + +struct pix_driver +{ + char *name; + + int (*create_bitmap)(bitmap_t * bitmap); + int (*destroy_bitmap)(bitmap_t * bitmap); + int (*lock_bitmap)(bitmap_t * bitmap); + int (*blit)(bitmap_t * bitmap, int scale, int vsync, + int dst_x, int dst_y, int w, int h, int src_x, int src_y); + int (*resize_bitmap)(bitmap_t * bitmap); + void (*fini)(void); +}; + +#endif diff --git a/contrib/sdk/sources/Intel-2D/pixlib.c b/contrib/sdk/sources/Intel-2D/pixlib.c index bd043ecfa6..aa21f94dad 100644 --- a/contrib/sdk/sources/Intel-2D/pixlib.c +++ b/contrib/sdk/sources/Intel-2D/pixlib.c @@ -5,22 +5,12 @@ #include #include #include +#include "pixdriver.h" + #include void* load_library(const char *name); -struct pix_driver -{ - char *name; - - int (*create_bitmap)(bitmap_t * bitmap); - int (*destroy_bitmap)(bitmap_t * bitmap); - int (*lock_bitmap)(bitmap_t * bitmap); - int (*blit)(bitmap_t * bitmap, bool scale, int dst_x, int dst_y, - int w, int h, int src_x, int src_y); - int (*resize_bitmap)(bitmap_t * bitmap); - void (*fini)(void); -}; #define DISPLAY_VERSION 0x0200 /* 2.00 */ @@ -202,7 +192,7 @@ int blit_bitmap(bitmap_t * bitmap, int dst_x, int dst_y, surface_t *sf = to_surface(bitmap); if (sf->flags & hw_caps & HW_BIT_BLIT) - return pix_driver.blit(bitmap, false, dst_x, dst_y, w, h, src_x, src_y); + return pix_driver.blit(bitmap, 0, 0, dst_x, dst_y, w, h, src_x, src_y); bc.dstx = dst_x; bc.dsty = dst_y; @@ -233,7 +223,7 @@ int fplay_blit_bitmap(bitmap_t * bitmap, int dst_x, int dst_y, int w, int h) surface_t *sf = to_surface(bitmap); if (sf->flags & hw_caps & HW_TEX_BLIT) - return pix_driver.blit(bitmap, true, dst_x, dst_y, w, h, 0, 0); + return pix_driver.blit(bitmap, 1, 1, dst_x, dst_y, w, h, 0, 0); bc.dstx = dst_x; bc.dsty = dst_y; diff --git a/contrib/sdk/sources/Intel-2D/sna/sna.c b/contrib/sdk/sources/Intel-2D/sna/sna.c index 0e42c21699..d6facc9dec 100644 --- a/contrib/sdk/sources/Intel-2D/sna/sna.c +++ b/contrib/sdk/sources/Intel-2D/sna/sna.c @@ -46,6 +46,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sna_reg.h" #include +#include "../pixdriver.h" + #include #define to_surface(x) (surface_t*)((x)->handle) @@ -57,20 +59,6 @@ typedef struct { int b; } rect_t; -struct pix_driver -{ - char *name; - - int (*create_bitmap)(bitmap_t * bitmap); - int (*destroy_bitmap)(bitmap_t * bitmap); - int (*lock_bitmap)(bitmap_t * bitmap); - int (*blit)(bitmap_t * bitmap, bool scale, int dst_x, int dst_y, - int w, int h, int src_x, int src_y); - int (*resize_bitmap)(bitmap_t * bitmap); - void (*fini)(void); -}; - - static struct sna_fb sna_fb; static int tls_mask; @@ -691,7 +679,7 @@ sna_wait_for_scanline(struct sna *sna, full_height = y1 == 0 && y2 == crtc->b - crtc->t; - pipe = 0; + pipe = sna_fb.pipe; DBG(("%s: pipe=%d, y1=%d, y2=%d, full_height?=%d\n", __FUNCTION__, pipe, y1, y2, full_height)); @@ -1092,8 +1080,8 @@ err_1: -int sna_blit_tex(bitmap_t *bitmap, bool scale, int dst_x, int dst_y, - int w, int h, int src_x, int src_y) +int sna_blit_tex(bitmap_t *bitmap, int scale, int vsync, + int dst_x, int dst_y,int w, int h, int src_x, int src_y) { surface_t *sf = to_surface(bitmap); @@ -1165,7 +1153,7 @@ int sna_blit_tex(bitmap_t *bitmap, bool scale, int dst_x, int dst_y, __lock_acquire_recursive(__sna_lock); -#if 0 + if(vsync) { rect_t crtc, clip; @@ -1182,7 +1170,6 @@ int sna_blit_tex(bitmap_t *bitmap, bool scale, int dst_x, int dst_y, kgem_set_mode(&sna_device->kgem, KGEM_RENDER, sna_fb.fb_bo); sna_wait_for_scanline(sna_device, &crtc, &clip); } -#endif if( sna_device->render.blit_tex(sna_device, PictOpSrc,scale, &src, src_bo, @@ -1223,8 +1210,6 @@ int sna_blit_tex(bitmap_t *bitmap, bool scale, int dst_x, int dst_y, static void sna_fini() { - ENTER(); - if( sna_device ) { struct kgem_bo *mask; @@ -1242,7 +1227,6 @@ static void sna_fini() sna_device = NULL; __lock_release_recursive(__sna_lock); }; - LEAVE(); } uint32_t DrvInit(uint32_t service, struct pix_driver *driver) diff --git a/contrib/sdk/sources/Intel-2D/sna/sna.h b/contrib/sdk/sources/Intel-2D/sna/sna.h index f8277df5d1..f11790b2f4 100644 --- a/contrib/sdk/sources/Intel-2D/sna/sna.h +++ b/contrib/sdk/sources/Intel-2D/sna/sna.h @@ -391,6 +391,8 @@ struct sna_fb uint32_t height; uint32_t pitch; uint32_t tiling; + uint32_t crtc; + uint32_t pipe; struct kgem_bo *fb_bo; };