Commit aa19d8e9 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

staging: gma500: Add 2D acceleration

This is taken from Richard Purdie's previous attempt to rip the heart out
of the PVR driver and stake it.

Accelerate copies and fills.

[Revised patch which disables the methods until we can finish debugging them]
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b75ae079
......@@ -6,6 +6,7 @@ ccflags-y += -Iinclude/drm
psb_gfx-y += psb_bl.o \
psb_drv.o \
psb_fb.o \
psb_2d.o \
psb_gtt.o \
psb_intel_bios.o \
psb_intel_opregion.o \
......
This diff is collapsed.
......@@ -446,6 +446,7 @@ static int psb_do_init(struct drm_device *dev)
goto out_err;
}
stolen_gtt = (pg->stolen_size >> PAGE_SHIFT) * 4;
stolen_gtt = (stolen_gtt + PAGE_SIZE - 1) >> PAGE_SHIFT;
stolen_gtt =
......@@ -471,6 +472,7 @@ static int psb_do_init(struct drm_device *dev)
_PSB_CC_REVISION_DESIGNER_SHIFT);
}
spin_lock_init(&dev_priv->irqmask_lock);
tt_pages = (pg->gatt_pages < PSB_TT_PRIV0_PLIMIT) ?
......@@ -479,6 +481,14 @@ static int psb_do_init(struct drm_device *dev)
tt_pages -= tt_start >> PAGE_SHIFT;
dev_priv->sizes.ta_mem_size = 0;
PSB_WSGX32(0x00000000, PSB_CR_BIF_BANK0);
PSB_WSGX32(0x00000000, PSB_CR_BIF_BANK1);
PSB_RSGX32(PSB_CR_BIF_BANK1);
PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) | _PSB_MMU_ER_MASK,
PSB_CR_BIF_CTRL);
psb_spank(dev_priv);
PSB_WSGX32(pg->mmu_gatt_start, PSB_CR_BIF_TWOD_REQ_BASE);
/* TT region managed by TTM. */
if (!ttm_bo_init_mm(bdev, TTM_PL_TT,
......@@ -500,7 +510,6 @@ static int psb_do_init(struct drm_device *dev)
PSB_MEM_TT_START / (1024*1024);
}
PSB_DEBUG_INIT("Init MSVDX\n");
return 0;
out_err:
......@@ -786,6 +795,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
dev_priv->pipestat[1] = 0;
dev_priv->pipestat[2] = 0;
spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
PSB_WVDC32(0xFFFFFFFF, PSB_HWSTAM);
PSB_WVDC32(0x00000000, PSB_INT_ENABLE_R);
PSB_WVDC32(0xFFFFFFFF, PSB_INT_MASK_R);
spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
......
......@@ -918,6 +918,19 @@ extern int psbfb_kms_on_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern void *psbfb_vdc_reg(struct drm_device* dev);
/*
* psb_2d.c
*/
extern void psbfb_fillrect(struct fb_info *info,
const struct fb_fillrect *rect);
extern void psbfb_copyarea(struct fb_info *info,
const struct fb_copyarea *region);
extern void psbfb_imageblit(struct fb_info *info,
const struct fb_image *image);
extern int psbfb_sync(struct fb_info *info);
extern void psb_spank(struct drm_psb_private *dev_priv);
/*
*psb_reset.c
*/
......
......@@ -279,10 +279,11 @@ static struct fb_ops psbfb_ops = {
.fb_set_par = drm_fb_helper_set_par,
.fb_blank = drm_fb_helper_blank,
.fb_setcolreg = psbfb_setcolreg,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_fillrect = psbfb_fillrect,
.fb_copyarea = psbfb_copyarea,
.fb_imageblit = psbfb_imageblit,
.fb_mmap = psbfb_mmap,
.fb_sync = psbfb_sync,
};
static struct drm_framebuffer *psb_framebuffer_create
......@@ -394,6 +395,7 @@ static struct drm_framebuffer *psb_user_framebuffer_create
strcpy(info->fix.id, "psbfb");
info->flags = FBINFO_DEFAULT;
info->fix.accel = FB_ACCEL_I830; /*FIXMEAC*/
info->fbops = &psbfb_ops;
info->fix.smem_start = dev->mode_config.fb_base;
......
......@@ -256,6 +256,7 @@ irqreturn_t psb_irq_handler(DRM_IRQ_ARGS)
PSB_WSGX32(s2, PSB_CR_EVENT_HOST_CLEAR2);
/* if s & _PSB_CE_TWOD_COMPLETE we have 2D done but
we may as well poll even if we add that ! */
handled = 1;
}
PSB_WVDC32(vdc_stat, PSB_INT_IDENTITY_R);
......@@ -300,9 +301,10 @@ void psb_irq_preinstall_islands(struct drm_device *dev, int hw_islands)
_MDFLD_PIPEC_EVENT_FLAG;
}
}
/* NO I DONT WANT ANY IRQS GRRR FIXMEAC */
if (hw_islands & OSPM_GRAPHICS_ISLAND)
dev_priv->vdc_irq_mask |= _PSB_IRQ_SGX_FLAG;
/* */
/*This register is safe even if display island is off*/
PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment