Exemplo n.º 1
0
int adreno_ringbuffer_init(struct kgsl_device *device)
{
	int status;
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct adreno_ringbuffer *rb = &adreno_dev->ringbuffer;

	rb->device = device;
	rb->sizedwords = KGSL_RB_SIZE >> 2;

	
	status = kgsl_allocate_contiguous(&rb->buffer_desc,
		(rb->sizedwords << 2));

	if (status != 0) {
		adreno_ringbuffer_close(rb);
		return status;
	}

	
	status = kgsl_allocate_contiguous(&rb->memptrs_desc,
		sizeof(struct kgsl_rbmemptrs));

	if (status != 0) {
		adreno_ringbuffer_close(rb);
		return status;
	}

	
	rb->memptrs = (struct kgsl_rbmemptrs *) rb->memptrs_desc.hostptr;

	return 0;
}
Exemplo n.º 2
0
int adreno_ringbuffer_init(struct kgsl_device *device)
{
	int status;
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct adreno_ringbuffer *rb = &adreno_dev->ringbuffer;

	rb->device = device;
	rb->sizedwords = (2 << kgsl_cfg_rb_sizelog2quadwords);
	rb->blksizequadwords = kgsl_cfg_rb_blksizequadwords;

	/* allocate memory for ringbuffer */
	status = kgsl_allocate_contiguous(&rb->buffer_desc,
		(rb->sizedwords << 2));

	if (status != 0) {
		adreno_ringbuffer_close(rb);
		return status;
	}

	/* allocate memory for polling and timestamps */
	/* This really can be at 4 byte alignment boundry but for using MMU
	 * we need to make it at page boundary */
	status = kgsl_allocate_contiguous(&rb->memptrs_desc,
		sizeof(struct kgsl_rbmemptrs));

	if (status != 0) {
		adreno_ringbuffer_close(rb);
		return status;
	}

	/* overlay structure on memptrs memory */
	rb->memptrs = (struct kgsl_rbmemptrs *) rb->memptrs_desc.hostptr;

	return 0;
}
Exemplo n.º 3
0
int adreno_ringbuffer_init(struct kgsl_device *device)
{
    int status;
    struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
    struct adreno_ringbuffer *rb = &adreno_dev->ringbuffer;

    rb->device = device;
    /*
     * It is silly to convert this to words and then back to bytes
     * immediately below, but most of the rest of the code deals
     * in words, so we might as well only do the math once
     */
    rb->sizedwords = KGSL_RB_SIZE >> 2;

    /* allocate memory for ringbuffer */
    status = kgsl_allocate_contiguous(&rb->buffer_desc,
                                      (rb->sizedwords << 2));

    if (status != 0) {
        adreno_ringbuffer_close(rb);
        return status;
    }

    /* allocate memory for polling and timestamps */
    /* This really can be at 4 byte alignment boundry but for using MMU
     * we need to make it at page boundary */
    status = kgsl_allocate_contiguous(&rb->memptrs_desc,
                                      sizeof(struct kgsl_rbmemptrs));

    if (status != 0) {
        adreno_ringbuffer_close(rb);
        return status;
    }

    /* overlay structure on memptrs memory */
    rb->memptrs = (struct kgsl_rbmemptrs *) rb->memptrs_desc.hostptr;

    return 0;
}