video: tegra: add height/width to dc and fb
authorErik Gilling <konkers@android.com>
Thu, 3 Feb 2011 21:15:50 +0000 (13:15 -0800)
committerErik Gilling <konkers@android.com>
Thu, 3 Feb 2011 21:21:31 +0000 (13:21 -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 9fe8d6a7e71b8bdd40e289705db85ce96c0704b5..f5a64cba61ae66b536db7994433cbd0fbeacc230 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 d316fde01662de135db2dae78b8f91122f0d8098..1768efbc6e13ae0230afd906056ec43c182245f5 100644 (file)
@@ -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)
 {
index 4f8a5c0270f7a71ca4ccc4418959c3f9e8eab61c..1f0b967acd89a6180c382dfe00b389e892879f98 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;