From patchwork Wed Nov 23 02:57:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 24666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2561205wrr; Tue, 22 Nov 2022 19:02:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VMsEW+obcmcnR5PBhLPDJCG1cZjLnvDSFyDgxeN07mWnmMkaQDlylfsHtI/yukNCkxrXR X-Received: by 2002:aa7:d915:0:b0:463:69bc:c574 with SMTP id a21-20020aa7d915000000b0046369bcc574mr6471709edr.120.1669172529417; Tue, 22 Nov 2022 19:02:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669172529; cv=none; d=google.com; s=arc-20160816; b=jhyzLRvJhxFA1PojgWLN24sg0U9bGqBVrNAuPzQ0jDGQ7XUTJKRZuO3adOEV9x0naQ Fos/4+gN0KPYwE9XQp5NL/yXO2KdDcqLpD3l2iKgwnULUDDPRBCuQQmQqCsgW9E4nFwL i/xwwIXmLN47SjsBESr8bXO742Ic+iqGUgwvchMT7bJYyjSXQKeIy1KdwfguhNLMc9fa St6Am9aTpRiRgTsjjdTmTrKwr9QKWKaaT8wFd5QI314KxWNG0QeldN6MjWE6eMwzvcBz Tjj+cDB/MVt7wxOzbSATnmSQtDbkmQljYgD/E6OB3ALm3DUGg8OkTWsDuy1ONd53u7CS 8jEg== 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=c0o+rgAl7XGjA4x2ambd4yZ/NvHelqFuRLXuNf/0VyPcpOKKxjBX4TxuhkFKvdZS8Q Oo5D4bHIy2/V4hKTMmVZRcyZhE2/1PXHmtpGxwLTq5CfvbMU4g7bGXfBYo58dlPkoH3D BrZvHKk32BcxIwPWZehTHxToQm78cqMUKgbEDmy9SedyK8nGsqo0CHM95ZKkZciLadQV 1cxkuMJFMLEjcmQKvORxNU/elbBR0lcKeAV67ocZr1A7LPLR+oGKaPUJ4b3ogXlONUok xmjnw07ncnXnOt89p5iEW1x+rmL3ivvTdDALSljHU98TH+iqIzJBHeUYJy0xl3+YB5+c k9CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=diTafuuS; 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 d13-20020a05640208cd00b004680dc9f654si12341264edz.266.2022.11.22.19.01.43; Tue, 22 Nov 2022 19:02:09 -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=diTafuuS; 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 S235417AbiKWDAn (ORCPT + 99 others); Tue, 22 Nov 2022 22:00:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235305AbiKWDAW (ORCPT ); Tue, 22 Nov 2022 22:00:22 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 979257A349 for ; Tue, 22 Nov 2022 19:00:21 -0800 (PST) Received: from dimapc.. (109-252-117-140.nat.spd-mgts.ru [109.252.117.140]) (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 B44986602AF2; Wed, 23 Nov 2022 03:00:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1669172420; bh=yM5EklsLIeVBROoe840u6b3fWDQRZvJbUhCX8eobLRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=diTafuuSfJ3e6j4bOXS82lvtpcTDl5JupHdWUjZZt4ZUqEtU+hxE39me0iWB3ha1p DbtwZIjN/x7xV/ZPQ/pbiNVNIzXdIMnV/U6B0DTU5hQmb1v7BloTpCY8+5fKSsQeny ZaisB5RKbcLusbfRgJCDR9j/J8HfZw+fC1LhNYfhS2k18KPLPwP0QLq5orugizN67W CXhTfUoFqrFl/VA5EHJa/WNZQtG4fx9gTzeKNJgDNdSVXhY8GD/k4BNRf2+GIB+ycI SRjzS9of/yZHrVE07S2sfapc0C6Q0eaIebAjxyBBM9FpZ/DVDSAk7X4gkU9Rr04RK7 iwkyw76FR84Zw== 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 v9 04/11] drm/shmem: Put booleans in the end of struct drm_gem_shmem_object Date: Wed, 23 Nov 2022 05:57:16 +0300 Message-Id: <20221123025723.695075-5-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123025723.695075-1-dmitry.osipenko@collabora.com> References: <20221123025723.695075-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?1750254254243269568?= X-GMAIL-MSGID: =?utf-8?q?1750254254243269568?= 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 --- 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) \