Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1853673rwi; Tue, 11 Oct 2022 01:00:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM514HqIFMKBJvBl36neaGMg/gjrlHz2tK+WJQH1csU9DIiuFEqcymE6PGbjwLvcVXYR1P9t X-Received: by 2002:a17:90b:48c1:b0:20c:8edd:59a3 with SMTP id li1-20020a17090b48c100b0020c8edd59a3mr18382736pjb.222.1665475210592; Tue, 11 Oct 2022 01:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665475210; cv=none; d=google.com; s=arc-20160816; b=PSrknG0OwfxlWFZUTO9zPZzJQ5yR7Rfj2BFwaIMxRlUOR+vFbbPqKeXHwqrsOOd/B1 onURaqeYmaNxrc0rztgEoVxdwY+kGW1uKfqBpuvp4+8NSVY9bo9Q3hKad+NAj29khqXz ueMNAHYnbkY5s8DSDePE+XWtsW3u7afKHYtNcAioIvSxGQ4yYKtkw3WRYJeKhIAtErxr QEqjYHoyV7w52WUyjM7RWA2Mvm1aTAYsVgXnbbr0gLu7RC6i4sg4pzj9XKbtBDCrsfY2 IOmf0hxVnDKyFNssruazq5ECS9FdHrs9pQUywyTWG0V8hSpXlM4u3Gt7F5Hz6bkGFLHG u8xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=cXPnOYlfnpHgNPGaEpeAWTLVkzt1UqQ+8fSI+TaC1JM=; b=gE1aKkj9RmTjG7NbWVZfYAWZpB+kDnMzABy+RgpdobK4mO06CO/OcX40vFEU+6RYb4 505DshHftJxe3HP0ZrxGjQ9TG47GIqy0ynm9FTx41Ez9UthSzmhkJXOonurCXYX5IwXS RLBz0zv6K09Zn2O8nF22pjjy8ji8923xXOW6hQwh18cJXyyvprUtW9WBXL/QCDjgArU1 Xi/YRQQqIeLEyBYaOvNuzOX744EGd81BPBuHKbzS3ibWHGTWbfdoAGFvLIxYouXedSom uXKDEVcdOAa0lgZc3IBEzpxZl8KOCHu7a0W+xuNgOKbdozcJNDdZDVtWWuPtP11Sam8K TYmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i190-20020a6387c7000000b0043486074814si10732213pge.661.2022.10.11.00.59.58; Tue, 11 Oct 2022 01:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229734AbiJKHvZ (ORCPT + 99 others); Tue, 11 Oct 2022 03:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbiJKHvY (ORCPT ); Tue, 11 Oct 2022 03:51:24 -0400 Received: from relay02.th.seeweb.it (relay02.th.seeweb.it [5.144.164.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DCFEDAF for ; Tue, 11 Oct 2022 00:51:23 -0700 (PDT) Received: from SoMainline.org (94-209-172-39.cable.dynamic.v4.ziggo.nl [94.209.172.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 3D3FC2063E; Tue, 11 Oct 2022 09:51:21 +0200 (CEST) Date: Tue, 11 Oct 2022 09:51:19 +0200 From: Marijn Suijten To: Dmitry Baryshkov Cc: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Vinod Koul , Douglas Anderson , Vladimir Lypak , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 10/10] drm/msm/dsi: Prevent signed BPG offsets from bleeding into adjacent bits Message-ID: <20221011075119.tvn5j5jm6aqnhqv2@SoMainline.org> Mail-Followup-To: Marijn Suijten , Dmitry Baryshkov , phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Vinod Koul , Douglas Anderson , Vladimir Lypak , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20221009184824.457416-1-marijn.suijten@somainline.org> <20221009185316.462522-3-marijn.suijten@somainline.org> <408bf6a2-47fe-3eaf-7235-578d33a576c9@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <408bf6a2-47fe-3eaf-7235-578d33a576c9@linaro.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-10-09 22:14:16, Dmitry Baryshkov wrote: > On 09/10/2022 21:53, Marijn Suijten wrote: > > The bpg_offset array contains negative BPG offsets which fill the full 8 > > bits of a char thanks to two's complement: this however results in those > > bits bleeding into the next field when the value is packed into DSC PPS > > by the drm_dsc_helper function, which only expects range_bpg_offset to > > contain 6-bit wide values. As a consequence random slices appear > > corrupted on-screen (tested on a Sony Tama Akatsuki device with sdm845). > > > > Use AND operators to limit these two's complement values to 6 bits, > > similar to the AMD and i915 drivers. > > > > Fixes: b9080324d6ca ("drm/msm/dsi: add support for dsc data") > > Signed-off-by: Marijn Suijten > > > Reviewed-by: Dmitry Baryshkov > > Side note: the DSC params tables are more or less common between amd, > i916 and msm drivers. It might be worth moving them to the DSC helpers > from the individual drivers. This would mean such masks handling can go > into the helper too. I'll queue this up in my list and perhaps tackle it in the next round of DSC fixes, assuming things don't get too big. If there are no more reviews I'll respin v4 with your review picked up and patch 7/10 reworked or reordered to have access to the msm_host pointer added in 8/10 (see kernel test robot mail). - Marijn