Ejemplo n.º 1
0
static inline void
pxa3xx_validate_DEST( PXA3XXDriverData *pdrv,
                      PXA3XXDeviceData *pdev,
                      CardState        *state )
{
     CoreSurfaceBuffer *buffer = state->dst.buffer;
     u32               *prep   = start_buffer( pdrv, 6 );

     D_DEBUG_AT( PXA3XX_BLT, "%s( 0x%08lx [%d] )\n", __FUNCTION__,
                 state->dst.phys, state->dst.pitch );

     pdev->dst_phys  = state->dst.phys;
     pdev->dst_pitch = state->dst.pitch;
     pdev->dst_bpp   = DFB_BYTES_PER_PIXEL( buffer->format );
     pdev->dst_index = DFB_PIXELFORMAT_INDEX( buffer->format ) % DFB_NUM_PIXELFORMATS;

     /* Set destination. */
     prep[0] = 0x020000A2;
     prep[1] = pdev->dst_phys;
     prep[2] = (pixel_formats[pdev->dst_index] << 19) | (pdev->dst_pitch << 5) | pdev->dst_bpp;

     prep[3] = 0x02000012;
     prep[4] = prep[1];
     prep[5] = prep[2];

     submit_buffer( pdrv, 6 );

     /* Set the flags. */
     PXA3XX_VALIDATE( DEST );
}
Ejemplo n.º 2
0
/*
 * Blend a rectangle using the alpha value from the color using the current hardware state.
 */
static bool
pxa3xxBlitBlendColorAlpha( void *drv, void *dev, DFBRectangle *rect, int x, int y )
{
     PXA3XXDriverData *pdrv = drv;
     PXA3XXDeviceData *pdev = dev;
     u32              *prep = start_buffer( pdrv, 9 );

     D_DEBUG_AT( PXA3XX_BLT, "%s( %d, %d - %dx%d  -> %d, %d )\n",
                 __FUNCTION__, DFB_RECTANGLE_VALS( rect ), x, y );
     DUMP_INFO();

     prep[0] = 0x47000138;
     prep[1] = x;
     prep[2] = y;
     prep[3] = rect->x;
     prep[4] = rect->y;
     prep[5] = x;
     prep[6] = y;
     prep[7] = PXA3XX_WH( rect->w, rect->h );
     prep[8] = (pdev->color.a << 24) | (pdev->color.a << 16);

     submit_buffer( pdrv, 9 );

     return true;
}
Ejemplo n.º 3
0
/*
 * Render a blended rectangle using the current hardware state.
 *
 * As the hardware does not directly support this, we blit a single
 * pixel with blending.
 */
static bool
pxa3xxFillRectangleBlend( void *drv, void *dev, DFBRectangle *rect )
{
     PXA3XXDriverData *pdrv   = drv;
     PXA3XXDeviceData *pdev   = dev;
     u32              *prep   = start_buffer( pdrv, 22 );
     const u32         format = pixel_formats[DFB_PIXELFORMAT_INDEX( DSPF_ARGB )];

     D_DEBUG_AT( PXA3XX_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__,
                 DFB_RECTANGLE_VALS( rect ) );
     DUMP_INFO();

     /* Set fake destination. */
     prep[0]  = 0x020000A2;
     prep[1]  = pdev->fake_phys;
     prep[2]  = (format << 19) | 4;

     /* Fill rectangle. */
     prep[3]  = 0x40000014 | (format << 8);
     prep[4]  = 0;
     prep[5]  = 0;
     prep[6]  = PXA3XX_WH( rect->w, 1 );
     prep[7]  = PIXEL_ARGB( pdev->color.a, pdev->color.r, pdev->color.g, pdev->color.b );

     /* Restore destination. */
     prep[8]  = 0x020000A2;
     prep[9]  = pdev->dst_phys;
     prep[10] = (pixel_formats[pdev->dst_index] << 19) | (pdev->dst_pitch << 5) | pdev->dst_bpp;

     /* Set fake buffer as source. */
     prep[11] = 0x02000002;
     prep[12] = pdev->fake_phys;
     prep[13] = (format << 19) | 4;

     /* Blit with blending. */
     prep[14] = 0x47000107;
     prep[15] = rect->x;
     prep[16] = rect->y;
     prep[17] = 0;
     prep[18] = 0;
     prep[19] = rect->x;
     prep[20] = rect->y;
     prep[21] = PXA3XX_WH( rect->w, rect->h );

     submit_buffer( pdrv, 22 );

     /* Clear the flag. */
     PXA3XX_INVALIDATE( SOURCE );

     return true;
}
Ejemplo n.º 4
0
static inline void
pxa3xx_validate_COLOR( PXA3XXDriverData *pdrv,
                       PXA3XXDeviceData *pdev,
                       CardState        *state )
{
     u32 *prep = start_buffer( pdrv, 2 );

     prep[0] = 0x04000011 | (pixel_formats[pdev->dst_index] << 8);
     prep[1] = dfb_pixel_from_color( state->destination->config.format, &state->color );

     submit_buffer( pdrv, 2 );

     /* Set the flag. */
     PXA3XX_VALIDATE( COLOR );
}
Ejemplo n.º 5
0
/*
 * Render a filled rectangle using the current hardware state.
 */
static bool
pxa3xxFillRectangle( void *drv, void *dev, DFBRectangle *rect )
{
     PXA3XXDriverData *pdrv = drv;
     u32              *prep = start_buffer( pdrv, 4 );

     D_DEBUG_AT( PXA3XX_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__,
                 DFB_RECTANGLE_VALS( rect ) );
     DUMP_INFO();

     prep[0] = 0x40000003;
     prep[1] = rect->x;
     prep[2] = rect->y;
     prep[3] = PXA3XX_WH( rect->w, rect->h );

     submit_buffer( pdrv, 4 );

     return true;
}
Ejemplo n.º 6
0
BOOL sound_xaudio2::submit_next_queued()
{
	if (!m_queue.empty())
	{
		// Get a reference to the buffer
		auto buf = &m_queue.front();

		// submit the buffer data
		submit_buffer(std::move(buf->AudioData), buf->AudioSize);

		// Remove it from the queue
		assert(buf->AudioSize > 0);
		m_queue.pop();

		return !m_queue.empty();
	}

	// queue was already empty
	return FALSE;
}
Ejemplo n.º 7
0
static inline void
pxa3xx_validate_SOURCE( PXA3XXDriverData *pdrv,
                        PXA3XXDeviceData *pdev,
                        CardState        *state )
{
     CoreSurfaceBuffer *buffer = state->src.buffer;
     u32               *prep   = start_buffer( pdrv, 3 );

     pdev->src_phys  = state->src.phys;
     pdev->src_pitch = state->src.pitch;
     pdev->src_bpp   = DFB_BYTES_PER_PIXEL( buffer->format );
     pdev->src_index = DFB_PIXELFORMAT_INDEX( buffer->format ) % DFB_NUM_PIXELFORMATS;
     pdev->src_alpha = DFB_PIXELFORMAT_HAS_ALPHA( buffer->format );

     /* Set source. */
     prep[0] = 0x02000002;
     prep[1] = pdev->src_phys;
     prep[2] = (pixel_formats[pdev->src_index] << 19) | (pdev->src_pitch << 5) | pdev->src_bpp;

     submit_buffer( pdrv, 3 );

     /* Set the flag. */
     PXA3XX_VALIDATE( SOURCE );
}
Ejemplo n.º 8
0
/*
 * Blit a glyph with alpha blending and colorizing using the current hardware state.
 */
static bool
pxa3xxBlitGlyph( void *drv, void *dev, DFBRectangle *rect, int x, int y )
{
     PXA3XXDriverData *pdrv   = drv;
     PXA3XXDeviceData *pdev   = dev;
     u32              *prep   = start_buffer( pdrv, 40 );
     const u32         format = pixel_formats[DFB_PIXELFORMAT_INDEX( DSPF_ARGB )];

     D_DEBUG_AT( PXA3XX_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__,
                 DFB_RECTANGLE_VALS( rect ) );
     DUMP_INFO();

     if (rect->w * (rect->h + 1) * 4 > pdev->fake_size)
          return false;

     /* Set fake destination. */
     prep[0]  = 0x020000A2;
     prep[1]  = pdev->fake_phys;
     prep[2]  = (format << 19) | ((rect->w << 2) << 5) | 4;

     /* Fill first row of fake buffer. */
     prep[3]  = 0x40000014 | (format << 8);
     prep[4]  = 0;
     prep[5]  = 0;
     prep[6]  = PXA3XX_WH( rect->w, 1 );
     prep[7]  = PIXEL_ARGB( pdev->color.a, pdev->color.r, pdev->color.g, pdev->color.b );

     /* Set first row of fake buffer as source1. */
     prep[8]  = 0x02000012;
     prep[9]  = pdev->fake_phys;
     prep[10] = (format << 19) | 4;

     /* Blit with blending. */
     prep[11] = 0x47000118;
     prep[12] = 0;
     prep[13] = 1;
     prep[14] = rect->x;
     prep[15] = rect->y;
     prep[16] = 0;
     prep[17] = 0;
     prep[18] = PXA3XX_WH( rect->w, rect->h );
     prep[19] = 0;

     /* Restore destination. */
     prep[20] = 0x020000A2;
     prep[21] = pdev->dst_phys;
     prep[22] = (pixel_formats[pdev->dst_index] << 19) | (pdev->dst_pitch << 5) | pdev->dst_bpp;

     /* Restore source1 to destination. */
     prep[23] = 0x02000012;
     prep[24] = prep[21];
     prep[25] = prep[22];

     /* Set fake buffer as source0. */
     prep[26] = 0x02000002;
     prep[27] = pdev->fake_phys;
     prep[28] = (format << 19) | ((rect->w << 2) << 5) | 4;

     /* Blit with blending. */
     prep[29] = 0x47000107;
     prep[30] = x;
     prep[31] = y;
     prep[32] = 0;
     prep[33] = 1;
     prep[34] = x;
     prep[35] = y;
     prep[36] = PXA3XX_WH( rect->w, rect->h );

     /* Restore source0. */
     prep[37] = 0x02000002;
     prep[38] = pdev->src_phys;
     prep[39] = (pixel_formats[pdev->src_index] << 19) | (pdev->src_pitch << 5) | pdev->src_bpp;

     submit_buffer( pdrv, 40 );

     return true;
}
Ejemplo n.º 9
0
/*
 * Blit a rectangle using the current hardware state.
 */
static bool
pxa3xxBlit( void *drv, void *dev, DFBRectangle *rect, int x, int y )
{
     PXA3XXDriverData *pdrv     = drv;
     PXA3XXDeviceData *pdev     = dev;
     u32               rotation = 0;
     u32              *prep     = start_buffer( pdrv, 6 );

     D_DEBUG_AT( PXA3XX_BLT, "%s( %d, %d - %dx%d  -> %d, %d )\n",
                 __FUNCTION__, DFB_RECTANGLE_VALS( rect ), x, y );
     DUMP_INFO();

     if (pdev->bflags & DSBLIT_ROTATE90)
           rotation = 3;
     else if (pdev->bflags & DSBLIT_ROTATE180)
           rotation = 2;
     else if (pdev->bflags & DSBLIT_ROTATE270)
           rotation = 1;

     prep[0] = 0x4A000005 | (rotation << 4); // FIXME: use 32byte alignment hint
     prep[1] = x;
     prep[2] = y;
     prep[3] = rect->x;
     prep[4] = rect->y;
     prep[5] = PXA3XX_WH( rect->w, rect->h );

     submit_buffer( pdrv, 6 );

/* RASTER

     prep[0] = 0x4BCC0007;
     prep[1] = x;
     prep[2] = y;
     prep[3] = rect->x;
     prep[4] = rect->y;
     prep[5] = rect->x;
     prep[6] = rect->y;
     prep[7] = PXA3XX_WH( rect->w, rect->h );

     submit_buffer( pdrv, 8 );
 */

/* PATTERN

     prep[0] = 0x4C000006;
     prep[1] = x;
     prep[2] = y;
     prep[3] = rect->x;
     prep[4] = rect->y;
     prep[5] = PXA3XX_WH( rect->w, rect->h );
     prep[6] = PXA3XX_WH( rect->w, rect->h );

     submit_buffer( pdrv, 7 );
 */

/* BIAS

     prep[0] = 0x49000016;
     prep[1] = x;
     prep[2] = y;
     prep[3] = rect->x;
     prep[4] = rect->y;
     prep[5] = PXA3XX_WH( rect->w, rect->h );
     prep[6] = 0;

     submit_buffer( pdrv, 7 );
 */

     return true;
}