From patchwork Thu Mar 31 10:11:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 678971 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2VABfQW027473 for ; Thu, 31 Mar 2011 10:11:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933894Ab1CaKLm (ORCPT ); Thu, 31 Mar 2011 06:11:42 -0400 Received: from na3sys009aog105.obsmtp.com ([74.125.149.75]:57646 "EHLO na3sys009aog105.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933885Ab1CaKLf (ORCPT ); Thu, 31 Mar 2011 06:11:35 -0400 Received: from source ([74.125.82.48]) (using TLSv1) by na3sys009aob105.postini.com ([74.125.148.12]) with SMTP ID DSNKTZRTVQYP6LrdeqgPF9KurBd+uRa4q0lY@postini.com; Thu, 31 Mar 2011 03:11:35 PDT Received: by mail-ww0-f48.google.com with SMTP id 18so1798967wwi.5 for ; Thu, 31 Mar 2011 03:11:33 -0700 (PDT) Received: by 10.216.79.11 with SMTP id h11mr2300738wee.77.1301566291190; Thu, 31 Mar 2011 03:11:31 -0700 (PDT) Received: from deskari (a62-248-146-119.elisa-laajakaista.fi [62.248.146.119]) by mx.google.com with ESMTPS id d6sm429627wer.26.2011.03.31.03.11.29 (version=SSLv3 cipher=OTHER); Thu, 31 Mar 2011 03:11:30 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Jani Nikula , Tomi Valkeinen Subject: [PATCH 6/9] OMAP: DSS2: Add method for querying display dimensions from DSS drivers Date: Thu, 31 Mar 2011 13:11:03 +0300 Message-Id: <1301566266-11187-7-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1301566266-11187-1-git-send-email-tomi.valkeinen@ti.com> References: <1301566266-11187-1-git-send-email-tomi.valkeinen@ti.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 31 Mar 2011 10:11:42 +0000 (UTC) diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index e10cfe2..f6e4b87 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h @@ -507,6 +507,8 @@ struct omap_dss_driver { void (*get_resolution)(struct omap_dss_device *dssdev, u16 *xres, u16 *yres); + void (*get_dimensions)(struct omap_dss_device *dssdev, + u32 *width, u32 *height); int (*get_recommended_bpp)(struct omap_dss_device *dssdev); int (*check_timings)(struct omap_dss_device *dssdev, diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 6f43545..b4636b1 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c @@ -895,8 +895,16 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) p.display_info.xres = xres; p.display_info.yres = yres; - p.display_info.width = 0; - p.display_info.height = 0; + + if (display->driver->get_dimensions) { + u32 w, h; + display->driver->get_dimensions(display, &w, &h); + p.display_info.width = w; + p.display_info.height = h; + } else { + p.display_info.width = 0; + p.display_info.height = 0; + } if (copy_to_user((void __user *)arg, &p.display_info, sizeof(p.display_info))) diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 505ec66..163fb8b 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -702,8 +702,16 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var) var->xres, var->yres, var->xres_virtual, var->yres_virtual); - var->height = -1; - var->width = -1; + if (display && display->driver->get_dimensions) { + u32 w, h; + display->driver->get_dimensions(display, &w, &h); + var->width = DIV_ROUND_CLOSEST(w, 1000); + var->height = DIV_ROUND_CLOSEST(h, 1000); + } else { + var->height = -1; + var->width = -1; + } + var->grayscale = 0; if (display && display->driver->get_timings) {