Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755298AbcKJLDb (ORCPT ); Thu, 10 Nov 2016 06:03:31 -0500 Received: from mga07.intel.com ([134.134.136.100]:60409 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754654AbcKJLDa (ORCPT ); Thu, 10 Nov 2016 06:03:30 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,618,1473145200"; d="scan'208";a="784816439" From: Jani Nikula To: Laurent Pinchart Cc: Eric Engestrom , Daniel Vetter , Eric Engestrom , Linux Kernel Mailing List , David Airlie , dri-devel , Wei Yongjun , Daniel Vetter , Flora Cui , Gustavo Padovan , Tom St Denis , Chunming Zhou , Thomas Hellstrom , Laurent Pinchart , Sinclair Yeh , Xinliang Liu , Xinwei Kong , VMware Graphics , Vitaly Prosyak , Alexandre Demers , intel-gfx , Emily Deng , Colin Ian King , Junwei Zhang , Michel =?utf-8?Q?D=C3=A4nzer?= , Alex Deucher , Christian =?utf-8?Q?K=C3=B6nig?= Subject: Re: [Intel-gfx] [PATCH v3] drm: move allocation out of drm_get_format_name() In-Reply-To: <1577179.SKedfdZVPT@avalon> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20161108101558.ihvrprbbdqjwu5wg@phenom.ffwll.local> <2360827.8WFanMYCQ1@avalon> <871syjfwzy.fsf@intel.com> <1577179.SKedfdZVPT@avalon> Date: Thu, 10 Nov 2016 13:03:20 +0200 Message-ID: <87pom3egw7.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1651 Lines: 36 On Thu, 10 Nov 2016, Laurent Pinchart wrote: > Hi Jani, > > On Thursday 10 Nov 2016 12:30:09 Jani Nikula wrote: >> On Thu, 10 Nov 2016, Laurent Pinchart wrote: >> > The issue here is that printk can't format the fourcc as a string by >> > itself. There's a bunch of places in the kernel where a similar >> > formatting problem occurs. In a few occasions it has been solved by >> > extending printk with additional format specifiers (such as for MAC/IP >> > addresses, GUIDs, various kind of device names, ...). DRM fourccs are >> > probably too DRM specific to be worth a format specifier, but I wonder >> > whether we could introduce a new specifier that takes a function pointer >> > as a formatting helper. Another similarly crazy option would be a format >> > specifier for strings that would free the passed pointer after printing >> > it. >> >> I think there are too many non-standard format specifiers already. I >> can't review the non-standard format strings without looking at >> Documentation/prink-formats.txt first. The formatting hook would be a >> generic alternative, but that's more than a little scary from the >> security standpoint. And what if the hook has to allocate memory? Can't >> do that in atomic contexts. > > There are lots of details to sort out obviously and I don't have an answer to > all questions yet. I think it would be worth researching this, as the problem > isn't specific to DRM/KMS. That's easy to agree to; as much as you didn't mean to shoot down the patch, I didn't mean to shoot down your idea! :) BR, Jani. -- Jani Nikula, Intel Open Source Technology Center