From patchwork Wed Jun 12 01:16:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 10988397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C67E014C0 for ; Wed, 12 Jun 2019 01:25:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1BAF28306 for ; Wed, 12 Jun 2019 01:25:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A03B42837D; Wed, 12 Jun 2019 01:25:34 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 16CE828306 for ; Wed, 12 Jun 2019 01:25:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A85C8800A; Wed, 12 Jun 2019 01:25:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id C6A9F891D6 for ; Wed, 12 Jun 2019 01:25:32 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id s11so8543059pfm.12 for ; Tue, 11 Jun 2019 18:25:32 -0700 (PDT) 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=/4mZhjz2dkfafdy2bqfClO5VTqYAkHEFd5uOF7sABt0=; b=gwnaaUoP52UHFGFFNPoPYbR6MTfY0Z5xMbjbHoHPoFccoBFO4LnuYtDxt1vG+oHogE +hTBO63fjJFDugtmzwpNs2I705W3CrUEvJM54UyLGxhW6iN+P8OAC7KEKLrW0sl/Lesf 74SJ3a7svlCZr9dZLBQe4Mw2Hf9oD87jQHoF1kstQg2R6ux7ZqW7Wv4NvkYEWZbS76gQ TGu+5LdBpUbKgHJ05KtepXShkRT7KV6zbQ5AqSVKctPKE2iyGokYqg5xillf0mSd7kDe Pw78U+z+hwXLuL+oVgoGTOokIsTrubrs0OOlCSpnT/oxkrJ/TYNTkmZtbo91XyIeLA+i ZzEA== X-Gm-Message-State: APjAAAXRclc4PUp8vhrxZn8zGps5G39irSQyy/L02uLorJwRD+Qphyql NXLPXAXHCscsU84Z3VlRYis= X-Google-Smtp-Source: APXvYqx8w3UNZJYyEfyesl8GJz44ySL1V6YwpvRUhn3tlhK/Vom10lrDEoqmya0nS0qFRQcHkUOFAA== X-Received: by 2002:a17:90a:290b:: with SMTP id g11mr29801294pjd.122.1560302225650; Tue, 11 Jun 2019 18:17:05 -0700 (PDT) Received: from mappy.world.mentorg.com (c-107-3-185-39.hsd1.ca.comcast.net. [107.3.185.39]) by smtp.gmail.com with ESMTPSA id y22sm13257015pgj.38.2019.06.11.18.17.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 18:17:05 -0700 (PDT) From: Steve Longerbeam To: Philipp Zabel Subject: [PATCH 2/3] gpu: ipu-v3: image-convert: Fix input bytesperline for packed formats Date: Tue, 11 Jun 2019 18:16:56 -0700 Message-Id: <20190612011657.12119-2-slongerbeam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190612011657.12119-1-slongerbeam@gmail.com> References: <20190612011657.12119-1-slongerbeam@gmail.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/4mZhjz2dkfafdy2bqfClO5VTqYAkHEFd5uOF7sABt0=; b=PmVQmVsONHga6z7L+7IIh6Vn/kPjgNT39RFZMidKSw3Pgd/4JDPThUO75CI9v/y44p CecZm6fAk7kAc/6KJJ2TC/0a2uH5FikGxfqcCFyimpHf/N9hXZ1ErtF870SdTKdGIwM2 BY07MsFVyL9kUD155wafDB6U621Vj+775KUvYStLxHoNpiZULS67vpHLWfo8CoZEx2Jm jhmb15UNv70f9hPKn7B9FLK0adghG3I/eJVS4tsA+fn+Cg6xwPL8ORyr87boMRkPg5cf FdDkHxtnXxH5asbRveQGAFLr5nPthyykU2pHMDlKujuK/iZbRsTHykR9f4KBamyhsP9C Qoww== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: open list , "open list:DRM DRIVERS FOR FREESCALE IMX" , Steve Longerbeam MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The input bytesperline calculation for packed pixel formats was incorrect. The min/max clamping values must be multiplied by the packed bits-per-pixel. This was causing corrupted converted images when the input format was RGB4 (probably also other input packed formats). Fixes: d966e23d61a2c ("gpu: ipu-v3: image-convert: fix bytesperline adjustment") Reported-by: Harsha Manjula Mallikarjun Suggested-by: Harsha Manjula Mallikarjun Signed-off-by: Steve Longerbeam --- drivers/gpu/ipu-v3/ipu-image-convert.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c index 36eb4c77ad91..4dfdbd1adf0d 100644 --- a/drivers/gpu/ipu-v3/ipu-image-convert.c +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c @@ -1933,7 +1933,9 @@ void ipu_image_convert_adjust(struct ipu_image *in, struct ipu_image *out, clamp_align(in->pix.width, 2 << w_align_in, MAX_W, w_align_in) : clamp_align((in->pix.width * infmt->bpp) >> 3, - 2 << w_align_in, MAX_W, w_align_in); + ((2 << w_align_in) * infmt->bpp) >> 3, + (MAX_W * infmt->bpp) >> 3, + w_align_in); in->pix.sizeimage = infmt->planar ? (in->pix.height * in->pix.bytesperline * infmt->bpp) >> 3 : in->pix.height * in->pix.bytesperline;