static void gxCheckState(void *drv, void *dev, CardState *state, DFBAccelerationMask accel) { #if NSC_ACCEL NSCDriverData *gxdrv = (NSCDriverData *) drv; NSCDeviceData *gxdev = (NSCDeviceData *) dev; if(state->destination->config.format != DSPF_RGB16) return; if (DFB_BLITTING_FUNCTION(accel)) { if(state->source->config.format != DSPF_RGB16) return; if (gxdrv->cpu) { /* GU2 - if there are no other blitting flags than the supported * and the source and destination formats are the same */ if (!(state->blittingflags & ~GX_SUPPORTED_BLITTINGFLAGS) && state->source && state->source->config.format != DSPF_RGB24) { state->accel |= GX_SUPPORTED_BLITTINGFUNCTIONS; } } else{ /* GU1 - source width must match frame buffer strid */ if(state->source) { int src_pitch = 0; int dst_pitch = 0; if(state->source) { src_pitch = state->source->config.size.w * DFB_BYTES_PER_PIXEL(state->source->config.format); } if (state->modified & SMF_DESTINATION) { if(state->destination && state->dst.buffer) dst_pitch = state->dst.pitch; } if(dst_pitch == 0) { dst_pitch = gxdev->dst_pitch; } if(src_pitch == dst_pitch && state->source) { state->accel |= GX_SUPPORTED_BLITTINGFUNCTIONS; } } } } else { /* if there are no other drawing flags than the supported */ if (!(state->drawingflags & ~GX_SUPPORTED_DRAWINGFLAGS)) { state->accel |= GX_SUPPORTED_DRAWINGFUNCTIONS; } } #endif /* NSC_ACCEL */ }
bool gal_config_accelerated( GALConfig *config, CardState *state, DFBAccelerationMask accel ) { bool ret = false; unsigned int flags; int index; D_ASSERT( config != NULL ); D_ASSERT( state != NULL ); switch (accel) { case DFXL_FILLRECTANGLE: index = GAL_CONF_FILLRECTANGLE; break; case DFXL_DRAWRECTANGLE: index = GAL_CONF_DRAWRECTANGLE; break; case DFXL_DRAWLINE: index = GAL_CONF_DRAWLINE; break; case DFXL_FILLTRIANGLE: index = GAL_CONF_FILLTRIANGLE; break; case DFXL_BLIT: index = GAL_CONF_BLIT; break; case DFXL_STRETCHBLIT: index = GAL_CONF_STRETCHBLIT; break; default: return false; } if (DFB_BLITTING_FUNCTION(accel)) { flags = (unsigned int)state->blittingflags; } else { flags = (unsigned int)state->drawingflags; } if (flags == 0) { if (config->primitive_settings[index].none) { ret = true; } else { ret = false; } } else { if (!(flags & ~config->primitive_settings[index].flags)) { ret = true; } else { ret = false; } } return ret; }
static void r100_flush_vb( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { volatile u8 *mmio = rdrv->mmio_base; EMIT_VERTICES( rdrv, rdev, mmio ); if (DFB_PLANAR_PIXELFORMAT(rdev->dst_format)) { DFBRegion *clip = &rdev->clip; bool s420 = DFB_PLANAR_PIXELFORMAT(rdev->src_format); int i; if (DFB_BLITTING_FUNCTION(rdev->accel)) { for (i = 0; i < rdev->vb_size; i += 4) { rdev->vb[i+0] = f2d(d2f(rdev->vb[i+0])*0.5f); rdev->vb[i+1] = f2d(d2f(rdev->vb[i+1])*0.5f); if (s420) { rdev->vb[i+2] = f2d(d2f(rdev->vb[i+2])*0.5f); rdev->vb[i+3] = f2d(d2f(rdev->vb[i+3])*0.5f); } } } else { for (i = 0; i < rdev->vb_size; i += 2) { rdev->vb[i+0] = f2d(d2f(rdev->vb[i+0])*0.5f); rdev->vb[i+1] = f2d(d2f(rdev->vb[i+1])*0.5f); } } /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch/2 ); radeon_out32( mmio, RE_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2/2 << 16) | (clip->x2/2 & 0xffff) ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, PP_TFACTOR_0, rdev->cb_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 3 ); radeon_out32( mmio, PP_TEX_SIZE_0, ((rdev->src_height/2-1) << 16) | ((rdev->src_width/2-1) & 0xffff) ); radeon_out32( mmio, PP_TEX_PITCH_0, rdev->src_pitch/2 - 32 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset_cb ); } } else { radeon_out32( mmio, PP_TFACTOR_1, rdev->cb_cop ); } /* Fill Cb plane */ EMIT_VERTICES( rdrv, rdev, mmio ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cr ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, PP_TFACTOR_0, rdev->cr_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset_cr ); } } else { radeon_out32( mmio, PP_TFACTOR_1, rdev->cr_cop ); } /* Fill Cr plane */ EMIT_VERTICES( rdrv, rdev, mmio ); /* Reset */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch ); radeon_out32( mmio, RE_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2 << 16) | (clip->x2 & 0xffff) ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, PP_TFACTOR_0, rdev->y_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 3 ); radeon_out32( mmio, PP_TEX_SIZE_0, ((rdev->src_height-1) << 16) | ((rdev->src_width-1) & 0xffff) ); radeon_out32( mmio, PP_TEX_PITCH_0, rdev->src_pitch - 32 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset ); } } else { radeon_out32( mmio, PP_TFACTOR_1, rdev->y_cop ); } } rdev->vb_size = 0; rdev->vb_count = 0; }