diff options
author | Dave Airlie <airlied@redhat.com> | 2012-05-30 15:42:59 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-30 15:42:59 +0100 |
commit | 2be07433982ca2823865b37bed620419b000ddd7 (patch) | |
tree | 0026a1d6857e5c95b10494b58b1941af6c7f9421 | |
parent | b6b402241099daa5c040936e294e3e954c365444 (diff) |
intel: WIP
-rw-r--r-- | src/intel.h | 2 | ||||
-rw-r--r-- | src/intel_display.c | 2 | ||||
-rw-r--r-- | src/intel_dri.c | 31 | ||||
-rw-r--r-- | src/intel_driver.c | 29 | ||||
-rw-r--r-- | src/intel_module.c | 25 | ||||
-rw-r--r-- | src/intel_uxa.c | 9 | ||||
-rw-r--r-- | src/legacy/i810/i810_video.c | 2 | ||||
-rw-r--r-- | uxa/uxa.c | 2 |
8 files changed, 64 insertions, 38 deletions
diff --git a/src/intel.h b/src/intel.h index e8be837f..c700b6f0 100644 --- a/src/intel.h +++ b/src/intel.h @@ -398,7 +398,7 @@ typedef struct _intelDRI2FrameEvent { XID drawable_id; ClientPtr client; - enum DRI2FrameEventType type; + enum intelDRI2FrameEventType type; int frame; int pipe; diff --git a/src/intel_display.c b/src/intel_display.c index e4d029a2..a133a74e 100644 --- a/src/intel_display.c +++ b/src/intel_display.c @@ -1654,7 +1654,7 @@ drm_wakeup_handler(pointer data, int err, pointer p) Bool intel_mode_pre_init(ScrnInfoPtr scrn, int fd, int cpp) { - ScreenPtr pScreen = xf86ScrnToScreen(scrn); + // ScreenPtr pScreen = xf86ScrnToScreen(scrn); intel_screen_private *intel = intel_get_screen_private(scrn); struct drm_i915_getparam gp; struct intel_mode *mode; diff --git a/src/intel_dri.c b/src/intel_dri.c index 5ddff860..95a908eb 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -535,6 +535,7 @@ static void I830DRI2DestroyBuffer(DrawablePtr drawable, DRI2Buffer2Ptr buffer) #endif +#if 0 static PixmapPtr I830DRI2CreateBufferPixmap(ScreenPtr screen, PixmapPtr pPixmap, unsigned attachment, unsigned format, int w, @@ -589,6 +590,7 @@ I830DRI2DestroyBufferPixmap(PixmapPtr pixmap) screen->DestroyPixmap(pixmap); } +#endif static void I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, @@ -736,6 +738,7 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, FreeScratchGC(gc); } +#if 0 static void I830DRI2CopyRegionPixmap(PixmapPtr src, PixmapPtr dst, RegionPtr pRegion, int x, int y, @@ -870,7 +873,7 @@ I830DRI2CopyRegionPixmap(PixmapPtr src, PixmapPtr dst, RegionPtr pRegion, #endif cb(src, dst, pRegion, x, y); } - +#endif #if DRI2INFOREC_VERSION >= 4 static void I830DRI2ReferenceBuffer(DRI2Buffer2Ptr buffer) @@ -1136,7 +1139,7 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel, info, info->pipe)) return FALSE; - info->type = DRI2_SWAP; + info->type = INTEL_DRI2_SWAP; I830DRI2ExchangeBuffers(intel, info->front, info->back); return TRUE; } @@ -1193,7 +1196,7 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel, intel->back_buffer = new_back; return FALSE; } - info->type = DRI2_SWAP_CHAIN; + info->type = INTEL_DRI2_SWAP_CHAIN; intel->pending_flip[info->pipe] = info; priv = info->front->driverPrivate; @@ -1285,14 +1288,14 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec, switch (swap_info->type) { - case DRI2_FLIP: + case INTEL_DRI2_FLIP: /* If we can still flip... */ if (can_exchange(drawable, swap_info->front, swap_info->back) && I830DRI2ScheduleFlip(intel, drawable, swap_info)) return; /* else fall through to exchange/blit */ - case DRI2_SWAP: { + case INTEL_DRI2_SWAP: { BoxRec box; RegionRec region; @@ -1310,7 +1313,7 @@ void I830DRI2FrameEventHandler(unsigned int frame, unsigned int tv_sec, swap_info->event_data); break; } - case DRI2_WAITMSC: + case INTEL_DRI2_WAITMSC: if (swap_info->client) DRI2WaitMSCComplete(swap_info->client, drawable, frame, tv_sec, tv_usec); @@ -1340,7 +1343,7 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec, /* We assume our flips arrive in order, so we don't check the frame */ switch (flip_info->type) { - case DRI2_SWAP: + case INTEL_DRI2_SWAP: if (!drawable) break; @@ -1370,7 +1373,7 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec, flip_info->event_data); break; - case DRI2_SWAP_CHAIN: + case INTEL_DRI2_SWAP_CHAIN: assert(intel->pending_flip[flip_info->pipe] == flip_info); intel->pending_flip[flip_info->pipe] = NULL; @@ -1447,7 +1450,7 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, drmVBlank vbl; int ret, pipe = I830DRI2DrawablePipe(draw), flip = 0; intelDRI2FrameEventPtr swap_info = NULL; - enum intelDRI2FrameEventType swap_type = DRI2_SWAP; + enum intelDRI2FrameEventType swap_type = INTEL_DRI2_SWAP; CARD64 current_msc; BoxRec box; RegionRec region; @@ -1501,7 +1504,7 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, /* Flips need to be submitted one frame before */ if (can_exchange(draw, front, back)) { - swap_type = DRI2_FLIP; + swap_type = INTEL_DRI2_FLIP; flip = 1; } @@ -1700,7 +1703,7 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc, wait_info->intel = intel; wait_info->drawable_id = draw->id; wait_info->client = client; - wait_info->type = DRI2_WAITMSC; + wait_info->type = INTEL_DRI2_WAITMSC; if (!i830_dri2_add_frame_event(wait_info)) { free(wait_info); @@ -1809,6 +1812,7 @@ out_complete: return TRUE; } +#if 0 static int I830DRI2ScheduleSwapPixmap(PixmapPtr pPixmap, RegionPtr f_c, DRI2FrameEventPtr swap_info, @@ -1849,7 +1853,7 @@ I830DRI2ScheduleSwapPixmap(PixmapPtr pPixmap, RegionPtr f_c, if (intel->use_pageflipping && !intel->shadow_present && can_flip) { - swap_type = DRI2_FLIP; + swap_type = INTEL_DRI2_FLIP; flip = 1; } @@ -1972,6 +1976,7 @@ void I830DRI2FlipEventHandlerPixmap(unsigned int frame, unsigned int tv_sec, DRI2FlipEventHandler(flip, frame, tv_sec, tv_usec); } +#endif static int dri2_server_generation; #endif @@ -2056,7 +2061,7 @@ Bool I830DRI2ScreenInit(ScreenPtr screen) driverNames[0] = info.driverName; } #endif -#if DRI2INFOREC_VERSION >= 7 +#if 0// DRI2INFOREC_VERSION >= 7 info.version = 7; if (screen->isGPU) { info.CreateBufferPixmap = I830DRI2CreateBufferPixmap; diff --git a/src/intel_driver.c b/src/intel_driver.c index 12beb4c2..ec6b0458 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -555,8 +555,8 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags) intel->pEnt = pEnt; scrn->displayWidth = 640; /* default it */ - list_init(&intel->dirty_list); - if (intel->pEnt->location.type != BUS_PCI && intel->pEnt->location.type != BUS_UDEV) + xorg_list_init(&intel->dirty_list); + if (intel->pEnt->location.type != BUS_PCI && intel->pEnt->location.type != BUS_PLATFORM) return FALSE; intel->PciInfo = xf86GetPciInfoForEntity(intel->pEnt->index); @@ -748,6 +748,8 @@ redisplay_dirty(ScreenPtr screen, DirtyUpdatePtr dirty) int n; BoxPtr b; miCopyProc copy_proc; + int was_blocked; + PixmapRegionInit(&pixregion, dirty->dst); RegionTranslate(&pixregion, dirty->x, dirty->y); RegionIntersect(&pixregion, &pixregion, region); @@ -761,21 +763,32 @@ redisplay_dirty(ScreenPtr screen, DirtyUpdatePtr dirty) n = RegionNumRects(&pixregion); b = RegionRects(&pixregion); - copy_proc = screen->GetCopyAreaFunction(&dirty->src->drawable, - &dirty->dst->drawable); pGC = GetScratchGC(dirty->src->drawable.depth, screen); ValidateGC(&dirty->dst->drawable, pGC); - miCopyRegion(&dirty->src->drawable, &dirty->dst->drawable, pGC, - &pixregion, dirty->x, dirty->y, copy_proc, 0, NULL); + + while (n--) { + BoxRec dst_box; + int w, h; + + dst_box = *b; + w = dst_box.x2 - dst_box.x1; + h = dst_box.y2 - dst_box.y1; + + pGC->ops->CopyArea(&dirty->src->drawable, &dirty->dst->drawable, pGC, + dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dst_box.x1, dst_box.y1); + b++; + } FreeScratchGC(pGC); intel_batch_submit(scrn); + was_blocked = xf86BlockSIGIO(); { drm_intel_bo *bo = intel_get_pixmap_bo(dirty->dst); drm_intel_bo_map(bo, FALSE); drm_intel_bo_unmap(bo); } + xf86UnblockSIGIO(was_blocked); DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); RegionUninit(&pixregion); return 0; @@ -803,7 +816,7 @@ intel_dirty_update(ScreenPtr screen) } static void -I830BlockHandler(ScreenPtr screen, pointer blockData, pointer pTimeout, pointer pReadmask) +I830BlockHandler(ScreenPtr screen, pointer pTimeout, pointer pReadmask) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); intel_screen_private *intel = intel_get_screen_private(scrn); @@ -812,7 +825,7 @@ I830BlockHandler(ScreenPtr screen, pointer blockData, pointer pTimeout, pointer screen->BlockHandler = intel->BlockHandler; - (*screen->BlockHandler) (screen, blockData, pTimeout, pReadmask); + (*screen->BlockHandler) (screen, pTimeout, pReadmask); intel->BlockHandler = screen->BlockHandler; screen->BlockHandler = I830BlockHandler; diff --git a/src/intel_module.c b/src/intel_module.c index d49ef85d..cfb8b2a7 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -32,7 +32,7 @@ #include <xf86_OSproc.h> #include <xf86cmap.h> #include <xf86drmMode.h> -#include "xf86udev.h" +#include <xf86platformBus.h> #include <xorgVersion.h> #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,6,99,0,0) @@ -258,8 +258,6 @@ static Bool intel_driver_func(ScrnInfoPtr pScrn, xorgHWFlags *flag; switch (op) { - case GET_DRV_MODEL_V2_SUPPORT: - return TRUE; case GET_REQUIRED_HW_INTERFACES: flag = (CARD32*)ptr; @@ -371,25 +369,36 @@ static Bool intel_pci_probe(DriverPtr driver, } static Bool -intel_udev_probe(DriverPtr driver, - int entity_num, struct xf86_udev_device *dev, uintptr_t match_data) +intel_platform_probe(DriverPtr driver, + int entity_num, int flags, + struct xf86_platform_device *dev, + uintptr_t match_data) { ScrnInfoPtr scrn = NULL; + int scr_flags = 0; + char *path = xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH); if (!dev->pdev) return FALSE; + if (flags & PLATFORM_PROBE_GPU_SCREEN) + scr_flags = XF86_ALLOCATE_GPU_SCREEN; + chipset_info = (void *)match_data; - scrn = xf86AllocateGPUScreen(driver, 0); + scrn = xf86AllocateScreen(driver, scr_flags); xf86AddEntityToScreen(scrn, entity_num); + scrn->driverVersion = INTEL_VERSION; + scrn->driverName = INTEL_DRIVER_NAME; + scrn->name = INTEL_NAME; + scrn->Probe = NULL; intel_init_scrn(scrn); scrn->roles = RR_Role_Master | RR_Role_Slave_Output; scrn->abilities = RR_Ability_Offload_Slaves | RR_Ability_Output_Slaves; xf86DrvMsg(scrn->scrnIndex, X_INFO, - "using drv %s\n", dev ? dev->path : "Default device"); + "using drv %s\n", path ? path : "Default device"); return scrn != NULL; } @@ -444,7 +453,7 @@ static DriverRec intel = { intel_driver_func, intel_device_match, intel_pci_probe, - intel_udev_probe + intel_platform_probe }; static pointer intel_setup(pointer module, diff --git a/src/intel_uxa.c b/src/intel_uxa.c index 75185da1..602a3b53 100644 --- a/src/intel_uxa.c +++ b/src/intel_uxa.c @@ -1203,7 +1203,7 @@ intel_uxa_set_shared_pixmap_backing(PixmapPtr ppix, int fd_handle) dri_bo *bo; /* force untiled for now */ - bo = drm_intel_bufmgr_gem_get_bo_prime(intel->bufmgr, fd_handle); + bo = drm_intel_bufmgr_gem_get_bo_prime(intel->bufmgr, fd_handle, 0); if (!bo) return FALSE; @@ -1361,10 +1361,9 @@ Bool intel_uxa_init(ScreenPtr screen) screen->CreatePixmap = intel_uxa_create_pixmap; screen->DestroyPixmap = intel_uxa_destroy_pixmap; - if (screen->isGPU) { - screen->SharePixmapBacking = intel_uxa_share_pixmap_backing; - screen->SetSharedPixmapBacking = intel_uxa_set_shared_pixmap_backing; - } + screen->SharePixmapBacking = intel_uxa_share_pixmap_backing; + screen->SetSharedPixmapBacking = intel_uxa_set_shared_pixmap_backing; + if (!uxa_driver_init(screen, intel->uxa_driver)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "UXA initialization failed\n"); diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c index a0e6acd6..1eec6c63 100644 --- a/src/legacy/i810/i810_video.c +++ b/src/legacy/i810/i810_video.c @@ -1159,7 +1159,7 @@ I810BlockHandler ( pScreen->BlockHandler = pI810->BlockHandler; - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + //(*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); pScreen->BlockHandler = I810BlockHandler; @@ -539,7 +539,7 @@ Bool uxa_driver_init(ScreenPtr screen, uxa_driver_t * uxa_driver) uxa_screen->SavedBitmapToRegion = screen->BitmapToRegion; screen->BitmapToRegion = uxa_bitmap_to_region; - screen->GetCopyAreaFunction = uxa_get_copy_area_function; + //screen->GetCopyAreaFunction = uxa_get_copy_area_function; #ifdef RENDER { PictureScreenPtr ps = GetPictureScreenIfSet(screen); |