msm: jpeg: Add support for SMMU fault handler
Support SMMU fault handler for JPEG module. Change-Id: I592a140705be21097c298c99f0af5b67dd68bbc9 Signed-off-by: Venu Raidu <vraidu@codeaurora.org> Signed-off-by: Sumalatha Malothu <smalot@codeaurora.org> Signed-off-by: Shadul Shaikh <sshadu@codeaurora.org>
This commit is contained in:
parent
e4250ce4ec
commit
8c5b4d8e68
1 changed files with 47 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2016, 2019, 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
|
||||
|
@ -1522,6 +1522,46 @@ long __msm_jpeg_ioctl(struct msm_jpeg_device *pgmn_dev,
|
|||
return rc;
|
||||
}
|
||||
|
||||
static void msm_jpeg_iommu_fault_handler (struct iommu_domain *domain,
|
||||
struct device *dev, unsigned long iova, int flags, void *token)
|
||||
{
|
||||
struct msm_jpeg_device *pgmn_dev;
|
||||
|
||||
if (token) {
|
||||
pgmn_dev = token;
|
||||
JPEG_PR_ERR("%s: core type %d addr 0x%lx\n",
|
||||
__func__, pgmn_dev->core_type, iova);
|
||||
JPEG_PR_ERR("%s: FE ion_fd %d y_addr 0x%x y_len %d\n",
|
||||
__func__,
|
||||
pgmn_dev->fe_pingpong_buf.buf[1].ion_fd,
|
||||
pgmn_dev->fe_pingpong_buf.buf[1].y_buffer_addr,
|
||||
pgmn_dev->fe_pingpong_buf.buf[1].y_len);
|
||||
JPEG_PR_ERR("%s: FE cbcr_addr %x cbcr_len %d\n",
|
||||
__func__,
|
||||
pgmn_dev->fe_pingpong_buf.buf[1].cbcr_buffer_addr,
|
||||
pgmn_dev->fe_pingpong_buf.buf[1].cbcr_len);
|
||||
JPEG_PR_ERR("%s: FE pln2_addr %x pln2_len %d frame_len %d\n",
|
||||
__func__,
|
||||
pgmn_dev->fe_pingpong_buf.buf[1].pln2_addr,
|
||||
pgmn_dev->fe_pingpong_buf.buf[1].pln2_len,
|
||||
pgmn_dev->fe_pingpong_buf.buf[1].framedone_len);
|
||||
JPEG_PR_ERR("%s: WE ion_fd %d y_addr 0x%x y_len %d\n",
|
||||
__func__,
|
||||
pgmn_dev->we_pingpong_buf.buf[0].ion_fd,
|
||||
pgmn_dev->we_pingpong_buf.buf[0].y_buffer_addr,
|
||||
pgmn_dev->we_pingpong_buf.buf[0].y_len);
|
||||
JPEG_PR_ERR("%s: WE cbcr_addr %x cbcr_len %d\n",
|
||||
__func__,
|
||||
pgmn_dev->we_pingpong_buf.buf[0].cbcr_buffer_addr,
|
||||
pgmn_dev->we_pingpong_buf.buf[0].cbcr_len);
|
||||
JPEG_PR_ERR("%s: WE pln2_addr %x pln2_len %d frame_len %d\n",
|
||||
__func__,
|
||||
pgmn_dev->we_pingpong_buf.buf[0].pln2_addr,
|
||||
pgmn_dev->we_pingpong_buf.buf[0].pln2_len,
|
||||
pgmn_dev->we_pingpong_buf.buf[0].framedone_len);
|
||||
}
|
||||
}
|
||||
|
||||
int __msm_jpeg_init(struct msm_jpeg_device *pgmn_dev)
|
||||
{
|
||||
int rc = 0;
|
||||
|
@ -1555,6 +1595,12 @@ int __msm_jpeg_init(struct msm_jpeg_device *pgmn_dev)
|
|||
goto err_smmu;
|
||||
}
|
||||
|
||||
cam_smmu_reg_client_page_fault_handler(
|
||||
pgmn_dev->iommu_hdl,
|
||||
msm_jpeg_iommu_fault_handler,
|
||||
NULL,
|
||||
pgmn_dev);
|
||||
|
||||
/* setup all the resources for the jpeg driver */
|
||||
rc = msm_jpeg_platform_setup(pgmn_dev);
|
||||
if (rc < 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue