Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp257331rwn; Thu, 8 Sep 2022 00:44:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/JMs4DrL+OBhMYkUvm3YLXHfhwFHgW6KubLH5atgSL+7yfoIF5LgUZT+LtWw9O63FJ1Zu X-Received: by 2002:a17:907:2bf7:b0:730:996d:5e8d with SMTP id gv55-20020a1709072bf700b00730996d5e8dmr5262570ejc.382.1662623081093; Thu, 08 Sep 2022 00:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662623081; cv=none; d=google.com; s=arc-20160816; b=flUMjuGEjMaa7cGg3AL9yiif/TQLhDepNluSGFpz8suKiLbfqMMQoHhk95NcxKfd6o zoafPBFshxRSXVUnRdx9wkvgAixQywbRkgbgAQNGQLguRAT58hOVTh1gxAz4jmZJjSS3 eNGiVMSY443zvusXlUQQ1LXDu81frd5kmMaHgbl1uCs5nj+gE4cN1Ut1GERV1KnvLGMq uBSze1zUr2VMQtQtpGm61qmG6wkCwwIeHy8dpyKBtBHMZe/MOtFimb6qvphGTV7WNv3I 7K5HPnVMMRZLgAnTJ3ubG8R6KXI0s1oK2GZfMaCSfIyaOeWEY9m83wV9C1h3DlViauOf o7cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=05prRc5uExrMT0Vk3okKpPoY7SXNt+UhxP/bsRnaYk0=; b=aItoRZVYoRyN2OF59Rz+wzAX4FRz+1WTtwCDuzHhCej2G8Vf/zOlOQP4w5Ben018If UcysE2Ii1XbzOVreOtV9R0Y8ZrVw/HB3xRo7KTtRGy2A+e5WBOoKE3993e0FSV/cTBB6 Q6hlFjTC7+lgeKAuXTpxhiN0nTl27J32MbU0PP/ERQkHOD9j1PHuJ9U4SqqaUnlXxNFr iAO/YMmPCUf6BoB7gSsHYtfXo9HQxVVVpJEUKx5ObUmnhjq2IYIPZdb6mu/yRvU0p0kV 1u4QsYTsLOCdMaYBLXIyJqHH1p50Cyf7uz8uuEhVNV54BFJgOl/5rK/jvxSaSSrKYy2L x3UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="l0W6RM+/"; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb17-20020a1709076d9100b00730551afa8esi1642805ejc.885.2022.09.08.00.44.15; Thu, 08 Sep 2022 00:44:41 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="l0W6RM+/"; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231255AbiIHHCS (ORCPT + 99 others); Thu, 8 Sep 2022 03:02:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbiIHHCH (ORCPT ); Thu, 8 Sep 2022 03:02:07 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83947D075F for ; Thu, 8 Sep 2022 00:02:01 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D4FA121DC8; Thu, 8 Sep 2022 07:01:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662620519; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=05prRc5uExrMT0Vk3okKpPoY7SXNt+UhxP/bsRnaYk0=; b=l0W6RM+/bnVwMP+41irYKecVevuCbsliyv1+2+1NiCeqHv6op4FMdT7QZ2c3/Ex5/n3kHA sh5HPwiKo0HBTjMB4j2TBoWUmaP5F/C73e3uHIwSGzg9xAhEXLMo6tkObpDz66/yw7o5/R OYu29WQzNvT3eudXvK+ro494OD4yMPc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662620519; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=05prRc5uExrMT0Vk3okKpPoY7SXNt+UhxP/bsRnaYk0=; b=bj0vhHtDkuCSq/VU4oUWan3SaOe1iapHYcDTHIT/0dxWG76e674aQgkn0FjXUkWJVhzI37 5eTxALlgRr1AQcAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B4BBA1322C; Thu, 8 Sep 2022 07:01:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1vpZK2eTGWPfRQAAMHmgww (envelope-from ); Thu, 08 Sep 2022 07:01:59 +0000 Date: Thu, 08 Sep 2022 09:01:59 +0200 Message-ID: <87v8pycpso.wl-tiwai@suse.de> From: Takashi Iwai To: Thomas Zimmermann Cc: Takashi Iwai , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 07/11] drm/udl: Drop unneeded alignment In-Reply-To: <8291de03-c5b5-e744-62f0-8755c6eada4a@suse.de> References: <20220906073951.2085-1-tiwai@suse.de> <20220906073951.2085-8-tiwai@suse.de> <8291de03-c5b5-e744-62f0-8755c6eada4a@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Wed, 07 Sep 2022 09:29:37 +0200, Thomas Zimmermann wrote: > > Hi > > Am 06.09.22 um 09:39 schrieb Takashi Iwai: > > The alignment of damaged area was needed for the original udlfb driver > > that tried to trim the superfluous copies between front and backend > > buffers and handle data in long int. It's not the case for udl DRM > > driver, hence we can omit the whole unneeded alignment, as well as the > > dead code. > > > > Signed-off-by: Takashi Iwai > > Acked-by: Thomas Zimmermann > > with an entirely optional comment below. > > > --- > > drivers/gpu/drm/udl/udl_modeset.c | 28 +-------------------- > > drivers/gpu/drm/udl/udl_transfer.c | 40 ------------------------------ > > 2 files changed, 1 insertion(+), 67 deletions(-) > > > > diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c > > index c34d564773a3..9896c16c74f5 100644 > > --- a/drivers/gpu/drm/udl/udl_modeset.c > > +++ b/drivers/gpu/drm/udl/udl_modeset.c > > @@ -243,28 +243,6 @@ static long udl_log_cpp(unsigned int cpp) > > return __ffs(cpp); > > } > > -static int udl_aligned_damage_clip(struct drm_rect *clip, int x, > > int y, > > - int width, int height) > > -{ > > - int x1, x2; > > - > > - if (WARN_ON_ONCE(x < 0) || > > - WARN_ON_ONCE(y < 0) || > > - WARN_ON_ONCE(width < 0) || > > - WARN_ON_ONCE(height < 0)) > > - return -EINVAL; > > - > > - x1 = ALIGN_DOWN(x, sizeof(unsigned long)); > > - x2 = ALIGN(width + (x - x1), sizeof(unsigned long)) + x1; > > - > > - clip->x1 = x1; > > - clip->y1 = y; > > - clip->x2 = x2; > > - clip->y2 = y + height; > > - > > - return 0; > > -} > > - > > static int udl_handle_damage(struct drm_framebuffer *fb, > > const struct iosys_map *map, > > int x, int y, int width, int height) > > @@ -282,11 +260,7 @@ static int udl_handle_damage(struct drm_framebuffer *fb, > > return ret; > > log_bpp = ret; > > - ret = udl_aligned_damage_clip(&clip, x, y, width, height); > > - if (ret) > > - return ret; > > - else if ((clip.x2 > fb->width) || (clip.y2 > fb->height)) > > - return -EINVAL; > > + drm_rect_init(&clip, x, y, width, height); > > The clip rectangle could be passed directly by the caller, which would > simplify the update function. But that's really just nitpicking. OK, will add a patch to do this, too :) thanks, Takashi