From patchwork Mon Feb 8 15:56:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 77753 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o18Fromc008284 for ; Mon, 8 Feb 2010 15:53:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753365Ab0BHPxt (ORCPT ); Mon, 8 Feb 2010 10:53:49 -0500 Received: from smtp.nokia.com ([192.100.105.134]:45698 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753347Ab0BHPxs (ORCPT ); Mon, 8 Feb 2010 10:53:48 -0500 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o18FrQcm013809; Mon, 8 Feb 2010 09:53:46 -0600 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Feb 2010 17:53:39 +0200 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Feb 2010 17:53:39 +0200 Received: from localhost.localdomain (esdhcp041210.research.nokia.com [172.21.41.210]) by mgw-sa02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o18FrVb9017114; Mon, 8 Feb 2010 17:53:38 +0200 From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 05/13] OMAP: DSS2: OMAPFB: implement OMAPFB_GET_DISPLAY_INFO Date: Mon, 8 Feb 2010 17:56:04 +0200 Message-Id: <1265644572-3578-6-git-send-email-tomi.valkeinen@nokia.com> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1265644572-3578-5-git-send-email-tomi.valkeinen@nokia.com> References: <1265644572-3578-1-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-2-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-3-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-4-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-5-git-send-email-tomi.valkeinen@nokia.com> X-OriginalArrivalTime: 08 Feb 2010 15:53:40.0007 (UTC) FILETIME=[E1E8AB70:01CAA8D6] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 08 Feb 2010 15:53:50 +0000 (UTC) diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 5562a76..56e3ec2 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c @@ -525,6 +525,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) struct omapfb_memory_read memory_read; struct omapfb_vram_info vram_info; struct omapfb_tearsync_info tearsync_info; + struct omapfb_display_info display_info; } p; int r = 0; @@ -792,6 +793,25 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) break; } + case OMAPFB_GET_DISPLAY_INFO: { + DBG("ioctl GET_DISPLAY_INFO\n"); + + if (display == NULL) { + r = -ENODEV; + break; + } + + p.display_info.xres = display->panel.timings.x_res; + p.display_info.yres = display->panel.timings.y_res; + p.display_info.width = 0; + p.display_info.height = 0; + + if (copy_to_user((void __user *)arg, &p.display_info, + sizeof(p.display_info))) + r = -EFAULT; + break; + } + default: dev_err(fbdev->dev, "Unknown ioctl 0x%x\n", cmd); r = -EINVAL; diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index ef4c2cf..0381436 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -58,6 +58,7 @@ #define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) #define OMAPFB_RESERVE_BUFFER OMAP_IOW(63, struct omapfb_res_buf_info) +#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(64, struct omapfb_display_info) #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 @@ -216,6 +217,14 @@ struct omapfb_tearsync_info { __u16 reserved2; }; +struct omapfb_display_info { + __u16 xres; + __u16 yres; + __u32 width; /* phys width of the display in micrometers */ + __u32 height; /* phys height of the display in micrometers */ + __u32 reserved[5]; +}; + #ifdef __KERNEL__ #include