From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 1/2] drm: add plane support Date: Tue, 08 Nov 2011 17:50:51 +0000 Message-ID: References: <1320773933-23158-1-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 29EFB9E7CE for ; Tue, 8 Nov 2011 09:51:02 -0800 (PST) In-Reply-To: <1320773933-23158-1-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Jesse Barnes , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, 8 Nov 2011 09:38:52 -0800, Jesse Barnes wrote: > +int drm_mode_getplane(struct drm_device *dev, void *data, > + struct drm_file *file_priv) > +{ > + struct drm_mode_get_plane *plane_resp = data; > + struct drm_mode_object *obj; > + struct drm_plane *plane; > + uint32_t __user *format_ptr; > + int ret = 0; > + > + if (!drm_core_check_feature(dev, DRIVER_MODESET)) > + return -EINVAL; > + > + mutex_lock(&dev->mode_config.mutex); > + obj = drm_mode_object_find(dev, plane_resp->plane_id, > + DRM_MODE_OBJECT_PLANE); > + if (!obj) { > + ret = -EINVAL; > + goto out; > + } We had begun to use ENOENT for failure to find the specified object to give a little variation to our error codes. Still not very widespread, but I think a good practice to encourage :) -Chris -- Chris Wilson, Intel Open Source Technology Centre