rpms/xorg-x11-drv-intel/devel intel-2.6.0-to-master.patch, 1.1, 1.2 xorg-x11-drv-intel.spec, 1.5, 1.6 intel-2.6.0-kms-dpms.patch, 1.1, NONE

Kristian Høgsberg krh at fedoraproject.org
Wed Mar 4 22:42:57 UTC 2009


Author: krh

Update of /cvs/pkgs/rpms/xorg-x11-drv-intel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15468

Modified Files:
	intel-2.6.0-to-master.patch xorg-x11-drv-intel.spec 
Removed Files:
	intel-2.6.0-kms-dpms.patch 
Log Message:
* Wed Mar  4 2009 Kristian Høgsberg <krh at redhat.com> - 2.6.0-12
- Update to new git snapshot: re-enables multiple X servers, fixes
  leak on vt switch for 965 type hardware, fold dpms patch into git
  master patch.


intel-2.6.0-to-master.patch:

Index: intel-2.6.0-to-master.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/devel/intel-2.6.0-to-master.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- intel-2.6.0-to-master.patch	28 Feb 2009 16:31:43 -0000	1.1
+++ intel-2.6.0-to-master.patch	4 Mar 2009 22:42:27 -0000	1.2
@@ -98,7 +98,7 @@
  	AC_DEFINE(XF86DRM_MODE,1,[DRM kernel modesetting])
  fi
 diff --git a/man/intel.man b/man/intel.man
-index 00aa1be..c7a3c61 100644
+index 00aa1be..e38cc54 100644
 --- a/man/intel.man
 +++ b/man/intel.man
 @@ -150,26 +150,6 @@ pool.  On systems with a working GEM environment, this can be disabled to
@@ -141,6 +141,48 @@
  
  .SH OUTPUT CONFIGURATION
  On 830M and better chipsets, the driver supports runtime configuration of
+@@ -299,11 +273,41 @@ Integrated TV output.  Available properties include:
+ 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 BRIGHTNESS
++- TV brightness, range 0-255
++.TP 2
++Adjust TV brightness, default value is 128.
++
++.PP
++.B CONTRAST
++- TV contrast, range 0-255
++.TP 2
++Adjust TV contrast, default value is 1.0 in chipset specific format.
++
++.PP
++.B SATURATION
++- TV saturation, range 0-255
++.TP 2
++Adjust TV saturation, default value is 1.0 in chipset specific format.
++
++.PP
++.B HUE
++- TV hue, range 0-255
++.TP 2
++Adjust TV hue, default value is 0.
++
++.PP
+ .B TV_FORMAT
+ - output standard
+ .TP 2
+ This property allows you to control the output standard used on your TV output port.  You can select between NTSC-M, NTSC-443, NTSC-J, PAL-M, PAL-N, and PAL.
+ 
++.PP
++.B TV_Connector
++- connector type
++.TP 2
++This config option should be added to xorg.conf TV monitor's section, it allows you to control the TV output connector type, which bypass load detect. You can select between S-Video, Composite and Component.
++
+ .SS "TMDS-1"
+ First DVI SDVO output
+ 
 diff --git a/src/Makefile.am b/src/Makefile.am
 index 3fb30ff..e05dbab 100644
 --- a/src/Makefile.am
@@ -176,7 +218,7 @@
  INTEL_G4A =				\
  	packed_yuv_sf.g4a		\
 diff --git a/src/bios_reader/bios_reader.c b/src/bios_reader/bios_reader.c
-index 717f5bf..41908a3 100644
+index 717f5bf..fc51821 100644
 --- a/src/bios_reader/bios_reader.c
 +++ b/src/bios_reader/bios_reader.c
 @@ -205,6 +205,7 @@ static void dump_general_definitions(void)
@@ -223,7 +265,7 @@
  	printf("%c\tpanel type %02i: %dx%d clock %d\n", marker,
  	       i, lfp_data->fp_timing.x_res, lfp_data->fp_timing.y_res,
  	       _PIXEL_CLOCK(timing_data));
-@@ -336,15 +352,69 @@ static void dump_lvds_data(void)
+@@ -336,19 +352,77 @@ static void dump_lvds_data(void)
  	       (unsigned long)lfp_data->fp_timing.pp_cycle_reg_val);
  	printf("\t\t  PFIT: 0x%08lx\n",
  	       (unsigned long)lfp_data->fp_timing.pfit_reg_val);
@@ -241,10 +283,10 @@
 +	       vdisplay, vsyncstart, vsyncend, vtotal, clock,
 +	       (hsyncend > htotal || vsyncend > vtotal) ?
 +	       "BAD!" : "good");
-+    }
-+    free(block);
-+}
-+
+     }
+     free(block);
+ }
+ 
 +static void dump_driver_feature(void)
 +{
 +    struct bdb_block *block;
@@ -299,10 +341,18 @@
 +	case BDB_DRIVER_EDP:
 +	    printf("Embedded DisplayPort\n");
 +	    break;
-     }
-     free(block);
- }
-@@ -423,5 +493,7 @@ int main(int argc, char **argv)
++    }
++    printf("\tDefine Display statically: %s\n", YESNO(feature->static_display));
++    printf("\tLegacy CRT max X: %d\n", feature->legacy_crt_max_x);
++    printf("\tLegacy CRT max Y: %d\n", feature->legacy_crt_max_y);
++    printf("\tLegacy CRT max refresh: %d\n", feature->legacy_crt_max_refresh);
++    free(block);
++}
++
+ int main(int argc, char **argv)
+ {
+     int fd;
+@@ -423,5 +497,7 @@ int main(int argc, char **argv)
      dump_lvds_data();
      dump_lvds_ptr_data();
  
@@ -363,7 +413,7 @@
  #define GTT_PAGE_SIZE			KB(4)
  #define ROUND_TO(x, y)			(((x) + (y) - 1) / (y) * (y))
 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index 4994251..8128004 100644
+index 4994251..d9ca16c 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -33,29 +33,35 @@
@@ -618,7 +668,36 @@
  			drmModeFreePropertyBlob(drmmode_output->edid_blob);
  			drmmode_output->edid_blob =
  				drmModeGetPropertyBlob(drmmode->fd,
-@@ -574,24 +603,105 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+@@ -477,7 +506,27 @@ drmmode_output_destroy(xf86OutputPtr output)
+ static void
+ drmmode_output_dpms(xf86OutputPtr output, int mode)
+ {
+-	return;
++	drmmode_output_private_ptr drmmode_output = output->driver_private;
++	drmModeConnectorPtr koutput = drmmode_output->mode_output;
++	drmmode_ptr drmmode = drmmode_output->drmmode;
++	int i;
++	drmModePropertyPtr props;
++
++	for (i = 0; i < koutput->count_props; i++) {
++		props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
++		if (!props)
++			continue;
++
++		if (!strcmp(props->name, "DPMS")) {
++                        drmModeConnectorSetProperty(drmmode->fd,
++                                drmmode_output->output_id,
++                                props->prop_id,
++                                mode);
++                        drmModeFreeProperty(props);
++                        return;
++		}
++		drmModeFreeProperty(props);
++	}
+ }
+ 
+ static const xf86OutputFuncsRec drmmode_output_funcs = {
+@@ -574,24 +623,105 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
  	return;
  }
  
@@ -737,7 +816,7 @@
  
  	xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs);
  	xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-@@ -609,40 +719,10 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, char *busId,
+@@ -609,40 +739,10 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, char *busId,
  	for (i = 0; i < drmmode->mode_res->count_connectors; i++)
  		drmmode_output_init(pScrn, drmmode, i);
  
@@ -779,7 +858,7 @@
  
  Bool drmmode_is_rotate_pixmap(ScrnInfoPtr pScrn, pointer pPixData, dri_bo **bo)
  {
-@@ -668,41 +748,4 @@ Bool drmmode_is_rotate_pixmap(ScrnInfoPtr pScrn, pointer pPixData, dri_bo **bo)
+@@ -668,41 +768,4 @@ Bool drmmode_is_rotate_pixmap(ScrnInfoPtr pScrn, pointer pPixData, dri_bo **bo)
  #endif
  }
  
@@ -1336,7 +1415,7 @@
  {
      assert(pI830->batch_ptr != NULL);
 diff --git a/src/i830_bios.c b/src/i830_bios.c
-index 72408f0..a990ebe 100644
+index 72408f0..7f20553 100644
 --- a/src/i830_bios.c
 +++ b/src/i830_bios.c
 @@ -135,6 +135,12 @@ parse_panel_data(I830Ptr pI830, struct bdb_header *bdb)
@@ -1352,7 +1431,7 @@
      xf86SetModeDefaultName(fixed_mode);
  
      pI830->lvds_fixed_mode = fixed_mode;
-@@ -162,6 +168,23 @@ parse_general_features(I830Ptr pI830, struct bdb_header *bdb)
+@@ -162,6 +168,27 @@ parse_general_features(I830Ptr pI830, struct bdb_header *bdb)
      }
  }
  
@@ -1362,9 +1441,13 @@
 +    struct bdb_driver_feature *feature;
 +
 +    /* For mobile chip, set default as true */
-+    if (IS_MOBILE(pI830))
++    if (IS_MOBILE(pI830) && !IS_I830(pI830))
 +	pI830->integrated_lvds = TRUE;
 +
++    /* skip pre-9xx chips which is broken to parse this block. */
++    if (!IS_I9XX(pI830))
++	return;
++
 +    feature = find_section(bdb, BDB_DRIVER_FEATURES);
 +    if (!feature)
 +	return;
@@ -1376,7 +1459,7 @@
  #define INTEL_VBIOS_SIZE (64 * 1024)	/* XXX */
  
  /**
-@@ -240,6 +263,7 @@ i830_bios_init(ScrnInfoPtr pScrn)
+@@ -240,6 +267,7 @@ i830_bios_init(ScrnInfoPtr pScrn)
  
      parse_general_features(pI830, bdb);
      parse_panel_data(pI830, bdb);
@@ -1385,10 +1468,10 @@
      xfree(bios);
  
 diff --git a/src/i830_bios.h b/src/i830_bios.h
-index 39706ac..ec8bd8f 100644
+index 39706ac..78af830 100644
 --- a/src/i830_bios.h
 +++ b/src/i830_bios.h
-@@ -395,6 +395,41 @@ struct vch_bdb_22 {
+@@ -395,6 +395,47 @@ struct vch_bdb_22 {
      struct vch_panel_data   panels[16];
  } __attribute__((packed));
  
@@ -1425,6 +1508,12 @@
 +    uint16_t	crt_hotplug:1;
 +    uint16_t	lvds_config:2;
 +    uint16_t	reserved:3;
++
++    uint8_t	static_display:1;
++    uint8_t	reserved2:7;
++    uint16_t	legacy_crt_max_x;
++    uint16_t	legacy_crt_max_y;
++    uint8_t	legacy_crt_max_refresh;
 +} __attribute__((packed));
 +
  #ifndef REG_DUMPER
@@ -2624,7 +2713,7 @@
      }
      if (i == DRM_MAX_MINOR) {
 diff --git a/src/i830_driver.c b/src/i830_driver.c
-index 4c40d40..342a059 100644
+index 4c40d40..f80ca69 100644
 --- a/src/i830_driver.c
 +++ b/src/i830_driver.c
 @@ -212,6 +212,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -3187,7 +3276,15 @@
     if (crtc && crtc->enabled)
     {
        /* Sync the engine before adjust frame */
-@@ -3557,7 +3596,6 @@ I830LeaveVT(int scrnIndex, int flags)
+@@ -3497,6 +3536,7 @@ I830LeaveVT(int scrnIndex, int flags)
+ {
+    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+    I830Ptr pI830 = I830PTR(pScrn);
++   int ret;
+ #ifndef HAVE_FREE_SHADOW
+    xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+    int o;
+@@ -3557,7 +3597,6 @@ I830LeaveVT(int scrnIndex, int flags)
  	*/
         if (!pI830->memory_manager)
  	   intel_bufmgr_fake_evict_all(pI830->bufmgr);
@@ -3195,7 +3292,7 @@
  
         if (!pI830->memory_manager)
  	   i830_stop_ring(pScrn, TRUE);
-@@ -3568,6 +3606,8 @@ I830LeaveVT(int scrnIndex, int flags)
+@@ -3568,6 +3607,8 @@ I830LeaveVT(int scrnIndex, int flags)
         }
     }
  
@@ -3204,7 +3301,39 @@
     if (I830IsPrimary(pScrn))
        i830_unbind_all_memory(pScrn);
  
-@@ -3614,6 +3654,9 @@ I830EnterVT(int scrnIndex, int flags)
+@@ -3589,6 +3630,13 @@ I830LeaveVT(int scrnIndex, int flags)
+ 
+    if (pI830->AccelInfoRec)
+       pI830->AccelInfoRec->NeedToSync = FALSE;
++
++#ifdef XF86DRI
++   ret = drmDropMaster(pI830->drmSubFD);
++   if (ret)
++      xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
++		 "drmDropMaster failed: %s\n", strerror(ret));
++#endif
+ }
+ 
+ /*
+@@ -3599,9 +3647,17 @@ I830EnterVT(int scrnIndex, int flags)
+ {
+    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+    I830Ptr  pI830 = I830PTR(pScrn);
++   int ret;
+ 
+    DPRINTF(PFX, "Enter VT\n");
+ 
++#ifdef XF86DRI
++   ret = drmSetMaster(pI830->drmSubFD);
++   if (ret)
++      xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
++		 "drmDropMaster failed: %s\n", strerror(ret));
++#endif
++
+    /*
+     * Only save state once per server generation since that's what most
+     * drivers do.  Could change this to save state at each VT enter.
+@@ -3614,6 +3670,9 @@ I830EnterVT(int scrnIndex, int flags)
  
     pI830->leaving = FALSE;
  
@@ -3214,7 +3343,7 @@
  #ifdef XF86DRI
     if (pI830->memory_manager && !pI830->use_drm_mode) {
        int ret;
-@@ -3816,15 +3859,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
+@@ -3816,15 +3875,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
  #ifdef XF86DRI
     if (pI830->directRenderingOpen &&
         pI830->directRenderingType == DRI_XF86DRI) {
@@ -4762,7 +4891,7 @@
  };
  
 diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
-index 0750166..4b98a9b 100644
+index 0750166..efdd691 100644
 --- a/src/i830_sdvo.c
 +++ b/src/i830_sdvo.c
 @@ -594,9 +594,12 @@ i830_sdvo_create_preferred_input_timing(xf86OutputPtr output, uint16_t clock,
@@ -5010,7 +5139,7 @@
 +	/* Check EDID in DVI-I case */
 +	i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus);
 +	edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus);
-+	if (!edid_mon || !DIGITAL(edid_mon->features.input_type)) {
++	if (edid_mon && !DIGITAL(edid_mon->features.input_type)) {
 +	    xfree(edid_mon);
 +	    return XF86OutputStatusDisconnected;
 +	}
@@ -5234,18 +5363,418 @@
  #define SDVO_CMD_SET_FLICKER_FILTER			0x4f
  #define SDVO_CMD_GET_ADAPTIVE_FLICKER_FITER		0x50
 diff --git a/src/i830_tv.c b/src/i830_tv.c
-index 72d2bd8..b13abd4 100644
+index 72d2bd8..1e3cf7b 100644
 --- a/src/i830_tv.c
 +++ b/src/i830_tv.c
-@@ -1606,7 +1606,7 @@ i830_tv_set_property(xf86OutputPtr output, Atom property,
+@@ -56,8 +56,13 @@ enum tv_margin {
+ /** Private structure for the integrated TV support */
+ struct i830_tv_priv {
+     int type;
++    Bool force_type;
+     char *tv_format;
+     int margin[4];
++    uint8_t brightness;
++    uint8_t contrast;
++    uint8_t saturation;
++    uint8_t hue;
+     uint32_t save_TV_H_CTL_1;
+     uint32_t save_TV_H_CTL_2;
+     uint32_t save_TV_H_CTL_3;
+@@ -1019,6 +1024,96 @@ i830_float_to_luma (float f)
+     return ret;
+ }
+ 
++static uint8_t
++float_to_float_2_6(float fin)
++{
++    uint8_t exp;
++    uint8_t mant;
++    float f = fin;
++    uint32_t tmp;
++
++    if (f < 0) f = -f;
++
++    tmp = f;
++    for (exp = 0; exp <= 3 && tmp > 0; exp++)
++	tmp /= 2;
++
++    mant = (f * (1 << 6) + 0.5);
++    mant >>= exp;
++    if (mant > (1 << 6))
++	mant = (1 << 6) - 1;
++
++    return (exp << 6) | mant;
++}
++
++static uint8_t
++float_to_fix_2_6(float f)
++{
++    uint8_t ret;
++
++    ret = f * (1 << 6);
++    return ret;
++}
++
++static void
++i830_tv_update_brightness(I830Ptr pI830, uint8_t brightness)
++{
++    /* brightness in 2's comp value */
++    uint32_t val = INREG(TV_CLR_KNOBS) & ~TV_BRIGHTNESS_MASK;
++    int8_t bri = brightness - 128; /* remove bias */
++
++    val |= (bri << TV_BRIGHTNESS_SHIFT) & TV_BRIGHTNESS_MASK;
++    OUTREG(TV_CLR_KNOBS, val);
++}
++
++static void
++i830_tv_update_contrast(I830Ptr pI830, uint8_t contrast)
++{
++    uint32_t val = INREG(TV_CLR_KNOBS) & ~TV_CONTRAST_MASK;;
++    float con;
++    uint8_t c;
++
++    if (IS_I965G(pI830)) {
++	/* 2.6 fixed point */
++	con = 3.0 * ((float) contrast / 255);
++	c = float_to_fix_2_6(con);
++    } else {
++	/* 2.6 floating point */
++	con = 8.875 * ((float) contrast / 255);
++	c = float_to_float_2_6(con);
++    }
++    val |= (c << TV_CONTRAST_SHIFT) & TV_CONTRAST_MASK;
++    OUTREG(TV_CLR_KNOBS, val);
++}
++
++static void
++i830_tv_update_saturation(I830Ptr pI830, uint8_t saturation)
++{
++    uint32_t val = INREG(TV_CLR_KNOBS) & ~TV_SATURATION_MASK;
++    float sat;
++    uint8_t s;
++
++    /* same as contrast */
++    if (IS_I965G(pI830)) {
++	sat = 3.0 * ((float) saturation / 255);
++	s = float_to_fix_2_6(sat);
++    } else {
++	sat = 8.875 * ((float) saturation / 255);
++	s = float_to_float_2_6(sat);
++    }
++    val |= (s << TV_SATURATION_SHIFT) & TV_SATURATION_MASK;
++    OUTREG(TV_CLR_KNOBS, val);
++}
++
++static void
++i830_tv_update_hue(I830Ptr pI830, uint8_t hue)
++{
++    uint32_t val = INREG(TV_CLR_KNOBS) & ~TV_HUE_MASK;
++
++    val |= (hue << TV_HUE_SHIFT) & TV_HUE_MASK;
++    OUTREG(TV_CLR_KNOBS, val);
++}
++
+ static void
+ i830_tv_mode_set(xf86OutputPtr output, DisplayModePtr mode,
+ 		DisplayModePtr adjusted_mode)
+@@ -1180,14 +1275,6 @@ i830_tv_mode_set(xf86OutputPtr output, DisplayModePtr mode,
+ 	    (i830_float_to_csc(color_conversion->bv) << 16) |
+ 	    (i830_float_to_luma(color_conversion->av)));
+ 
+-    if (IS_I965G(pI830)) {
+-	/* 2.6 fixed point value for contrast and saturation modifier,
+-	   use 1 as default */
+-	OUTREG(TV_CLR_KNOBS, 0x00404000);
+-    } else {
+-	/* 915/945 uses 2 bits exponent and 6 bits mantissa format */
+-	OUTREG(TV_CLR_KNOBS, 0x00606000);
+-    }
+     OUTREG(TV_CLR_LEVEL, ((video_levels->black << TV_BLACK_LEVEL_SHIFT) |
+ 		(video_levels->blank << TV_BLANK_LEVEL_SHIFT)));
+     {
+@@ -1380,6 +1467,13 @@ i830_tv_detect(xf86OutputPtr output)
+         i830ReleaseLoadDetectPipe (output, dpms_mode);
+     }
+ 
++    if (dev_priv->force_type) {
++	if (type == TV_TYPE_NONE)
++	    return XF86OutputStatusDisconnected;
++	else
++	    return XF86OutputStatusConnected;
++    }
++
+     if (type != dev_priv->type)
+     {
+ 	dev_priv->type = type;
+@@ -1405,10 +1499,10 @@ static struct input_res {
+ {
+ 	{"640x480", 640, 480},
+ 	{"800x600", 800, 600},
+-	{"1024x768", 1024, 768},
+-	{"1280x1024", 1280, 1024},
+ 	{"848x480", 848, 480},
++	{"1024x768", 1024, 768},
+ 	{"1280x720", 1280, 720},
++	{"1280x1024", 1280, 1024},
+ 	{"1920x1080", 1920, 1080},
+ };
+ 
+@@ -1488,6 +1582,26 @@ static char *margin_names[4] = {
+     "LEFT", "TOP", "RIGHT", "BOTTOM"
+ };
+ 
++/**
++ *  contrast and saturation has different format on 915/945 with 965.
++ *  On 915/945, it's 2.6 floating point number.
++ *  On 965, it's 2.6 fixed point number.
++ */
++#define TV_BRIGHTNESS_NAME "BRIGHTNESS"
++#define TV_BRIGHTNESS_DEFAULT 128	/* bias */
++static Atom brightness_atom;
++#define TV_CONTRAST_NAME "CONTRAST"
++#define TV_CONTRAST_DEFAULT 0x40
++#define TV_CONTRAST_DEFAULT_945G 0x60
++static Atom contrast_atom;
++#define TV_SATURATION_NAME "SATURATION"
++#define TV_SATURATION_DEFAULT 0x40
++#define TV_SATURATION_DEFAULT_945G 0x60
++static Atom saturation_atom;
++#define TV_HUE_NAME "HUE"
++#define TV_HUE_DEFAULT 0
++static Atom hue_atom;
++
+ static Bool
+ i830_tv_format_set_property (xf86OutputPtr output)
+ {
+@@ -1533,6 +1647,62 @@ i830_tv_format_configure_property (xf86OutputPtr output)
+ 				     num_atoms, (INT32 *) current_atoms);
+ }
+ 
++static void
++i830_tv_color_set_property(xf86OutputPtr output, Atom property,
++			   uint8_t val)
++{
++    ScrnInfoPtr		    pScrn = output->scrn;
++    I830Ptr		    pI830 = I830PTR(pScrn);
++    I830OutputPrivatePtr    intel_output = output->driver_private;
++    struct i830_tv_priv	    *dev_priv = intel_output->dev_priv;
++
++    if (property == brightness_atom) {
++	dev_priv->brightness = val;
++	i830_tv_update_brightness(pI830, val);
++    } else if (property == contrast_atom) {
++	dev_priv->contrast = val;
++	i830_tv_update_contrast(pI830, val);
++    } else if (property == saturation_atom) {
++	dev_priv->saturation = val;
++	i830_tv_update_saturation(pI830, val);
++    } else if (property == hue_atom) {
++	dev_priv->hue = val;
++	i830_tv_update_hue(pI830, val);
++    }
++}
++
++static void
++i830_tv_color_create_property(xf86OutputPtr output, Atom *property,
++			      char *name, int name_len, uint8_t val)
++{
++    ScrnInfoPtr	pScrn = output->scrn;
++    INT32 range[2];
++    int err = 0;
++
++    *property = MakeAtom(name, name_len - 1, TRUE);
++    range[0] = 0;
++    range[1] = 255;
++    err = RRConfigureOutputProperty(output->randr_output, *property,
++				    FALSE, TRUE, FALSE, 2, range);
++    if (err != 0) {
++	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
++		   "RRConfigureOutputProperty error, %d\n", err);
++	goto out;
++    }
++    /* Set the current value */
++    i830_tv_color_set_property(output, *property, val);
++
++    err = RRChangeOutputProperty(output->randr_output, *property,
++				 XA_INTEGER, 32, PropModeReplace, 1, &val,
++				 FALSE, FALSE);
++    if (err != 0) {
++	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
++		   "RRChangeOutputProperty error, %d\n", err);
++    }
++out:
++    return;
++}
++
+ #endif /* RANDR_12_INTERFACE */
+ 
+ static void
+@@ -1540,10 +1710,10 @@ i830_tv_create_resources(xf86OutputPtr output)
+ {
+ #ifdef RANDR_12_INTERFACE
+     ScrnInfoPtr		    pScrn = output->scrn;
++    I830Ptr		    pI830 = I830PTR(pScrn);
+     I830OutputPrivatePtr    intel_output = output->driver_private;
+     struct i830_tv_priv	    *dev_priv = intel_output->dev_priv;
+-    int			    err;
+-    int			    i;
++    int			    err, i;
+ 
+     /* Set up the tv_format property, which takes effect on mode set
+      * and accepts strings that match exactly
+@@ -1591,6 +1761,23 @@ i830_tv_create_resources(xf86OutputPtr output)
+ 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ 		       "RRChangeOutputProperty error, %d\n", err);
+     }
++
++    i830_tv_color_create_property(output, &brightness_atom,
++				  TV_BRIGHTNESS_NAME,
++				  sizeof(TV_BRIGHTNESS_NAME),
++				  TV_BRIGHTNESS_DEFAULT);
++    i830_tv_color_create_property(output, &contrast_atom,
++				  TV_CONTRAST_NAME,
++				  sizeof(TV_CONTRAST_NAME),
++				  IS_I965G(pI830) ? TV_CONTRAST_DEFAULT :
++						TV_CONTRAST_DEFAULT_945G);
++    i830_tv_color_create_property(output, &saturation_atom,
++				  TV_SATURATION_NAME,
++				  sizeof(TV_SATURATION_NAME),
++				  IS_I965G(pI830) ? TV_SATURATION_DEFAULT :
++						TV_SATURATION_DEFAULT_945G);
++    i830_tv_color_create_property(output, &hue_atom, TV_HUE_NAME,
++				  sizeof(TV_HUE_NAME), TV_HUE_DEFAULT);
+ #endif /* RANDR_12_INTERFACE */
+ }
+ 
+@@ -1605,9 +1792,14 @@ i830_tv_set_property(xf86OutputPtr output, Atom property,
+     {
  	I830OutputPrivatePtr    intel_output = output->driver_private;
  	struct i830_tv_priv	*dev_priv = intel_output->dev_priv;
++	I830Ptr			pI830 = I830PTR(output->scrn);
  	Atom			atom;
 -	char			*name;
 +	const char		*name;
  	char			*val;
++	RRCrtcPtr		randr_crtc;
++	xRRModeInfo		modeinfo;
++	RRModePtr		mode;
++	DisplayModePtr		crtc_mode;
  
  	if (value->type != XA_ATOM || value->format != 32 || value->size != 1)
+ 	    return FALSE;
+@@ -1626,6 +1818,51 @@ i830_tv_set_property(xf86OutputPtr output, Atom property,
+ 	}
+ 	xfree (dev_priv->tv_format);
+ 	dev_priv->tv_format = val;
++
++	if (pI830->starting)
++	    return TRUE;
++
++	/* TV format change will generate new modelines, try
++	   to probe them and update outputs. */
++	xf86ProbeOutputModes(output->scrn, 0, 0);
++	 /* Mirror output modes to scrn mode list */
++	xf86SetScrnInfoModes (output->scrn);
++
++	for (crtc_mode = output->probed_modes; crtc_mode;
++		crtc_mode = crtc_mode->next)
++	{
++	    if (output->crtc->mode.HDisplay == crtc_mode->HDisplay &&
++		    output->crtc->mode.VDisplay == crtc_mode->VDisplay)
++		break;
++	}
++	if (!crtc_mode)
++	    crtc_mode = output->probed_modes;
++
++	xf86CrtcSetMode(output->crtc, crtc_mode, output->crtc->rotation,
++		output->crtc->x, output->crtc->y);
++
++	xf86RandR12TellChanged(output->scrn->pScreen);
++
++	modeinfo.width = crtc_mode->HDisplay;
++	modeinfo.height = crtc_mode->VDisplay;
++	modeinfo.dotClock = crtc_mode->Clock * 1000;
++	modeinfo.hSyncStart = crtc_mode->HSyncStart;
++	modeinfo.hSyncEnd = crtc_mode->HSyncEnd;
++	modeinfo.hTotal = crtc_mode->HTotal;
++	modeinfo.hSkew = crtc_mode->HSkew;
++	modeinfo.vSyncStart = crtc_mode->VSyncStart;
++	modeinfo.vSyncEnd = crtc_mode->VSyncEnd;
++	modeinfo.vTotal = crtc_mode->VTotal;
++	modeinfo.nameLength = strlen(crtc_mode->name);
++	modeinfo.modeFlags = crtc_mode->Flags;
++
++	mode = RRModeGet(&modeinfo, crtc_mode->name);
++	randr_crtc = output->crtc->randr_crtc;
++	if (mode != randr_crtc->mode) {
++	    if (randr_crtc->mode)
++		RRModeDestroy(randr_crtc->mode);
++	    randr_crtc->mode = mode;
++	}
+ 	return TRUE;
+     }
+     for (i = 0; i < 4; i++)
+@@ -1645,6 +1882,18 @@ i830_tv_set_property(xf86OutputPtr output, Atom property,
+ 	    return TRUE;
+ 	}
+     }
++    if (property == brightness_atom || property == contrast_atom ||
++	property == saturation_atom || property == hue_atom) {
++	uint8_t val;
++
++	/* Make sure value is sane */
++	if (value->type != XA_INTEGER || value->format != 32 ||
++	    value->size != 1)
++	    return FALSE;
++
++	memcpy (&val, value->data, 1);
++	i830_tv_color_set_property(output, property, val);
++    }
+ 
+     return TRUE;
+ }
+@@ -1693,6 +1942,7 @@ i830_tv_init(ScrnInfoPtr pScrn)
+     uint32_t		    tv_dac_on, tv_dac_off, save_tv_dac;
+     XF86OptionPtr	    mon_option_lst = NULL;
+     char		    *tv_format = NULL;
++    char		    *tv_type = NULL;
+ 
+     if (pI830->quirk_flag & QUIRK_IGNORE_TV)
+ 	return;
+@@ -1760,12 +2010,32 @@ i830_tv_init(ScrnInfoPtr pScrn)
+     dev_priv->margin[TV_MARGIN_BOTTOM] = xf86SetIntOption (mon_option_lst,
+ 	    "Bottom", 37);
+ 
+-    tv_format = xf86findOptionValue (mon_option_lst, "TV Format");
++    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);
+ 
++    tv_type = xf86findOptionValue (mon_option_lst, "TV_Connector");
++    if (tv_type) {
++	dev_priv->force_type = TRUE;
++	if (strcasecmp(tv_type, "S-Video") == 0)
++	    dev_priv->type = TV_TYPE_SVIDEO;
++	else if (strcasecmp(tv_type, "Composite") == 0)
++	    dev_priv->type = TV_TYPE_COMPOSITE;
++	else if (strcasecmp(tv_type, "Component") == 0)
++	    dev_priv->type = TV_TYPE_COMPONENT;
++	else {
++	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
++		    "Unknown TV Connector type %s\n", tv_type);
++	    dev_priv->force_type = FALSE;
++	}
++    }
++
++    if (dev_priv->force_type)
++	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
++		"Force TV Connector type as %s\n", tv_type);
++
+     output->driver_private = intel_output;
+     output->interlaceAllowed = FALSE;
+     output->doubleScanAllowed = FALSE;
 diff --git a/src/i830_video.c b/src/i830_video.c
 index 87fa020..cdb1072 100644
 --- a/src/i830_video.c
@@ -5815,7 +6344,7 @@
  	return BadAlloc;
      }
 diff --git a/src/i965_render.c b/src/i965_render.c
-index 00cb051..de1c8b3 100644
+index 00cb051..ab7f7d2 100644
 --- a/src/i965_render.c
 +++ b/src/i965_render.c
 @@ -315,8 +315,6 @@ static const uint32_t sf_kernel_mask_static[][4] = {
@@ -6830,7 +7359,9 @@
 +    composite_op->binding_table_bo = binding_table_bo;
 +    composite_op->src_filter =
 +	sampler_state_filter_from_picture(pSrcPicture->filter);
-+
+ 
+-    /* Fallback if we can't make this operation fit. */
+-    return _emit_batch_header_for_composite_check_twice (pScrn);
 +    pI830->scale_units[0][0] = pSrc->drawable.width;
 +    pI830->scale_units[0][1] = pSrc->drawable.height;
 +
@@ -6912,9 +7443,7 @@
 +							    4096);
 +	render_state->vb_offset = 0;
 +    }
- 
--    /* Fallback if we can't make this operation fit. */
--    return _emit_batch_header_for_composite_check_twice (pScrn);
++
 +    drm_intel_bo_reference(render_state->vertex_buffer_bo);
 +    return render_state->vertex_buffer_bo;
  }
@@ -7111,11 +7640,11 @@
  }
  
  /**
-@@ -1649,21 +1715,25 @@ gen4_render_state_cleanup(ScrnInfoPtr pScrn)
+@@ -1649,21 +1715,36 @@ gen4_render_state_cleanup(ScrnInfoPtr pScrn)
  {
      I830Ptr pI830 = I830PTR(pScrn);
      struct gen4_render_state *render_state= pI830->gen4_render_state;
-+    int i;
++    int i, j, k, l, m;
  
      if (render_state->vertex_buffer_bo) {
  	dri_bo_unreference (render_state->vertex_buffer_bo);
@@ -7131,19 +7660,29 @@
 +    render_state->sf_state_bo = NULL;
 +    drm_intel_bo_unreference(render_state->sf_mask_state_bo);
 +    render_state->sf_mask_state_bo = NULL;
-+    drm_intel_bo_unreference(render_state->cc_state_bo);
-+    render_state->cc_state_bo = NULL;
++
 +    for (i = 0; i < WM_KERNEL_COUNT; i++) {
 +	drm_intel_bo_unreference(render_state->wm_kernel_bo[i]);
 +	render_state->wm_kernel_bo[i] = NULL;
      }
 -    render_state->static_state = NULL;
 -}
--
+ 
 -unsigned int
 -gen4_render_state_size(ScrnInfoPtr pScrn)
 -{
 -    return sizeof(gen4_static_state_t);
++    for (i = 0; i < SAMPLER_STATE_FILTER_COUNT; i++)
++	for (j = 0; j < SAMPLER_STATE_EXTEND_COUNT; j++)
++	    for (k = 0; k < SAMPLER_STATE_FILTER_COUNT; k++)
++		for (l = 0; l < SAMPLER_STATE_EXTEND_COUNT; l++)
++		    for (m = 0; m < WM_KERNEL_COUNT; m++) {
++			drm_intel_bo_unreference(render_state->wm_state_bo[m][i][j][k][l]);
++			render_state->wm_state_bo[m][i][j][k][l] = NULL;
++		    }
++
++    drm_intel_bo_unreference(render_state->cc_state_bo);
++    render_state->cc_state_bo = NULL;
 +    drm_intel_bo_unreference(render_state->sip_kernel_bo);
 +    render_state->sip_kernel_bo = NULL;
  }


Index: xorg-x11-drv-intel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/devel/xorg-x11-drv-intel.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- xorg-x11-drv-intel.spec	2 Mar 2009 15:57:40 -0000	1.5
+++ xorg-x11-drv-intel.spec	4 Mar 2009 22:42:27 -0000	1.6
@@ -8,7 +8,7 @@
 Summary:   Xorg X11 Intel video driver(s)
 Name:      xorg-x11-drv-intel
 Version:   2.6.0
-Release:   11%{?dist}
+Release:   12%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -26,7 +26,6 @@
 Patch6: intel-2.5.0-no-gem-legacy-3d.patch
 Patch7: kill-svideo.patch
 Patch8: copy-fb.patch
-Patch9: intel-2.6.0-kms-dpms.patch
 
 ExclusiveArch: %{ix86} x86_64 ia64
 
@@ -65,7 +64,6 @@
 %patch6 -p1 -b .nogem3d
 %patch7 -p1 -b .svideo
 %patch8 -p1 -b .copy-fb
-%patch9 -p1 -b .dpms
 
 %build
 
@@ -105,6 +103,11 @@
 %{_libdir}/libIntelXvMC.so
 
 %changelog
+* Wed Mar  4 2009 Kristian Høgsberg <krh at redhat.com> - 2.6.0-12
+- Update to new git snapshot: re-enables multiple X servers, fixes
+  leak on vt switch for 965 type hardware, fold dpms patch into git
+  master patch.
+
 * Mon Mar 02 2009 Adam Jackson <ajax at redhat.com> 2.6.0-11
 - intel-2.6.0-kms-dpms.patch: Enable DPMS on KMS outputs.
 


--- intel-2.6.0-kms-dpms.patch DELETED ---




More information about the fedora-extras-commits mailing list