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

Commit bea2f936 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "UPSTREAM: Merge remote-tracking branch 'quic/dev/msm-4.9-camx' into mainline msm-4.9"

parents f87869e8 95e5a720
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/timer.h>
#include <media/cam_icp.h>
#include <linux/iopoll.h>
#include <soc/qcom/socinfo.h>

#include "cam_io_util.h"
#include "hfi_reg.h"
@@ -38,6 +39,9 @@
#define HFI_VERSION_INFO_STEP_BMSK   0xFF
#define HFI_VERSION_INFO_STEP_SHFT  0

#define SOC_VERSION_HW1             0x10000
#define SOC_VERSION_HW2             0x20000

static struct hfi_info *g_hfi;
unsigned int g_icp_mmu_hdl;
static DEFINE_MUTEX(hfi_cmd_q_mutex);
@@ -350,7 +354,7 @@ int cam_hfi_init(uint8_t event_driven_mode, struct hfi_mem_info *hfi_mem,
	struct hfi_qtbl *qtbl;
	struct hfi_qtbl_hdr *qtbl_hdr;
	struct hfi_q_hdr *cmd_q_hdr, *msg_q_hdr, *dbg_q_hdr;
	uint32_t hw_version, fw_version, status = 0;
	uint32_t hw_version, soc_version, fw_version, status = 0;

	mutex_lock(&hfi_cmd_q_mutex);
	mutex_lock(&hfi_msg_q_mutex);
@@ -370,7 +374,7 @@ int cam_hfi_init(uint8_t event_driven_mode, struct hfi_mem_info *hfi_mem,

	memcpy(&g_hfi->map, hfi_mem, sizeof(g_hfi->map));
	g_hfi->hfi_state = HFI_DEINIT;

	soc_version = socinfo_get_version();
	if (debug) {
		cam_io_w_mb(
		(uint32_t)(ICP_FLAG_CSR_A5_EN | ICP_FLAG_CSR_WAKE_UP_EN |
@@ -382,7 +386,9 @@ int cam_hfi_init(uint8_t event_driven_mode, struct hfi_mem_info *hfi_mem,
		icp_base + HFI_REG_A5_CSR_A5_CONTROL);
	} else {
		cam_io_w((uint32_t)ICP_FLAG_CSR_A5_EN |
			ICP_FLAG_CSR_WAKE_UP_EN | ICP_CSR_EN_CLKGATE_WFI,
			ICP_FLAG_CSR_WAKE_UP_EN |
			((soc_version == SOC_VERSION_HW1) ?
			(ICP_CSR_EN_CLKGATE_WFI) : (0x0)),
			icp_base + HFI_REG_A5_CSR_A5_CONTROL);
	}

+2 −6
Original line number Diff line number Diff line
@@ -652,9 +652,7 @@ static int cam_icp_mgr_abort_handle(
		return -ENOMEM;

	abort_cmd.size =
		sizeof(struct hfi_cmd_ipebps_async) +
		sizeof(struct hfi_cmd_abort_destroy) -
		sizeof(abort_cmd.payload.direct);
		sizeof(struct hfi_cmd_ipebps_async);
	abort_cmd.pkt_type = HFI_CMD_IPEBPS_ASYNC_COMMAND_DIRECT;
	if (ctx_data->icp_dev_acquire_info->dev_type == CAM_ICP_RES_TYPE_BPS)
		abort_cmd.opcode = HFI_IPEBPS_CMD_OPCODE_BPS_ABORT;
@@ -706,9 +704,7 @@ static int cam_icp_mgr_destroy_handle(
		return -ENOMEM;

	destroy_cmd.size =
		sizeof(struct hfi_cmd_ipebps_async) +
		sizeof(struct ipe_bps_destroy) -
		sizeof(destroy_cmd.payload.direct);
		sizeof(struct hfi_cmd_ipebps_async);
	destroy_cmd.pkt_type = HFI_CMD_IPEBPS_ASYNC_COMMAND_DIRECT;
	if (ctx_data->icp_dev_acquire_info->dev_type == CAM_ICP_RES_TYPE_BPS)
		destroy_cmd.opcode = HFI_IPEBPS_CMD_OPCODE_BPS_DESTROY;
+32 −3
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ static const char drv_name[] = "vfe_bus";
#define CAM_VFE_RDI_BUS_DEFAULT_WIDTH           0xFF01
#define CAM_VFE_RDI_BUS_DEFAULT_STRIDE          0xFF01

#define ALIGNUP(value, alignment) \
	((value + alignment - 1) / alignment * alignment)

#define MAX_BUF_UPDATE_REG_NUM   \
	(sizeof(struct cam_vfe_bus_ver2_reg_offset_bus_client)/4)
#define MAX_REG_VAL_PAIR_SIZE    \
@@ -732,8 +735,21 @@ static int cam_vfe_bus_acquire_wm(
		rsrc_data->index == 7 || rsrc_data->index == 8) {
		/* Write master 3, 4 - for Full OUT , 7-8  FD OUT */
		switch (rsrc_data->format) {
		case CAM_FORMAT_UBWC_NV12:
		case CAM_FORMAT_UBWC_NV12_4R:
			rsrc_data->en_ubwc = 1;
			rsrc_data->width = ALIGNUP(rsrc_data->width, 64);
			switch (plane) {
			case PLANE_C:
				rsrc_data->height /= 2;
				break;
			case PLANE_Y:
				break;
			default:
				CAM_ERR(CAM_ISP, "Invalid plane %d\n", plane);
				return -EINVAL;
			}
			break;
		case CAM_FORMAT_UBWC_NV12:
			rsrc_data->en_ubwc = 1;
			/* Fall through for NV12 */
		case CAM_FORMAT_NV21:
@@ -751,9 +767,22 @@ static int cam_vfe_bus_acquire_wm(
			break;
		case CAM_FORMAT_UBWC_TP10:
			rsrc_data->en_ubwc = 1;
			/* Fall through for LINEAR TP10 */
			rsrc_data->width =
				ALIGNUP(rsrc_data->width, 48) * 4 / 3;
			switch (plane) {
			case PLANE_C:
				rsrc_data->height /= 2;
				break;
			case PLANE_Y:
				break;
			default:
				CAM_ERR(CAM_ISP, "Invalid plane %d\n", plane);
				return -EINVAL;
			}
			break;
		case CAM_FORMAT_TP10:
			rsrc_data->width = rsrc_data->width * 4 / 3;
			rsrc_data->width =
				ALIGNUP(rsrc_data->width, 3) * 4 / 3;
			switch (plane) {
			case PLANE_C:
				rsrc_data->height /= 2;