|
@@ -15,6 +15,11 @@ u32 get_hfi_port(struct msm_vidc_inst *inst,
|
|
|
{
|
|
|
u32 hfi_port = HFI_PORT_NONE;
|
|
|
|
|
|
+ if (!inst) {
|
|
|
+ d_vpr_e("%s: invalid params\n", __func__);
|
|
|
+ return hfi_port;
|
|
|
+ }
|
|
|
+
|
|
|
if (is_decode_session(inst)) {
|
|
|
switch(port) {
|
|
|
case INPUT_PORT:
|
|
@@ -58,6 +63,11 @@ u32 get_hfi_port_from_buffer_type(struct msm_vidc_inst *inst,
|
|
|
{
|
|
|
u32 hfi_port = HFI_PORT_NONE;
|
|
|
|
|
|
+ if (!inst) {
|
|
|
+ d_vpr_e("%s: invalid params\n", __func__);
|
|
|
+ return hfi_port;
|
|
|
+ }
|
|
|
+
|
|
|
if (is_decode_session(inst)) {
|
|
|
switch(buffer_type) {
|
|
|
case MSM_VIDC_BUF_INPUT:
|
|
@@ -199,6 +209,11 @@ u32 hfi_buf_type_to_driver(enum msm_vidc_domain_type domain,
|
|
|
|
|
|
u32 get_hfi_codec(struct msm_vidc_inst *inst)
|
|
|
{
|
|
|
+ if (!inst) {
|
|
|
+ d_vpr_e("%s: invalid params\n", __func__);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
switch (inst->codec) {
|
|
|
case MSM_VIDC_H264:
|
|
|
if (inst->domain == MSM_VIDC_ENCODER)
|
|
@@ -225,6 +240,11 @@ u32 get_hfi_colorformat(struct msm_vidc_inst *inst,
|
|
|
{
|
|
|
u32 hfi_colorformat = HFI_COLOR_FMT_NV12_UBWC;
|
|
|
|
|
|
+ if (!inst) {
|
|
|
+ d_vpr_e("%s: invalid params\n", __func__);
|
|
|
+ return hfi_colorformat;
|
|
|
+ }
|
|
|
+
|
|
|
switch(colorformat) {
|
|
|
case MSM_VIDC_FMT_NV12:
|
|
|
hfi_colorformat = HFI_COLOR_FMT_NV12;
|