From patchwork Sun Jan 8 21:04:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 40573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1851931wrt; Sun, 8 Jan 2023 13:08:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXvIE30NdnSENhjdWuRhQ5nulLZkcFhEroFeDQUxLoEkUzh9CE//XHWMpPjUtvLuk1CuG2uH X-Received: by 2002:a05:6a21:8dc9:b0:af:5125:bcdd with SMTP id ti9-20020a056a218dc900b000af5125bcddmr23795169pzb.55.1673212125874; Sun, 08 Jan 2023 13:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673212125; cv=none; d=google.com; s=arc-20160816; b=t0umxGW5VeBcLvCJbwDHf93FPU7KU6NJGNXFt5yFmyBtznc0DNLHdIZNgCIF75eNjX XeEcyyjV/14LpLp+TFojvRh2e0NBwHV8SH7zn6uxiWTsNhH4l2UTSZxNNHtxanv8zAjL mvGITqg8qNgn05yJ4avCjdWUP+6rQx8cmB/VZ/gnmJL0ogmtzqGFtWkwPKBoGobU1bWY qLM4yyJWRwqKtouoXqfcXd+Y97LYEkAFi8TtBhCwCOIvxVXZiF7VdRCOeC0mYhryfLkS wf9hFoMF1yy8TCzvoZLoiKjRoEwbhgMa2wdIo/jMyi1YEXGZkgkwnjo5eyyt71v42jC0 PCJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4esNUlxp4/XCtfoh6LzVcRv5HrWacewfClNKlFOWqaI=; b=X9CP8dL1sB6nlXf8aDZzYCDPZ+7ACJJ3ncJJi1hxxpmAwBG/JitZxn17wTR31I5+DA CSBrXbMZlzZINn3tMUkwEa3mnC/EIA0gqPjNPWo2Ie5vMrui7/I84EvAhXOMXwvUn4rt 3FvgSiPxsD4/7+WBH/JQKPaZPlCnIbYdHicHjO/d9GU+ZhiumRH7aiH1nPfpsOfcFUPB /U11/XtpA/XB2K9/efCkwNj9NsOQyhFcMNJC4aejRFbBCiVbp4JT4Akmf8z3B4pzAKTY PuDYAdQ2DHAVFzMz/oIn+mvnZztZIw22mhvzeEBq91125yEoxOTXQmYIcEP7lIVL/1KD dPfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=M7ndZjT3; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 78-20020a630251000000b0043c3f90f7c8si8184038pgc.655.2023.01.08.13.08.33; Sun, 08 Jan 2023 13:08:45 -0800 (PST) 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=@collabora.com header.s=mail header.b=M7ndZjT3; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231926AbjAHVF5 (ORCPT + 99 others); Sun, 8 Jan 2023 16:05:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236299AbjAHVFe (ORCPT ); Sun, 8 Jan 2023 16:05:34 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 297E1F033 for ; Sun, 8 Jan 2023 13:05:33 -0800 (PST) Received: from workpc.. (109-252-117-89.nat.spd-mgts.ru [109.252.117.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 910316602D53; Sun, 8 Jan 2023 21:05:25 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1673211931; bh=yM5EklsLIeVBROoe840u6b3fWDQRZvJbUhCX8eobLRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M7ndZjT3ePxUGP5TzZFQUodhYen26MBCIH+b2Sf5SYIkXVKUsbJngKFISUMTqoLxq fnNPqafIUpxQatwe1QTgvnwzgzk92Ns13EWOnjibLB9wH5h96wk+PQ1aBzn7QlK0t9 /GQe+Yb57/5UtShNRixe+aQ2uR0HF7V6cva+ceygZwwgRX38+fjVNXEATenaq2Pu8Q vgGH/vEeV04lE7Xk9hv6kw6NaHKhgbsAR9/JgovLvhQRy7m05mtWZXyRkp6cbinU5+ hlV16TqFdJXGnZNeQYHh0xchfFOLKTM3qzMSLGaH3fU3BsXnXHjyiix2io0ZE9cQa6 iAahvSDX79akQ== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Clark , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Qiang Yu , Steven Price , Alyssa Rosenzweig , Rob Herring , Sean Paul , Dmitry Baryshkov , Abhinav Kumar Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com, virtualization@lists.linux-foundation.org Subject: [PATCH v10 04/11] drm/shmem: Put booleans in the end of struct drm_gem_shmem_object Date: Mon, 9 Jan 2023 00:04:38 +0300 Message-Id: <20230108210445.3948344-5-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230108210445.3948344-1-dmitry.osipenko@collabora.com> References: <20230108210445.3948344-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754490078233137913?= X-GMAIL-MSGID: =?utf-8?q?1754490078233137913?= Group all 1-bit boolean members of struct drm_gem_shmem_object in the end of the structure, allowing compiler to pack data better and making code to look more consistent. Suggested-by: Thomas Zimmermann Signed-off-by: Dmitry Osipenko Reviewed-by: Thomas Zimmermann --- include/drm/drm_gem_shmem_helper.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h index a2201b2488c5..5994fed5e327 100644 --- a/include/drm/drm_gem_shmem_helper.h +++ b/include/drm/drm_gem_shmem_helper.h @@ -60,20 +60,6 @@ struct drm_gem_shmem_object { */ struct list_head madv_list; - /** - * @pages_mark_dirty_on_put: - * - * Mark pages as dirty when they are put. - */ - unsigned int pages_mark_dirty_on_put : 1; - - /** - * @pages_mark_accessed_on_put: - * - * Mark pages as accessed when they are put. - */ - unsigned int pages_mark_accessed_on_put : 1; - /** * @sgt: Scatter/gather table for imported PRIME buffers */ @@ -97,10 +83,24 @@ struct drm_gem_shmem_object { */ unsigned int vmap_use_count; + /** + * @pages_mark_dirty_on_put: + * + * Mark pages as dirty when they are put. + */ + bool pages_mark_dirty_on_put : 1; + + /** + * @pages_mark_accessed_on_put: + * + * Mark pages as accessed when they are put. + */ + bool pages_mark_accessed_on_put : 1; + /** * @map_wc: map object write-combined (instead of using shmem defaults). */ - bool map_wc; + bool map_wc : 1; }; #define to_drm_gem_shmem_obj(obj) \