From 4a6469b9eb31fdbf9183417152af4ca151ddf230 Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Thu, 3 Feb 2011 13:15:50 -0800 Subject: [PATCH] video: tegra: add height/width to dc and fb Change-Id: I22c280928079af04263375fce63a87776588a457 Signed-off-by: Erik Gilling --- arch/arm/mach-tegra/include/mach/dc.h | 6 ++++++ drivers/video/tegra/dc/dc.c | 17 +++++++++++++++++ drivers/video/tegra/fb.c | 5 ++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h index 9fe8d6a7e71b..f5a64cba61ae 100644 --- a/arch/arm/mach-tegra/include/mach/dc.h +++ b/arch/arm/mach-tegra/include/mach/dc.h @@ -63,6 +63,9 @@ struct tegra_dc_out { unsigned align; unsigned depth; + unsigned height; /* mm */ + unsigned width; /* mm */ + struct tegra_dc_mode *modes; int n_modes; @@ -184,4 +187,7 @@ int tegra_dc_sync_windows(struct tegra_dc_win *windows[], int n); int tegra_dc_set_mode(struct tegra_dc *dc, const struct tegra_dc_mode *mode); +unsigned tegra_dc_get_out_height(struct tegra_dc *dc); +unsigned tegra_dc_get_out_width(struct tegra_dc *dc); + #endif diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index d316fde01662..1768efbc6e13 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -822,6 +822,23 @@ static void tegra_dc_set_out(struct tegra_dc *dc, struct tegra_dc_out *out) } +unsigned tegra_dc_get_out_height(struct tegra_dc *dc) +{ + if (dc->out) + return dc->out->height; + else + return 0; +} +EXPORT_SYMBOL(tegra_dc_get_out_height); + +unsigned tegra_dc_get_out_width(struct tegra_dc *dc) +{ + if (dc->out) + return dc->out->width; + else + return 0; +} +EXPORT_SYMBOL(tegra_dc_get_out_width); static irqreturn_t tegra_dc_irq(int irq, void *ptr) { diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 4f8a5c0270f7..1f0b967acd89 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -745,9 +745,8 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev, info->var.yres_virtual = fb_data->yres * 2; info->var.bits_per_pixel = fb_data->bits_per_pixel; info->var.activate = FB_ACTIVATE_VBL; - /* TODO: fill in the following by querying the DC */ - info->var.height = -1; - info->var.width = -1; + info->var.height = tegra_dc_get_out_height(dc); + info->var.width = tegra_dc_get_out_width(dc); info->var.pixclock = 0; info->var.left_margin = 0; info->var.right_margin = 0; -- 2.34.1