From patchwork Thu Jun 15 23:03:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9795003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B6FE600C5 for ; Mon, 19 Jun 2017 01:09:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C18C26E46 for ; Mon, 19 Jun 2017 01:09:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10BEF27F98; Mon, 19 Jun 2017 01:09:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6AA4D26E46 for ; Mon, 19 Jun 2017 01:09:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0848E6E0C0; Mon, 19 Jun 2017 01:09:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0111.outbound.protection.outlook.com [104.47.2.111]) by gabe.freedesktop.org (Postfix) with ESMTPS id E246B6E008 for ; Fri, 16 Jun 2017 01:34:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentiatech.onmicrosoft.com; s=selector1-axentia-se; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0kO6ykiqCJKC1eRwYF0CwHi9Zj7haG7ImwF/Kp4upfw=; b=V9LyHOkSaG7AAKcH9XPJ6cbVSMfsGHMgZaj8ZC3v+T9Vy3T1Say8Y3a7nJEC6cxlbo0jAjwCQseS4Qr1Rzr18KUXIIsWF6k6Sv379bRmI23hRcXx0x8kcqbQoRK5WPguDe0/KHlRBRSZrJDI/UDI11HXs+kxcpfid3lDaW9TBaM= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=axentia.se; Received: from [192.168.0.125] (81.224.171.159) by VI1PR0202MB2560.eurprd02.prod.outlook.com (2603:10a6:801:6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Thu, 15 Jun 2017 23:03:31 +0000 Subject: Re: Color lookup support for the atmel-hlcdc driver From: Peter Rosin To: Boris Brezillon References: <9b09c7fe-cf5c-fe48-2bdf-d7ac692da2e1@axentia.se> <20170613173030.4c846d2e@bbrezillon> <20170615121558.13fd212d@bbrezillon> <30b52b65-bad9-d51e-d09e-52695b0ed859@axentia.se> <20170615135430.5067af84@bbrezillon> <077c7d8f-991d-017a-a310-f7f8eeee86f5@axentia.se> Organization: Axentia Technologies AB Message-ID: Date: Fri, 16 Jun 2017 01:03:27 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <077c7d8f-991d-017a-a310-f7f8eeee86f5@axentia.se> Content-Language: en-US X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: DB6PR07CA0081.eurprd07.prod.outlook.com (2603:10a6:6:2b::19) To VI1PR0202MB2560.eurprd02.prod.outlook.com (2603:10a6:801:6::11) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR0202MB2560: X-MS-Office365-Filtering-Correlation-Id: 62019ac2-57bf-47b2-c441-08d4b442be4a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075); SRVR:VI1PR0202MB2560; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2560; 3:M1vX20si2lw8yge4dTxwuac9p+3PNUbo8ePdfW1n2yc8FsNHxhh9Si6N1Fla+P2d1YZnm83DGBkf/wESMmwXorJGXPTu773FShCK2KarMKFkVs0okVb/SmgZHAXbMw3QoM1XjH0yUEvTh8ALeEGtDUU20nHb8Flr12/fqklHFYbKTrZg9XfRsyiu602f1PbSELeYyD30AEUW5rrsvaFZpx20aV1d6zCVDUeAZx8fvkorGXlZ0LhV5pKcKez/VBeZ3yiSm9c1ju6QaH2sgNey2jD78pY2x67vhZpdUEMzLogKr5o3baIi5kKzs7xWTMwK; 25:yuip1Wt1cel95PmCx36L4lpbYIP9e6j/dlHCMOe3S92uYDRm/cwIq2lsoNgf7hBYwCx8UoCmvSL6TYegNSyM1gO7ogC2l4Ar9LyBwjaBnHJCnS7TRsKy2trAg1907RerCvgRunIX+NT8+6odOQpSzLx41lYE4DJeVES/ysHvYvyLGjG4fDlvt8lNOO73wXjtxLMeO44dKWfxFJT4R9i4G2UZrujvjjWPKW0z3fH9M6KTnyrnIQ5IjF7ZsPxiByP5mV9EVZpK+aMGmb0Ltyn4V0Bj34WVbtKEVfeH+T9kc5BaBTAhF5vQXxvxffR3Zm1yxLpMeQhEbTTmRnFY0Cz4I6TKuZRwUNE9+1Ln7F+wwp/tZmBxdEJePO0qqb40ZYkZDzi2XDf1BOKBxmObUx0BNWAQOE4vFC8wjA0MDdSahDY1sNoqSGq0PUJP7cSjkxAZz+dFYYVEKXGHQzDaQZZWN0Xs9VpCCZNGkAp3Mk0nQZI= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2560; 31:GHNKuR4J1ELjDQktCm1fksHgYALrFs48hgJ0w3qja7mOjHqfJguqOjza0EzIjbFF0nnlu3I0xXNDzrDrrmGq51RXYEAAIuD0Em4RX5ssojyx2bwR+VOActskRoxVoCCMhpjs/5NMLjjhPXK/kL/9trifKQwgzfUKrENzKT1FI/ckiGAVYqWXiH/GodI0AWrEXmoUvpXiL+rEe7IdfVLA2u201SFqNRHdWD0FmYLLx50FhShp6muBC8z9z/mDFPi46dQVGEVKQ9rlujK9/nZ5WA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(2016111802025)(20161123555025)(20161123562025)(20161123564025)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0202MB2560; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0202MB2560; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAyMDJNQjI1NjA7NDpLZTF5c1R0bk9GN0VicGxWU0ZQOTRsWUVu?= =?utf-8?B?ZTdKMy9QNzQ3TlNkbDY2UlN5aDJJV2VEMGhrSkRTeGh4RGdqNE5oRTR5Yjdl?= =?utf-8?B?VjNJZHJpNnVlanU1MnlNUEQrUkx2SStPbWFFQU9JUEk4WE1Rb3F4RzhEWndT?= =?utf-8?B?MWYrVVQ5VzMxOGsxNzRuQm5iNUc3c21PaFUrK2RNYXFFVmNrb1pQZm9HWGpZ?= =?utf-8?B?QlBGelRJSTlhRkZ4TXdFNUVTTEd4eFdPcjNJS3R3ZDBxS3lhdFRPNmk1aTlS?= =?utf-8?B?Y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oVUdwNVQ2VXA1WUx3ZWl5?= =?utf-8?B?QjF5Q1hzT2FGbUlsUGJZME52cGVMWWJibFdOaTR1NmFubkszWjIweHpxcGtI?= =?utf-8?B?U1llVFBXU3lJVXB2WHRTWSsvM2crbDhPZUVPcW15VlZpdmZXMWlFMy9JUXQr?= =?utf-8?B?MElXbTJMSG9xM0h3ZVpaSTZqWE9QU2x2c21NT0plUFZ5VkVjYzlJNitRdGhJ?= =?utf-8?B?SDlHZmVSQmNNa0lyYVhrUlNBMGFETW9peERnMzBNZnFGNDNERW1HakpOUXFu?= =?utf-8?B?VGUyWVg5OHN2emkvUE1kMkJOQkNDNDVlZ25WSGNFOWN3REhSbHRJdUFXTCtM?= =?utf-8?B?NmJLeHQyUjZGUTlRb2tJb1NreGc1dlkyc3l2UWtXL2hxSFpSY2VoRXZPSjJM?= =?utf-8?B?NjdzSi8vNGF0WGZBRTRVRHA1SmpMTzF1amVDV2dWWitTd1BqcnZ2M1l1b2ZN?= =?utf-8?Q?HP3B9GAlhB0PsV4kO6+4t?= X-Forefront-PRVS: 0339F89554 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6049001)(6009001)(39450400003)(39410400002)(39830400002)(39400400002)(377424004)(24454002)(47776003)(4001350100001)(230700001)(229853002)(53546009)(31696002)(25786009)(3260700006)(66066001)(117156002)(86362001)(93886004)(53936002)(31686004)(42186005)(33646002)(64126003)(50466002)(4326008)(8676002)(38730400002)(110136004)(81166006)(74482002)(65826007)(2906002)(50986999)(76176999)(54356999)(36756003)(6666003)(83506001)(5660300001)(478600001)(77096006)(6116002)(6486002)(3846002)(23676002)(305945005)(189998001)(7736002)(2950100002)(6916009)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0202MB2560; H:[192.168.0.125]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAyMDJNQjI1NjA7MjM6a09IRUlQSXhMWnRUVGJ0R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IuMb3pfvTdtcKjPYet0sm6lSTs+PPP4hTqMPNwGb+8rhDATmf5tb; 24:JQut/w7Ig8IbeM6nLQds1//wBYfAPJdeWf0JOSOVHAVcUJA4/5boAtSePta41uaOGxkhd16lrP2XPH8bCTuPwGgPyeWkAa/pNS7u5/Qszlw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2560; 7:AeMaqjx1yX7lV17RszXiIl7uh6JdtUwIjqCGouu0V88553Y6n2PZWOlZFJEvOtJhyBwVWbKkgHAUbICRh0+NrCHKFpQhrcYv7ybsLs+irs5YgKRwq1HKA/KXPwIcjzsz4kVEgI1KlzYF1g8XQ0D6lOz8cjnQgfKmeXYsCkuF/jUpFNlJynA9l0/x9ClcHnTVT3zbhg4XcdQk+0BZJlu6Lre27hv0loAlHP4Px3Mmy8ArkTYj8z3kq4RIAra1fU4wvGx72p0STeYyDef17vuQA8UFUiXccEbtfnY2H7jmEvHqsGXnNmtZu6B0t7jhfxiiG3dvpYuhuSjZ3EY1CinflA== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 23:03:31.4025 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0202MB2560 X-Mailman-Approved-At: Mon, 19 Jun 2017 01:09:41 +0000 Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 2017-06-16 01:01, Peter Rosin wrote: > So, is this below better? I'll follow-up with a patch I need for the > fbdev emulation to work. Without adding gamma callbacks in drm_fb_helper_funcs I hit /* * The driver really shouldn't advertise pseudo/directcolor * visuals if it can't deal with the palette. */ if (WARN_ON(!fb_helper->funcs->gamma_set || !fb_helper->funcs->gamma_get)) return -EINVAL; in drm_fb_helper.c:setcolreg(), so I need this patch which basically exposes some guts from fbdev_cma and glues it with the new clut handling in the atmel_hlcdc driver. Cheers, peda diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 68f5e66..2fb23aa 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -158,6 +158,54 @@ atmel_hlcdc_crtc_load_lut(struct drm_crtc *c) } } +void atmel_hlcdc_gamma_set(struct drm_crtc *c, + u16 r, u16 g, u16 b, int idx) +{ + struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); + struct drm_crtc_state *state = c->state; + struct drm_color_lut *lut; + + if (idx < 0 || idx > 255) + return; + + if (state->gamma_lut) { + lut = (struct drm_color_lut *)state->gamma_lut->data; + + lut[idx].red = r; + lut[idx].green = g; + lut[idx].blue = b; + } + + crtc->clut[idx] = ((r << 8) & 0xff0000) | (g & 0xff00) | (b >> 8); +} + +void atmel_hlcdc_gamma_get(struct drm_crtc *c, + u16 *r, u16 *g, u16 *b, int idx) +{ + struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); + struct drm_crtc_state *state = c->state; + struct drm_color_lut *lut; + + if (idx < 0 || idx > 255) + return; + + if (state->gamma_lut) { + lut = (struct drm_color_lut *)state->gamma_lut->data; + + *r = lut[idx].red; + *g = lut[idx].green; + *b = lut[idx].blue; + return; + } + + *r = (crtc->clut[idx] >> 8) & 0xff00; + *g = crtc->clut[idx] & 0xff00; + *b = (crtc->clut[idx] << 8) & 0xff00; + *r |= *r >> 8; + *g |= *g >> 8; + *b |= *b >> 8; +} + static void atmel_hlcdc_crtc_flush_lut(struct drm_crtc *c) { @@ -363,6 +411,7 @@ static const struct drm_crtc_helper_funcs lcdc_crtc_helper_funcs = { .mode_set = drm_helper_crtc_mode_set, .mode_set_nofb = atmel_hlcdc_crtc_mode_set_nofb, .mode_set_base = drm_helper_crtc_mode_set_base, + .load_lut = atmel_hlcdc_crtc_load_lut, .disable = atmel_hlcdc_crtc_disable, .enable = atmel_hlcdc_crtc_enable, .atomic_check = atmel_hlcdc_crtc_atomic_check, diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 4f6ef07..9a09c73 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -601,6 +601,12 @@ static int atmel_hlcdc_dc_modeset_init(struct drm_device *dev) return 0; } +static const struct drm_fb_helper_funcs atmel_hlcdc_fb_cma_helper_funcs = { + .gamma_set = atmel_hlcdc_gamma_set, + .gamma_get = atmel_hlcdc_gamma_get, + .fb_probe = drm_fbdev_cma_create, +}; + static int atmel_hlcdc_dc_load(struct drm_device *dev) { struct platform_device *pdev = to_platform_device(dev->dev); @@ -664,8 +670,10 @@ static int atmel_hlcdc_dc_load(struct drm_device *dev) platform_set_drvdata(pdev, dev); - dc->fbdev = drm_fbdev_cma_init(dev, 24, - dev->mode_config.num_connector); + dc->fbdev = drm_fbdev_cma_init_with_funcs2(dev, 24, + dev->mode_config.num_connector, + NULL, + &atmel_hlcdc_fb_cma_helper_funcs); if (IS_ERR(dc->fbdev)) dc->fbdev = NULL; diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h index a2cc2ab..2a4f874 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -446,6 +447,9 @@ void atmel_hlcdc_plane_irq(struct atmel_hlcdc_plane *plane); int atmel_hlcdc_plane_prepare_disc_area(struct drm_crtc_state *c_state); int atmel_hlcdc_plane_prepare_ahb_routing(struct drm_crtc_state *c_state); +void atmel_hlcdc_gamma_set(struct drm_crtc *c, u16 r, u16 g, u16 b, int idx); +void atmel_hlcdc_gamma_get(struct drm_crtc *c, u16 *r, u16 *g, u16 *b, int idx); + void atmel_hlcdc_crtc_irq(struct drm_crtc *c); int atmel_hlcdc_crtc_create(struct drm_device *dev); diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index 53f9bdf..db4e32f 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -426,7 +426,12 @@ static void drm_fbdev_cma_defio_fini(struct fb_info *fbi) kfree(fbi->fbops); } -static int +/** + * drm_fbdev_cma_create() - Default fb_probe() function for fb_cma_helper_funcs + * @helper: The fb_helper to create a cma for + * @sizes: The fbdev sizes + */ +int drm_fbdev_cma_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { @@ -507,23 +512,28 @@ drm_fbdev_cma_create(struct drm_fb_helper *helper, drm_gem_object_put_unlocked(&obj->base); return ret; } +EXPORT_SYMBOL_GPL(drm_fbdev_cma_create); static const struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { .fb_probe = drm_fbdev_cma_create, }; /** - * drm_fbdev_cma_init_with_funcs() - Allocate and initializes a drm_fbdev_cma struct + * drm_fbdev_cma_init_with_funcs2() - Allocate and initializes a drm_fbdev_cma struct * @dev: DRM device * @preferred_bpp: Preferred bits per pixel for the device * @max_conn_count: Maximum number of connectors - * @funcs: fb helper functions, in particular a custom dirty() callback + * @framebuffer_funcs: framebuffer functions, in particular a custom dirty() callback + * @fb_helper_funcs: fb helper functions, in particular custom gamma_set() and gamma_get() callbacks + * + * If framebuffer_funcs or fb_helper_funcs are NULL, default functions are used. * * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR. */ -struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev, +struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs2(struct drm_device *dev, unsigned int preferred_bpp, unsigned int max_conn_count, - const struct drm_framebuffer_funcs *funcs) + const struct drm_framebuffer_funcs *framebuffer_funcs, + const struct drm_fb_helper_funcs *fb_helper_funcs) { struct drm_fbdev_cma *fbdev_cma; struct drm_fb_helper *helper; @@ -534,11 +544,17 @@ struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev, dev_err(dev->dev, "Failed to allocate drm fbdev.\n"); return ERR_PTR(-ENOMEM); } - fbdev_cma->fb_funcs = funcs; + + if (!framebuffer_funcs) + framebuffer_funcs = &drm_fb_cma_funcs; + if (!fb_helper_funcs) + fb_helper_funcs = &drm_fb_cma_helper_funcs; + + fbdev_cma->fb_funcs = framebuffer_funcs; helper = &fbdev_cma->fb_helper; - drm_fb_helper_prepare(dev, helper, &drm_fb_cma_helper_funcs); + drm_fb_helper_prepare(dev, helper, fb_helper_funcs); ret = drm_fb_helper_init(dev, helper, max_conn_count); if (ret < 0) { @@ -568,6 +584,25 @@ struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev, return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(drm_fbdev_cma_init_with_funcs2); + +/** + * drm_fbdev_cma_init_with_funcs() - Allocate and initializes a drm_fbdev_cma struct + * @dev: DRM device + * @preferred_bpp: Preferred bits per pixel for the device + * @max_conn_count: Maximum number of connectors + * @framebuffer_funcs: framebuffer functions, in particular a custom dirty() callback + * + * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR. + */ +struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev, + unsigned int preferred_bpp, unsigned int max_conn_count, + const struct drm_framebuffer_funcs *framebuffer_funcs) +{ + return drm_fbdev_cma_init_with_funcs2(dev, preferred_bpp, + max_conn_count, + funcs, NULL); +} EXPORT_SYMBOL_GPL(drm_fbdev_cma_init_with_funcs); /** @@ -581,9 +616,9 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_init_with_funcs); struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev, unsigned int preferred_bpp, unsigned int max_conn_count) { - return drm_fbdev_cma_init_with_funcs(dev, preferred_bpp, - max_conn_count, - &drm_fb_cma_funcs); + return drm_fbdev_cma_init_with_funcs2(dev, preferred_bpp, + max_conn_count, + NULL, NULL); } EXPORT_SYMBOL_GPL(drm_fbdev_cma_init); diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h index 199a63f..280ec2b 100644 --- a/include/drm/drm_fb_cma_helper.h +++ b/include/drm/drm_fb_cma_helper.h @@ -15,13 +15,19 @@ struct drm_mode_fb_cmd2; struct drm_plane; struct drm_plane_state; +struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs2(struct drm_device *dev, + unsigned int preferred_bpp, unsigned int max_conn_count, + const struct drm_framebuffer_funcs *framebuffer_funcs, + const struct drm_fb_helper_funcs *fb_helper_funcs); struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev, unsigned int preferred_bpp, unsigned int max_conn_count, - const struct drm_framebuffer_funcs *funcs); + const struct drm_framebuffer_funcs *framebuffer_funcs); struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev, unsigned int preferred_bpp, unsigned int max_conn_count); void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma); +int drm_fbdev_cma_create(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes); void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma); void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma); void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state);