Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751977AbdFSUlV convert rfc822-to-8bit (ORCPT ); Mon, 19 Jun 2017 16:41:21 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:56739 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019AbdFSUlT (ORCPT ); Mon, 19 Jun 2017 16:41:19 -0400 Date: Mon, 19 Jun 2017 22:41:06 +0200 From: Boris Brezillon To: Peter Rosin Cc: linux-kernel@vger.kernel.org, David Airlie , Daniel Vetter , Jani Nikula , Sean Paul , dri-devel@lists.freedesktop.org Subject: Re: [PATCH v3 2/3] drm/fb-cma-helper: expose more of fb cma guts Message-ID: <20170619224106.24a9dafc@bbrezillon> In-Reply-To: <1497858266-17844-3-git-send-email-peda@axentia.se> References: <1497858266-17844-1-git-send-email-peda@axentia.se> <1497858266-17844-3-git-send-email-peda@axentia.se> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 943 Lines: 24 Le Mon, 19 Jun 2017 09:44:25 +0200, Peter Rosin a écrit : > DRM drivers supporting clut may want a convenient way to only use > non-default .gamma_set and .gamma_get ops in the drm_fb_helper_funcs > in order to avoid the following > > /* > * 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; > > warning in drm_fb_helper.c:setcolreg(). Did you read the FIXME in the struct doc [1]? Shouldn't we try to move to this generic approach instead of exposing fb_cma internals? You could probably mimic (or re-use) what's done in drm_mode_gamma_set/get_ioctl() [2]. [1]http://elixir.free-electrons.com/linux/v4.12-rc6/source/include/drm/drm_fb_helper.h#L110 [2]http://elixir.free-electrons.com/linux/v4.12-rc6/source/drivers/gpu/drm/drm_color_mgmt.c#L214