From patchwork Wed Feb 19 20:35:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 11392383 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B1A3924 for ; Wed, 19 Feb 2020 20:35:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7722208C4 for ; Wed, 19 Feb 2020 20:35:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7722208C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44C6F6EC9B; Wed, 19 Feb 2020 20:35:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id BDF976EC9B; Wed, 19 Feb 2020 20:35:47 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2020 12:35:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,461,1574150400"; d="scan'208";a="224621092" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga007.jf.intel.com with SMTP; 19 Feb 2020 12:35:44 -0800 Received: by stinkbox (sSMTP sendmail emulation); Wed, 19 Feb 2020 22:35:44 +0200 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Subject: [PATCH 00/12] drm: Put drm_display_mode on diet Date: Wed, 19 Feb 2020 22:35:32 +0200 Message-Id: <20200219203544.31013-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Ville Syrjälä struct drm_display_mode is extremely fat. Put it on diet. Some stats for the whole series: 64bit sizeof(struct drm_display_mode): 200 -> 136 bytes (-32%) 64bit bloat-o-meter -c drm.ko: add/remove: 1/0 grow/shrink: 29/47 up/down: 893/-1544 (-651) Function old new delta ... Total: Before=189430, After=188779, chg -0.34% add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) Data old new delta Total: Before=11667, After=11667, chg +0.00% add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-16896 (-16896) RO Data old new delta edid_4k_modes 1000 680 -320 edid_est_modes 3400 2312 -1088 edid_cea_modes_193 5400 3672 -1728 drm_dmt_modes 17600 11968 -5632 edid_cea_modes_1 25400 17272 -8128 Total: Before=71239, After=54343, chg -23.72% 64bit bloat-o-meter drm.ko: add/remove: 1/0 grow/shrink: 29/52 up/down: 893/-18440 (-17547) ... Total: Before=272336, After=254789, chg -6.44% 32bit sizeof(struct drm_display_mode): 184 -> 120 bytes (-34%) 32bit bloat-o-meter -c drm.ko add/remove: 1/0 grow/shrink: 19/21 up/down: 743/-1368 (-625) Function old new delta ... Total: Before=172359, After=171734, chg -0.36% add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) Data old new delta Total: Before=4227, After=4227, chg +0.00% add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-16896 (-16896) RO Data old new delta edid_4k_modes 920 600 -320 edid_est_modes 3128 2040 -1088 edid_cea_modes_193 4968 3240 -1728 drm_dmt_modes 16192 10560 -5632 edid_cea_modes_1 23368 15240 -8128 Total: Before=59230, After=42334, chg -28.53% 32bit bloat-o-meter drm.ko: add/remove: 1/0 grow/shrink: 19/26 up/down: 743/-18264 (-17521) ... Total: Before=235816, After=218295, chg -7.43% Some ideas for further reduction: - Convert mode->name to a pointer (saves 24/28 bytes in the struct but would often require a heap alloc for the name (though typical mode name is <10 bytes so still overall win perhaps) - Get rid of mode->name entirely? I guess setcrtc & co. is the only place where we have to preserve the user provided name, elsewhere could pehaps just generate on demand? Not sure how tricky this would get. - Eliminate the second list head somehow? Pie in the sky idea: - Eliminate the normal vs. crtc_ dual timings where not needed. Ie. Just use two structs if necessary instead of packing both to the same struct. Can't imagine this being an easy conversion. Entire series available here: git://github.com/vsyrjala/linux.git drm_mode_diet_4 Ville Syrjälä (12): drm: Nuke mode->hsync drm/exynos: Use mode->clock instead of reverse calculating it from the vrefresh drm/i915: Introduce some local intel_dp variables drm: Nuke mode->vrefresh drm/msm/dpu: Stop copying around mode->private_flags drm: Shrink {width,height}_mm to u16 drm: Shrink mode->type to u8 drm: Make mode->flags u32 drm: Shrink drm_display_mode timings drm: Flatten drm_mode_vrefresh() drm: Shrink mode->private_flags drm: pahole struct drm_display_mode drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/drm_client_modeset.c | 2 +- drivers/gpu/drm/drm_edid.c | 328 +++++++++--------- drivers/gpu/drm/drm_modes.c | 54 +-- drivers/gpu/drm/drm_probe_helper.c | 3 - drivers/gpu/drm/exynos/exynos7_drm_decon.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 5 +- drivers/gpu/drm/exynos/exynos_mixer.c | 2 +- drivers/gpu/drm/i2c/ch7006_mode.c | 1 - drivers/gpu/drm/i915/display/intel_display.c | 2 - .../drm/i915/display/intel_display_debugfs.c | 4 +- drivers/gpu/drm/i915/display/intel_dp.c | 24 +- drivers/gpu/drm/i915/display/intel_tv.c | 3 - drivers/gpu/drm/mcde/mcde_dsi.c | 6 +- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- drivers/gpu/drm/meson/meson_venc_cvbs.c | 2 - drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 29 +- drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h | 10 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 5 +- drivers/gpu/drm/panel/panel-arm-versatile.c | 4 - drivers/gpu/drm/panel/panel-boe-himax8279d.c | 3 +- .../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 +- .../gpu/drm/panel/panel-feixin-k101-im2ba02.c | 3 +- .../drm/panel/panel-feiyang-fy07024di26a30d.c | 3 +- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 7 - drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 3 +- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 4 +- .../gpu/drm/panel/panel-jdi-lt070me05000.c | 3 +- .../drm/panel/panel-kingdisplay-kd097d04.c | 3 +- .../drm/panel/panel-leadtek-ltk500hd1829.c | 3 +- drivers/gpu/drm/panel/panel-lg-lb035q02.c | 1 - drivers/gpu/drm/panel/panel-lg-lg4573.c | 3 +- drivers/gpu/drm/panel/panel-nec-nl8048hl11.c | 1 - drivers/gpu/drm/panel/panel-novatek-nt39016.c | 1 - .../drm/panel/panel-olimex-lcd-olinuxino.c | 1 - .../gpu/drm/panel/panel-orisetech-otm8009a.c | 3 +- .../drm/panel/panel-osd-osd101t2587-53ts.c | 3 +- .../drm/panel/panel-panasonic-vvx10f034n00.c | 3 +- .../drm/panel/panel-raspberrypi-touchscreen.c | 4 +- drivers/gpu/drm/panel/panel-raydium-rm67191.c | 3 +- drivers/gpu/drm/panel/panel-raydium-rm68200.c | 3 +- .../drm/panel/panel-rocktech-jh057n00900.c | 5 +- drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 1 - drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 6 - drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 4 +- .../gpu/drm/panel/panel-samsung-s6e63j0x03.c | 3 +- drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 3 +- .../panel/panel-samsung-s6e88a0-ams452ef01.c | 1 - drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 3 +- .../gpu/drm/panel/panel-sharp-lq101r1sx01.c | 3 +- .../gpu/drm/panel/panel-sharp-ls037v7dw01.c | 1 - .../gpu/drm/panel/panel-sharp-ls043t1le01.c | 3 +- drivers/gpu/drm/panel/panel-simple.c | 85 +---- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 2 +- .../gpu/drm/panel/panel-sitronix-st7789v.c | 3 +- drivers/gpu/drm/panel/panel-sony-acx424akp.c | 2 - drivers/gpu/drm/panel/panel-sony-acx565akm.c | 1 - drivers/gpu/drm/panel/panel-tpo-td028ttec1.c | 1 - drivers/gpu/drm/panel/panel-tpo-td043mtea1.c | 1 - drivers/gpu/drm/panel/panel-tpo-tpg110.c | 5 - drivers/gpu/drm/panel/panel-truly-nt35597.c | 1 - .../gpu/drm/panel/panel-xinpeng-xpp055c272.c | 3 +- drivers/gpu/drm/sti/sti_hda.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 - include/drm/drm_modes.h | 211 +++++------ 66 files changed, 341 insertions(+), 568 deletions(-) Acked-by: Linus Walleij