[PATCH] intel TV out margin configuration via xorg.conf

Robert Lowery rglowery at exemail.com.au
Fri Nov 7 04:17:37 PST 2008


Any reason why we don't support TV out margin setting via xorg.conf?  It's
a pain using xrandr to configure after X is started (or am I missing
something how this should be done?)

diff below works for me with settings like the following in xorg.conf
Section "Monitor"
        Identifier "TV"
        Option          "TV Format" "576p"
        Option          "Left" "35"
        Option          "Top" "30"
        Option          "Bottom" "22"
        Option          "Right" "42"
EndSection

Apologies if SquirrelMail corrupts the diff

Cheers

-Rob

diff --git a/src/i830_tv.c b/src/i830_tv.c
index 5c6a031..04f0a78 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -1686,6 +1686,7 @@ i830_tv_init(ScrnInfoPtr pScrn)
     I830OutputPrivatePtr    intel_output;
     struct i830_tv_priv            *dev_priv;
     uint32_t               tv_dac_on, tv_dac_off, save_tv_dac;
+    char                   *mon_option_lst;

     if (pI830->quirk_flag & QUIRK_IGNORE_TV)
        return;
@@ -1740,17 +1741,24 @@ i830_tv_init(ScrnInfoPtr pScrn)

     dev_priv->tv_format = NULL;

-    /* BIOS margin values */
-    dev_priv->margin[TV_MARGIN_LEFT] = 54;
-    dev_priv->margin[TV_MARGIN_TOP] = 36;
-    dev_priv->margin[TV_MARGIN_RIGHT] = 46;
-    dev_priv->margin[TV_MARGIN_BOTTOM] = 37;
+    mon_option_lst = NULL;

     if (output->conf_monitor)
     {
+        mon_option_lst = output->conf_monitor->mon_option_lst;
+    }
+
+    /* BIOS margin values */
+    dev_priv->margin[TV_MARGIN_LEFT] = xf86SetIntOption (mon_option_lst,
"Left", 54);
+    dev_priv->margin[TV_MARGIN_TOP] = xf86SetIntOption (mon_option_lst,
"Top", 36);
+    dev_priv->margin[TV_MARGIN_RIGHT] = xf86SetIntOption (mon_option_lst,
"Right", 46);
+    dev_priv->margin[TV_MARGIN_BOTTOM] = xf86SetIntOption
(mon_option_lst, "Bottom", 37);
+
+    if (mon_option_lst)
+    {
        char    *tv_format;

-       tv_format = xf86findOptionValue
(output->conf_monitor->mon_option_lst, "TV Format");
+       tv_format = xf86findOptionValue (mon_option_lst, "TV Format");
        if (tv_format)
            dev_priv->tv_format = xstrdup (tv_format);






More information about the xorg mailing list