Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92f0f3da authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 40c3d780 on remote branch

Change-Id: I6bfda2682cf7bca02b0a40ac9d36cc35f235e4a5
parents 6a03eddc 40c3d780
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/* Qualcomm Crypto Engine driver.
 *
 * Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2016, 2020 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -768,6 +768,11 @@ static int _ce_setup(struct qce_device *pce_dev, struct qce_req *q_req,
	switch (q_req->alg) {
	case CIPHER_ALG_DES:
		if (q_req->mode !=  QCE_MODE_ECB) {
			if (ivsize > MAX_IV_LENGTH) {
				pr_err("%s: error: Invalid length parameter\n",
					 __func__);
				return -EINVAL;
			}
			_byte_stream_to_net_words(enciv32, q_req->iv, ivsize);
			writel_relaxed(enciv32[0], pce_dev->iobase +
						CRYPTO_CNTR0_IV0_REG);
+6 −1
Original line number Diff line number Diff line
/* Qualcomm Crypto Engine driver.
 *
 * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2018, 2020 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -846,6 +846,11 @@ static int _ce_setup_cipher(struct qce_device *pce_dev, struct qce_req *creq,
	switch (creq->alg) {
	case CIPHER_ALG_DES:
		if (creq->mode !=  QCE_MODE_ECB) {
			if (ivsize > MAX_IV_LENGTH) {
				pr_err("%s: error: Invalid length parameter\n",
					 __func__);
				return -EINVAL;
			}
			_byte_stream_to_net_words(enciv32, creq->iv, ivsize);
			pce = cmdlistinfo->encr_cntr_iv;
			pce->data = enciv32[0];
+12 −11
Original line number Diff line number Diff line
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1210,7 +1210,16 @@ static inline int _wait_for_room_in_context_queue(
		spin_lock(&drawctxt->lock);
		trace_adreno_drawctxt_wake(drawctxt);

		if (ret <= 0)
		/*
		 * Account for the possibility that the context got invalidated
		 * while we were sleeping
		 */

		if (ret > 0) {
			ret = _check_context_state(&drawctxt->base);
			if (ret)
				return ret;
		} else
			return (ret == 0) ? -ETIMEDOUT : (int) ret;
	}

@@ -1225,15 +1234,7 @@ static unsigned int _check_context_state_to_queue_cmds(
	if (ret)
		return ret;

	ret = _wait_for_room_in_context_queue(drawctxt);
	if (ret)
		return ret;

	/*
	 * Account for the possiblity that the context got invalidated
	 * while we were sleeping
	 */
	return _check_context_state(&drawctxt->base);
	return _wait_for_room_in_context_queue(drawctxt);
}

static void _queue_drawobj(struct adreno_context *drawctxt,
+26 −31
Original line number Diff line number Diff line
@@ -2091,13 +2091,6 @@ long kgsl_ioctl_cmdstream_freememontimestamp_ctxtid(
	return ret;
}

static inline int _check_region(unsigned long start, unsigned long size,
				uint64_t len)
{
	uint64_t end = ((uint64_t) start) + size;
	return (end > len);
}

static int check_vma_flags(struct vm_area_struct *vma,
		unsigned int flags)
{
@@ -2112,23 +2105,27 @@ static int check_vma_flags(struct vm_area_struct *vma,
	return -EFAULT;
}

static int check_vma(struct vm_area_struct *vma, struct file *vmfile,
		struct kgsl_memdesc *memdesc)
static int check_vma(unsigned long hostptr, u64 size)
{
	if (vma == NULL || vma->vm_file != vmfile)
		return -EINVAL;
	struct vm_area_struct *vma;
	unsigned long cur = hostptr;

	/* userspace may not know the size, in which case use the whole vma */
	if (memdesc->size == 0)
		memdesc->size = vma->vm_end - vma->vm_start;
	/* range checking */
	if (vma->vm_start != memdesc->useraddr ||
		(memdesc->useraddr + memdesc->size) != vma->vm_end)
		return -EINVAL;
	return check_vma_flags(vma, memdesc->flags);
	while (cur < (hostptr + size)) {
		vma = find_vma(current->mm, cur);
		if (!vma)
			return false;

		/* Don't remap memory that we already own */
		if (vma->vm_file && vma->vm_file->f_op == &kgsl_fops)
			return false;

		cur = vma->vm_end;
	}

static int memdesc_sg_virt(struct kgsl_memdesc *memdesc, struct file *vmfile)
	return true;
}

static int memdesc_sg_virt(struct kgsl_memdesc *memdesc)
{
	int ret = 0;
	long npages = 0, i;
@@ -2150,19 +2147,17 @@ static int memdesc_sg_virt(struct kgsl_memdesc *memdesc, struct file *vmfile)
	}

	down_read(&current->mm->mmap_sem);
	/* If we have vmfile, make sure we map the correct vma and map it all */
	if (vmfile != NULL)
		ret = check_vma(find_vma(current->mm, memdesc->useraddr),
				vmfile, memdesc);
	if (!check_vma(memdesc->useraddr, memdesc->size)) {
		up_read(&current->mm->mmap_sem);
		ret = ~EFAULT;
		goto out;
	}

	if (ret == 0) {
	npages = get_user_pages(current, current->mm, memdesc->useraddr,
					sglen, write ? FOLL_WRITE : 0,
					pages, NULL);
		ret = (npages < 0) ? (int)npages : 0;
	}
				sglen, write ? FOLL_WRITE : 0, pages, NULL);
	up_read(&current->mm->mmap_sem);

	ret = (npages < 0) ? (int)npages : 0;
	if (ret)
		goto out;

@@ -2213,7 +2208,7 @@ static int kgsl_setup_anon_useraddr(struct kgsl_pagetable *pagetable,
		entry->memdesc.gpuaddr = (uint64_t)  entry->memdesc.useraddr;
	}

	return memdesc_sg_virt(&entry->memdesc, NULL);
	return memdesc_sg_virt(&entry->memdesc);
}

static int match_file(const void *p, struct file *file, unsigned int fd)
+7 −3
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018, 2020 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1244,6 +1244,10 @@ static void msm_vfe40_cfg_fetch_engine(struct vfe_device *vfe_dev,
	case V4L2_PIX_FMT_P16GBRG10:
	case V4L2_PIX_FMT_P16GRBG10:
	case V4L2_PIX_FMT_P16RGGB10:
	case V4L2_PIX_FMT_P16BGGR12:
	case V4L2_PIX_FMT_P16GBRG12:
	case V4L2_PIX_FMT_P16GRBG12:
	case V4L2_PIX_FMT_P16RGGB12:
		main_unpack_pattern = 0xB210;
		break;
	default:
Loading