video: tegra: add height/width to dc and fb
Erik Gilling [Thu, 3 Feb 2011 21:15:50 +0000 (13:15 -0800)]
Change-Id: I22c280928079af04263375fce63a87776588a457
Signed-off-by: Erik Gilling <konkers@android.com>

arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c
drivers/video/tegra/fb.c

index 9fe8d6a..f5a64cb 100644 (file)
@@ -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
index 3be6026..cee7f25 100644 (file)
@@ -799,6 +799,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)
 {
index 4f8a5c0..1f0b967 100644 (file)
@@ -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;