On 2008.11.07 20:17:37 +0800, Robert Lowery wrote: > 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 >
yeah, that hurts. :) So I tried to fix and update your patch like below. Tested ok. Fine with it? From e6150f005023cadbb57cb67cd0aac526800869ed Mon Sep 17 00:00:00 2001 From: Robert Lowery <[EMAIL PROTECTED]> Date: Tue, 25 Nov 2008 00:52:40 +0800 Subject: [PATCH] TV: add support to set TV margins in xorg.conf --- man/intel.man | 2 +- src/i830_tv.c | 32 ++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/man/intel.man b/man/intel.man index ef0337c..81a94ac 100644 --- a/man/intel.man +++ b/man/intel.man @@ -296,7 +296,7 @@ Integrated TV output. Available properties include: .B BOTTOM, RIGHT, TOP, LEFT - margins .TP 2 -Adjusting these properties allows you to control the placement of your TV output buffer on the screen. +Adjusting these properties allows you to control the placement of your TV output buffer on the screen. The options with the same name can also be set in xorg.conf with integer value. .PP .B TV_FORMAT diff --git a/src/i830_tv.c b/src/i830_tv.c index 09a46e9..d507a0c 100644 --- a/src/i830_tv.c +++ b/src/i830_tv.c @@ -1691,6 +1691,8 @@ 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 = NULL; + char *tv_format = NULL; if (pI830->quirk_flag & QUIRK_IGNORE_TV) return; @@ -1745,21 +1747,23 @@ 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; - if (output->conf_monitor) - { - char *tv_format; - - tv_format = xf86findOptionValue (output->conf_monitor->mon_option_lst, "TV Format"); - if (tv_format) - dev_priv->tv_format = xstrdup (tv_format); - } - if (!dev_priv->tv_format) + 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); + + tv_format = xf86findOptionValue (mon_option_lst, "TV Format"); + if (tv_format) + dev_priv->tv_format = xstrdup (tv_format); + else dev_priv->tv_format = xstrdup (tv_modes[0].name); output->driver_private = intel_output; -- 1.5.6.5 -- Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
signature.asc
Description: Digital signature
_______________________________________________ xorg mailing list xorg@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xorg