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

Commit 30cbaa18 authored by Sowmya Pandiri's avatar Sowmya Pandiri
Browse files

msm: vidc: Determine DPB-OPB split mode based on bit depth



This includes changes in vidc driver to rely both on Luma and
Chroma bit depth to determine output2 dithering.
It also includes some other minor fixes.

Change-Id: I95d07b43763e1e89c0583e6bc80d7bfab80bf52b
Signed-off-by: default avatarSowmya Pandiri <spandiri@codeaurora.org>
parent 095c42a3
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ static enum msm_vidc_pixel_depth get_hal_pixel_depth(u32 hfi_bit_depth)
{
	switch (hfi_bit_depth) {
	case HFI_BITDEPTH_8: return MSM_VIDC_BIT_DEPTH_8;
	case HFI_BITDEPTH_9:
	case HFI_BITDEPTH_10: return MSM_VIDC_BIT_DEPTH_10;
	}
	dprintk(VIDC_ERR, "Unsupported bit depth: %d\n", hfi_bit_depth);
@@ -104,7 +105,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
	struct hfi_bit_depth *pixel_depth;
	u8 *data_ptr;
	int prop_id;
	u8 luma_bit_depth = 0, chroma_bit_depth = 0;
	enum msm_vidc_pixel_depth luma_bit_depth, chroma_bit_depth;

	if (sizeof(struct hfi_msg_event_notify_packet) > pkt->size) {
		dprintk(VIDC_ERR,
@@ -160,28 +161,31 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
				pixel_depth = (struct hfi_bit_depth *) data_ptr;
				/*
				 * Luma and chroma can have different bitdepths.
				 * Driver will rely only on luma bitdepth for
				 * determining output bitdepth type.
				 * Driver should rely on luma and chroma
				 * bitdepth for determining output bitdepth
				 * type.
				 *
				 * pixel_depth->bitdepth will include luma
				 * bitdepth info in bits 0..15 and chroma
				 * bitdept in bits 16..31.
				 */
				luma_bit_depth =
					pixel_depth->bit_depth & GENMASK(15, 0);
				event_notify.bit_depth =
					get_hal_pixel_depth(luma_bit_depth);
				dprintk(VIDC_DBG, "luma bitdepth: %d\n",
					event_notify.bit_depth);
				chroma_bit_depth =
				luma_bit_depth = get_hal_pixel_depth(
					pixel_depth->bit_depth &
					GENMASK(31, 16);
				if (get_hal_pixel_depth(chroma_bit_depth) !=
					event_notify.bit_depth)
					dprintk(VIDC_WARN,
						"chroma_bit_depth(%d) != luma_bit_depth(%d)\n",
						chroma_bit_depth,
						luma_bit_depth);
					GENMASK(15, 0));
				chroma_bit_depth = get_hal_pixel_depth(
					(pixel_depth->bit_depth &
					GENMASK(31, 16)) >> 16);
				if (luma_bit_depth == MSM_VIDC_BIT_DEPTH_10 ||
					chroma_bit_depth ==
						MSM_VIDC_BIT_DEPTH_10)
					event_notify.bit_depth =
						MSM_VIDC_BIT_DEPTH_10;
				else
					event_notify.bit_depth = luma_bit_depth;
				dprintk(VIDC_DBG,
					"bitdepth(%d), luma_bit_depth(%d), chroma_bit_depth(%d)\n",
					event_notify.bit_depth, luma_bit_depth,
					chroma_bit_depth);
				data_ptr += sizeof(struct hfi_bit_depth);
				break;
			default:
+1 −0
Original line number Diff line number Diff line
@@ -1130,6 +1130,7 @@ static int __unset_imem(struct venus_hfi_device *device)
	rc = __core_in_valid_state(device);
	if (!rc) {
		dprintk(VIDC_WARN, "Core is in bad state, won't unset imem\n");
		rc = -EINVAL;
		goto imem_unset_failed;
	}