From owner-freebsd-drivers@freebsd.org Fri Jul 1 08:37:08 2016 Return-Path: Delivered-To: freebsd-drivers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A342EB87824 for ; Fri, 1 Jul 2016 08:37:08 +0000 (UTC) (envelope-from kgshail@yahoo.com) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1.freebsd.org (Postfix) with ESMTP id 957C72121 for ; Fri, 1 Jul 2016 08:37:08 +0000 (UTC) (envelope-from kgshail@yahoo.com) Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id 424712B8899E for ; Fri, 1 Jul 2016 01:15:39 -0700 (PDT) Date: Fri, 1 Jul 2016 01:36:58 -0700 (MST) From: kgshail To: freebsd-drivers@freebsd.org Message-ID: <1467362218984-6110741.post@n5.nabble.com> Subject: /dev/dri/card0 gives ENOTTY error MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2016 08:37:08 -0000 Hi; I have written a driver based on DRM and created equivalent .ko file. The file I insmod are drm.ko, drm_kms_helper.ko and mydrm.ko. It calls my probe function and loads mydrm.ko, and also creates card0 in /dev folder. In user space I call the function ret = drmAvailable(). The result is as follows: It seems it calls preclose because drmAvailable calls close(fd) before exiting. drmAvailable also send the Version IOCTL to DRM. In My case it returns the error number of 0x19 = 25, which corresponds to ENOTTY. Please suggest me how to remove this error and make the ioctls successful. drmOpenDevice: buf = /dev/dri/card0 --drmOpenDevice: open result is 5, (OK) drmOpenDevice will return now with fd = 0x5 drmAvailable - before calling drmGetVersion API: drmGetVersion DRM_IOCTL_VERSION = 0xc0246400 drmIoctl fd = 0x5 request = 0xc0246400 errno = 0x19 Thanks and Regards Shailendra -- View this message in context: http://freebsd.1045724.n5.nabble.com/dev-dri-card0-gives-ENOTTY-error-tp6110741.html Sent from the freebsd-drivers mailing list archive at Nabble.com.