From patchwork Tue Jun 5 04:50:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 10447573 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C31C560375 for ; Tue, 5 Jun 2018 04:51:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3D4428CFB for ; Tue, 5 Jun 2018 04:51:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A808C28DE3; Tue, 5 Jun 2018 04:51:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DFE128CFB for ; Tue, 5 Jun 2018 04:51:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750951AbeFEEvD (ORCPT ); Tue, 5 Jun 2018 00:51:03 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:46602 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbeFEEvC (ORCPT ); Tue, 5 Jun 2018 00:51:02 -0400 Received: by mail-pl0-f67.google.com with SMTP id 30-v6so723778pld.13 for ; Mon, 04 Jun 2018 21:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=0j10SFpfgOwS3Egif94FW53mrI/T10K/7lUhCCwcN+s=; b=BgnKN94eXpyzdnAAHwxIbjNjFpY7FqT5pSCByQMtHG+lRsBe2nawtieLFe+redq82E ihMqz3W5W7CJ6R3mqtIFMRtmRhi63BIhOTKBwEQCjqdNWtLW8Mqc5K9lv1uX5Q4h7jAt DNnR2fw06vImTBnzaomr08+FJaARfc2r2LUlk= 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; bh=0j10SFpfgOwS3Egif94FW53mrI/T10K/7lUhCCwcN+s=; b=VYrbnTIL8/wR99tldm5kcmeTj0hgJETiDc8pus3RjkZHhBtO4bKphiK5yS4blaYcZ7 yh5QHbA/r3vHzk8SNyYk4e6nbBhxjJmX3AdnZx+BTgmewdY3nBG1Xcx0ykJEEi/YpZiO 6lDMu3impx6yoxYLoYiZEOrJxys+jwdpcTbXjA4VVkpgmK88gNZUktMGlRg/85YvtVZk d5fB47b4DtZ4QSycrpd5C7gTv0AekONPh7TJqbgMQAN/DFv1NZO0FEOjA61Q0JlDjE5P HtQzJoOmMBXzRcHPs5jN60cs9BmRYhnlZla8OtPjO+ch/mNPxPp3VCzvClBKZvck3RBr 3Q9g== X-Gm-Message-State: ALKqPwd/VzzTS/TkTfF2rBcdpcDHhqvjEsSRVGGGd/GiyjVjHYvtnpCH 6T7Cdu9fmbA4xo3tA5kSBrzMoA== X-Google-Smtp-Source: ADUXVKK/snK9reGVhPIBr1AdkJEorcQnQxFBvosPHFOY3cbnCUuzaZVNsBNw2YTqDOD5u+74LkYBMw== X-Received: by 2002:a17:902:4603:: with SMTP id o3-v6mr25427680pld.49.1528174261543; Mon, 04 Jun 2018 21:51:01 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:4:4:9712:8cf1:d0f:7d33]) by smtp.gmail.com with ESMTPSA id g4-v6sm42504033pfg.38.2018.06.04.21.50.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 21:51:01 -0700 (PDT) From: Alexandre Courbot To: Stanimir Varbanov Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH] media: venus: keep resolution when adjusting format Date: Tue, 5 Jun 2018 13:50:46 +0900 Message-Id: <20180605045046.200011-1-acourbot@chromium.org> X-Mailer: git-send-email 2.17.1.1185.g55be947832-goog Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When checking a format for validity, the resolution is reset to 1280x720 whenever the pixel format is not supported. This behavior can mislead user-space into believing that this is the only resolution supported, and looks strange considering that if we try/set the same format with just the pixel format changed to a valid one, the call will this time succeed without altering the resolution. Resolution is managed independently of the pixel format, so remove this reset. Signed-off-by: Alexandre Courbot Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/vdec.c | 2 -- drivers/media/platform/qcom/venus/venc.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 49bbd1861d3a..f89a91d43cc9 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -173,8 +173,6 @@ vdec_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f) else return NULL; fmt = find_format(inst, pixmp->pixelformat, f->type); - pixmp->width = 1280; - pixmp->height = 720; } pixmp->width = clamp(pixmp->width, inst->cap_width.min, diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 6b2ce479584e..11dafc7848c5 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -297,8 +297,6 @@ venc_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f) else return NULL; fmt = find_format(inst, pixmp->pixelformat, f->type); - pixmp->width = 1280; - pixmp->height = 720; } pixmp->width = clamp(pixmp->width, inst->cap_width.min,