Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758054AbcCCO7w (ORCPT ); Thu, 3 Mar 2016 09:59:52 -0500 Received: from mga14.intel.com ([192.55.52.115]:37802 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754675AbcCCO7t (ORCPT ); Thu, 3 Mar 2016 09:59:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,532,1449561600"; d="scan'208";a="916146898" Subject: Re: [PATCH] staging/android: refactor SYNC_IOC_FILE_INFO To: Gustavo Padovan , Greg Kroah-Hartman References: <1456948331-7300-5-git-send-email-gustavo@padovan.org> <1457015665-7534-1-git-send-email-gustavo@padovan.org> Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, dri-devel@lists.freedesktop.org, Daniel Stone , =?UTF-8?Q?Arve_Hj=c3=b8nnev=c3=a5g?= , Riley Andrews , Daniel Vetter , Rob Clark , Greg Hackmann , John Harrison , Gustavo Padovan From: Maarten Lankhorst Message-ID: <56D85161.6070503@linux.intel.com> Date: Thu, 3 Mar 2016 15:59:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1457015665-7534-1-git-send-email-gustavo@padovan.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1124 Lines: 27 Op 03-03-16 om 15:34 schreef Gustavo Padovan: > From: Gustavo Padovan > > Change SYNC_IOC_FILE_INFO behaviour to avoid future API breaks and > optimize buffer > > Now num_fences can be filled by the caller to inform how many fences it > wants to retrieve from the kernel. If the num_fences passed is greater > than zero info->sync_fence_info should point to a buffer with enough space > to fit all fences. > > However if num_fences passed to the kernel is 0, the kernel will reply > with number of fences of the sync_file. > > Sending first an ioctl with num_fences = 0 can optimize buffer allocation, > in a first call with num_fences = 0 userspace will receive the actual > number of fences in the num_fences filed. > > Then it can allocate a buffer with the correct size on sync_fence_info and > call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences > in the sync_file. > > Also, info->sync_fence_info was converted to __u64 pointer to prevent > 32bit compatibility issues. For this patch and 6/6: Reviewed-by: Maarten Lankhorst