From patchwork Thu Jul 5 13:03:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141145 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1929668ljj; Thu, 5 Jul 2018 06:15:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd8J8dMm1rjRLl5Kjzyh5j/nqcOMq2s7fjCDPPTbEZ+RypOy6i5QI64005sRaGR5OmhufgB X-Received: by 2002:a17:902:b785:: with SMTP id e5-v6mr6160325pls.339.1530796517705; Thu, 05 Jul 2018 06:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796517; cv=none; d=google.com; s=arc-20160816; b=JgZKKHv/9Nr25pNkILMNT/iH8bkZv2JRg+uG5Ror3eYbqkx5uE9JJq7XOJlDOWFfP4 g4+NplzsIdgmXeAI9HpTimDEE7Y55rJB+7RaVsl/lpeI56H9A7jTHun/yYIT4sBVy01O Fc0PCRoYajpH3JMFcXeKHQEwFWE2xPorGgqGW1FpgHa9TAugqtAhZQK/Viblev71J7wA hdusvbYVqIGBaMRDkz2CG97frua+7GRv7NWiDJ//lyoH1LmtLZtLO9/iSN6NfP1SB3bi G+aV2awcaNnUjfSPxV5lN03k7KH3HCIdPRwwDuUvtEh9WseDo+9YuMms5feEKEhva5pN DYdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ogZkHBlueg2U6UdUxAxd4rT71LnMs9IaaVp6ldnz+nc=; b=cEMj1SvnGF1gTNEJHrcdmPUL/8TORI7rsBLrB5BXL8X+qYJtkUbuzQdB9I615PFqTh DMmVfuGmxwwfNeulMYxIht2ZvCbPhvZPX2XuJkP3kAR1MoUOFlpwxqInCVFz0oHw70LA 6pPIxNHrZY0TOrekdLKeCPVgHJc1LfLc8phjcuOf06n4QulfNvv2LQ1k4+SdzA+KX1zP pOqX/4wbtS1ew8ekzxb9/N/eaG80revihgXTBSQsQPEWO5Q3hVuUGept2g5IawoJ2WZC ghZ6CUT+eCyGsAPejfkQ1RctRNCpu9Dk18Gb9fO6ET0uILC3T1REmu1giebDsagQdGD4 hUIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Zq3sdWVl; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12-v6si5892737plo.264.2018.07.05.06.15.17; Thu, 05 Jul 2018 06:15:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Zq3sdWVl; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754447AbeGENPP (ORCPT + 13 others); Thu, 5 Jul 2018 09:15:15 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38062 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754186AbeGENFL (ORCPT ); Thu, 5 Jul 2018 09:05:11 -0400 Received: by mail-wm0-f54.google.com with SMTP id 69-v6so10663870wmf.3 for ; Thu, 05 Jul 2018 06:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IkTyFSrIU3t7cIZYL2XgO/R/eieXH0YtvjSnmpTxJrg=; b=Zq3sdWVl4EHBKIc++/cHAydxrVD6iRdMRWR6tdvJyNJ71fCSIoYqdriZMyXIuhN3BV u+YZAvePv1+hDkj6XKshWJx3Ijm3eAcgwqaY8g2x/Un7lB36798tMq1mZJAeUWCa9UHi LEHbMKs0HhbQvVRjVlrjSQKZs2btlBOON5Png= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IkTyFSrIU3t7cIZYL2XgO/R/eieXH0YtvjSnmpTxJrg=; b=WCTw//kONowXHmVx9c27uTJ/E/CRh5Q7OcJVP+aECpouzwHShf2mvPjLWVr/DPur6Q MF03CsfjTurH/pnb3rboJjLluXMt/8WknZfpDRolr9pzR+FcuuDEg6b4kD4OH3egh8aX tlOtp4PjFH+kA4HmndQ1SvWaKMt8Y0j1F3EFb2TICY6dL7kv5Fq6IrHPEfxuPI/4riHQ jA33Ts16IWMXZ5n/2K8lcd2B8paLsFq3YOuHFYUSq2OBNWwcaLPzmeyhYsFZzeMcITIk 8RRdUWhCfna6W2PWCOyz1MWKTKdp8HgeHiha2OBE1aBwBMZW4zTCITvubFhp88wFLwJK a+8Q== X-Gm-Message-State: APt69E032dUeNICNLijdBbjAzsOUk1XZ9Z+QXBfNAlXx8N+5bDTndPsA 6P8NlO6x2Fkw2RcV4XeJ+/xXqw== X-Received: by 2002:a1c:b286:: with SMTP id b128-v6mr3772787wmf.121.1530795909814; Thu, 05 Jul 2018 06:05:09 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:09 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 03/27] venus: hfi: update sequence event to handle more properties Date: Thu, 5 Jul 2018 16:03:37 +0300 Message-Id: <20180705130401.24315-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org HFI version 4xx can pass more properties in the sequence change event, extend the event structure with them. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi.h | 10 ++++++ drivers/media/platform/qcom/venus/hfi_helper.h | 28 ++++++++++++++++ drivers/media/platform/qcom/venus/hfi_msgs.c | 44 ++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/hfi.h b/drivers/media/platform/qcom/venus/hfi.h index 5466b7d60dd0..6038d8e0ab22 100644 --- a/drivers/media/platform/qcom/venus/hfi.h +++ b/drivers/media/platform/qcom/venus/hfi.h @@ -74,6 +74,16 @@ struct hfi_event_data { u32 tag; u32 profile; u32 level; + /* the following properties start appear from v4 onwards */ + u32 bit_depth; + u32 pic_struct; + u32 colour_space; + u32 entropy_mode; + u32 buf_count; + struct { + u32 left, top; + u32 width, height; + } input_crop; }; /* define core states */ diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index f5f1557b1176..1bc5aab1ce6b 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -801,6 +801,34 @@ struct hfi_h264_vui_timing_info { u32 time_scale; }; +struct hfi_bit_depth { + u32 buffer_type; + u32 bit_depth; +}; + +struct hfi_picture_type { + u32 is_sync_frame; + u32 picture_type; +}; + +struct hfi_pic_struct { + u32 progressive_only; +}; + +struct hfi_colour_space { + u32 colour_space; +}; + +struct hfi_extradata_input_crop { + u32 size; + u32 version; + u32 port_index; + u32 left; + u32 top; + u32 width; + u32 height; +}; + #define HFI_COLOR_FORMAT_MONOCHROME 0x01 #define HFI_COLOR_FORMAT_NV12 0x02 #define HFI_COLOR_FORMAT_NV21 0x03 diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index 589e1a6b36a9..54cd41e5837c 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -25,10 +25,16 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst, struct hfi_msg_event_notify_pkt *pkt) { + enum hfi_version ver = core->res->hfi_version; struct hfi_event_data event = {0}; int num_properties_changed; struct hfi_framesize *frame_sz; struct hfi_profile_level *profile_level; + struct hfi_bit_depth *pixel_depth; + struct hfi_pic_struct *pic_struct; + struct hfi_colour_space *colour_info; + struct hfi_buffer_requirements *bufreq; + struct hfi_extradata_input_crop *crop; u8 *data_ptr; u32 ptype; @@ -69,6 +75,44 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst, event.level = profile_level->level; data_ptr += sizeof(*profile_level); break; + case HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH: + data_ptr += sizeof(u32); + pixel_depth = (struct hfi_bit_depth *)data_ptr; + event.bit_depth = pixel_depth->bit_depth; + data_ptr += sizeof(*pixel_depth); + break; + case HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT: + data_ptr += sizeof(u32); + pic_struct = (struct hfi_pic_struct *)data_ptr; + event.pic_struct = pic_struct->progressive_only; + data_ptr += sizeof(*pic_struct); + break; + case HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE: + data_ptr += sizeof(u32); + colour_info = (struct hfi_colour_space *)data_ptr; + event.colour_space = colour_info->colour_space; + data_ptr += sizeof(*colour_info); + break; + case HFI_PROPERTY_CONFIG_VDEC_ENTROPY: + data_ptr += sizeof(u32); + event.entropy_mode = *(u32 *)data_ptr; + data_ptr += sizeof(u32); + break; + case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS: + data_ptr += sizeof(u32); + bufreq = (struct hfi_buffer_requirements *)data_ptr; + event.buf_count = HFI_BUFREQ_COUNT_MIN(bufreq, ver); + data_ptr += sizeof(*bufreq); + break; + case HFI_INDEX_EXTRADATA_INPUT_CROP: + data_ptr += sizeof(u32); + crop = (struct hfi_extradata_input_crop *)data_ptr; + event.input_crop.left = crop->left; + event.input_crop.top = crop->top; + event.input_crop.width = crop->width; + event.input_crop.height = crop->height; + data_ptr += sizeof(*crop); + break; default: break; }