From patchwork Wed Oct 19 21:35:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 5852 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp547108wrs; Wed, 19 Oct 2022 14:41:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49boFH1yNT8XYjsjDv97UCwxoEOqmZD+lO68wOyuAf0WlrtCD5e5uAu6SewcVZiDwyrnHm X-Received: by 2002:a17:907:6e9e:b0:78c:5533:4158 with SMTP id sh30-20020a1709076e9e00b0078c55334158mr8040162ejc.417.1666215673040; Wed, 19 Oct 2022 14:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666215673; cv=none; d=google.com; s=arc-20160816; b=ChEwdVPGQkkwS4v9nR2nCMrPfb2VHmiSatck68BPon1WN72fx14JjXEDWBUJmVyl5t ZGJcZZaQUjEOe1MYC9mlw7rFvzOaU9F1iIRQkW60bo+TPsOL7VjDjKuSjcIhDlJTy9ai sj9+yvYuPt3mzDYDBybJ2T5Z1rjgk8xoKYSvli1XCeGeRlSj+68MSYbbgrz8KYK6nyKn k1taj3Pbc4+ZhSmvffCSKwes/PQqPMwVKpE2Bdr6TW9SOeBF9uG+867Az04teewLdwxo p+BnKdGc5ccCmnJaUu9flk9gJYnIb3cW3f3Tggj/brUZeHrIsLPLqR2imoyxIvyeYbuI AHdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language:cc:to :subject:from:user-agent:mime-version:date:message-id:dkim-signature; bh=yiqpubSSRjqi+xo3Zt6mRBDg4WQe+McsHWUueSRR8rc=; b=v56QV8+4ShrN3pfRvlqIiYiEKq3gkIHbvQQ88ymhD5c8WfZCDkM6MUmIb+EUlC9+Oz 6vsL1ILA3RWWIL3QF3dKDS4I45N3KS17SyuGPRDXXy2JvINTpyDdr2IfLdKRRpvo5bTd 8+qSctVufYWrtfkH6dUsY22WJIirj3Y51ITb5GF+dLqAQxK/DxwjWmMiWDsl0xQavThy IWPQKzK3aGvTaVDtN8WjCxM5Z4ajag25rqkpWer1gJeSzFdzsO5M3Al4qciaNYjZ4uqo q6/vHZk/G2rhrvaAOZQ9D9fb476kL36Uc87D3LFOwyX6VqrKOtvHNOImcgkhgcPyivhd Ping== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZVPAHbEC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a50c408000000b0045744c3c3d8si14085158edf.515.2022.10.19.14.40.48; Wed, 19 Oct 2022 14:41:13 -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=@gmail.com header.s=20210112 header.b=ZVPAHbEC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbiJSVfS (ORCPT + 99 others); Wed, 19 Oct 2022 17:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbiJSVfM (ORCPT ); Wed, 19 Oct 2022 17:35:12 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EFFD107A9F for ; Wed, 19 Oct 2022 14:35:07 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id a67so27128828edf.12 for ; Wed, 19 Oct 2022 14:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=yiqpubSSRjqi+xo3Zt6mRBDg4WQe+McsHWUueSRR8rc=; b=ZVPAHbECm9m1eYbMBBh9dm9FZ/PRwITiBRs6KLA8kM4fWSiN6WK8hRCLJA3OYDEkrm ajNYPk9TcK/15qfelg34GMb1JG5u6n68n4/ipxOk0IqHwLoTULy3Wxv/iqWvsR0oBjjn 9ynUYvg6TuCuclTLiQ3uctoTFs6UQkUCRuz4qMOV0dMPouTfTaYNqDq+Jywr4gFmAg8x dfFIODgyW5KcsvbZyrGeFA9B5ZgfmmxKwD4UQXIZL0owjwst7MYYXyPsbjGMVo8k61DI P1ZBdj9Zn38YNki9eyU0x1HVKadKQdTzYQYQtAyyPzIJlQJmxBpnHRk5qChQ8D1jwO0z aQVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=yiqpubSSRjqi+xo3Zt6mRBDg4WQe+McsHWUueSRR8rc=; b=rO7gUT781RriFTE1krvxu3hRc1/yOdvfnMXKpyLGqIJmQOfubn4tUdHbuyW8MYueVt 4CLvuF3MLf+bfp5ID4+KjtgHJEuSXtBEUMBJLsJF2tTB65sGCGN39rOTcJrA8GeZPqHm NE/uFi+30atI5dYLH+BSqySrnwtACpgo4hbZHhmee4znDUB5EookT/oP6Pwd6q1HAntn 0H3+r2aBTYuySDkgEqVQmfspN8Ud4ealhRjG1WkZLGrCtp8UZjBra74yds/Apgsf4bid BpOnlqW+AbMsgQEmw7XJ38jbAs5gJeeME+KOgxy+ylVFMmi7xxTSfEecS0Yc72AAkKh/ VRZg== X-Gm-Message-State: ACrzQf1ipZQoWL3jt6wz5Vjq12ex2iFV0RpRUJxgnMGrHWJPCkp6AEl1 5bCHUSc21Thc/WTHI1jakdl/C6QP16U= X-Received: by 2002:a05:6402:360d:b0:459:5f40:5b0a with SMTP id el13-20020a056402360d00b004595f405b0amr9017951edb.168.1666215305362; Wed, 19 Oct 2022 14:35:05 -0700 (PDT) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id bs15-20020a170906d1cf00b0077958ddaec6sm9232118ejb.186.2022.10.19.14.35.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:35:04 -0700 (PDT) Message-ID: Date: Wed, 19 Oct 2022 23:35:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 From: Johan Jonker Subject: [PATCH v1] drm: rockchip: remove rockchip_drm_framebuffer_init() function To: john@metanate.com Cc: heiko@sntech.de, hjc@rock-chips.com, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Language: en-US X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747153765452787224?= X-GMAIL-MSGID: =?utf-8?q?1747153765452787224?= The function rockchip_drm_framebuffer_init() was in use in the rockchip_drm_fbdev.c file, but that is now replaced by a generic fbdev setup. Reduce the image size by removing the rockchip_drm_framebuffer_init() and sub function rockchip_fb_alloc() and cleanup the rockchip_drm_fb.h header file. Signed-off-by: Johan Jonker Reviewed-by: John Keeping --- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 43 ---------------------- drivers/gpu/drm/rockchip/rockchip_drm_fb.h | 6 --- 2 files changed, 49 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 092bf863110b..409eaa1bf092 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c @@ -25,35 +25,6 @@ static const struct drm_framebuffer_funcs rockchip_drm_fb_funcs = { .dirty = drm_atomic_helper_dirtyfb, }; -static struct drm_framebuffer * -rockchip_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, - struct drm_gem_object **obj, unsigned int num_planes) -{ - struct drm_framebuffer *fb; - int ret; - int i; - - fb = kzalloc(sizeof(*fb), GFP_KERNEL); - if (!fb) - return ERR_PTR(-ENOMEM); - - drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd); - - for (i = 0; i < num_planes; i++) - fb->obj[i] = obj[i]; - - ret = drm_framebuffer_init(dev, fb, &rockchip_drm_fb_funcs); - if (ret) { - DRM_DEV_ERROR(dev->dev, - "Failed to initialize framebuffer: %d\n", - ret); - kfree(fb); - return ERR_PTR(ret); - } - - return fb; -} - static const struct drm_mode_config_helper_funcs rockchip_mode_config_helpers = { .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, }; @@ -106,20 +77,6 @@ static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = { .atomic_commit = drm_atomic_helper_commit, }; -struct drm_framebuffer * -rockchip_drm_framebuffer_init(struct drm_device *dev, - const struct drm_mode_fb_cmd2 *mode_cmd, - struct drm_gem_object *obj) -{ - struct drm_framebuffer *fb; - - fb = rockchip_fb_alloc(dev, mode_cmd, &obj, 1); - if (IS_ERR(fb)) - return ERR_CAST(fb); - - return fb; -} - void rockchip_drm_mode_config_init(struct drm_device *dev) { dev->mode_config.min_width = 0; diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.h b/drivers/gpu/drm/rockchip/rockchip_drm_fb.h index 1a696521096d..bae4e079dfb1 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.h @@ -7,11 +7,5 @@ #ifndef _ROCKCHIP_DRM_FB_H #define _ROCKCHIP_DRM_FB_H -struct drm_framebuffer * -rockchip_drm_framebuffer_init(struct drm_device *dev, - const struct drm_mode_fb_cmd2 *mode_cmd, - struct drm_gem_object *obj); -void rockchip_drm_framebuffer_fini(struct drm_framebuffer *fb); - void rockchip_drm_mode_config_init(struct drm_device *dev); #endif /* _ROCKCHIP_DRM_FB_H */