Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2010 02:08:12 +0000 (19:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2010 02:08:12 +0000 (19:08 -0700)
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon/kms/legacy: only enable load detection property on DVI-I
  drm/radeon/kms: fix panel scaling adjusted mode setup
  drivers/gpu/drm/drm_sysfs.c: sysfs files error handling
  drivers/gpu/drm/radeon/radeon_atombios.c: range check issues
  gpu: vga_switcheroo, fix lock imbalance
  drivers/gpu/drm/drm_memory.c: fix check for end of loop
  drivers/gpu/drm/via/via_video.c: fix off by one issue
  drm/radeon/kms/agp The wrong AGP chipset can cause a NULL pointer dereference
  drm/radeon/kms: r300 fix CS checker to allow zbuffer-only fastfill

1  2 
drivers/gpu/drm/drm_sysfs.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r300.c

@@@ -14,7 -14,6 +14,7 @@@
  
  #include <linux/device.h>
  #include <linux/kdev_t.h>
 +#include <linux/gfp.h>
  #include <linux/err.h>
  
  #include "drm_sysfs.h"
@@@ -354,7 -353,10 +354,10 @@@ static struct bin_attribute edid_attr 
  int drm_sysfs_connector_add(struct drm_connector *connector)
  {
        struct drm_device *dev = connector->dev;
-       int ret = 0, i, j;
+       int attr_cnt = 0;
+       int opt_cnt = 0;
+       int i;
+       int ret = 0;
  
        /* We shouldn't get called more than once for the same connector */
        BUG_ON(device_is_registered(&connector->kdev));
  
        /* Standard attributes */
  
-       for (i = 0; i < ARRAY_SIZE(connector_attrs); i++) {
-               ret = device_create_file(&connector->kdev, &connector_attrs[i]);
+       for (attr_cnt = 0; attr_cnt < ARRAY_SIZE(connector_attrs); attr_cnt++) {
+               ret = device_create_file(&connector->kdev, &connector_attrs[attr_cnt]);
                if (ret)
                        goto err_out_files;
        }
                case DRM_MODE_CONNECTOR_SVIDEO:
                case DRM_MODE_CONNECTOR_Component:
                case DRM_MODE_CONNECTOR_TV:
-                       for (i = 0; i < ARRAY_SIZE(connector_attrs_opt1); i++) {
-                               ret = device_create_file(&connector->kdev, &connector_attrs_opt1[i]);
+                       for (opt_cnt = 0; opt_cnt < ARRAY_SIZE(connector_attrs_opt1); opt_cnt++) {
+                               ret = device_create_file(&connector->kdev, &connector_attrs_opt1[opt_cnt]);
                                if (ret)
                                        goto err_out_files;
                        }
        return 0;
  
  err_out_files:
-       if (i > 0)
-               for (j = 0; j < i; j++)
-                       device_remove_file(&connector->kdev,
-                                          &connector_attrs[i]);
+       for (i = 0; i < opt_cnt; i++)
+               device_remove_file(&connector->kdev, &connector_attrs_opt1[i]);
+       for (i = 0; i < attr_cnt; i++)
+               device_remove_file(&connector->kdev, &connector_attrs[i]);
        device_unregister(&connector->kdev);
  
  out:
@@@ -26,7 -26,6 +26,7 @@@
   *          Jerome Glisse
   */
  #include <linux/seq_file.h>
 +#include <linux/slab.h>
  #include "drmP.h"
  #include "drm.h"
  #include "radeon_drm.h"
@@@ -2975,7 -2974,7 +2975,7 @@@ int r100_cs_track_check(struct radeon_d
  
        for (i = 0; i < track->num_cb; i++) {
                if (track->cb[i].robj == NULL) {
-                       if (!(track->fastfill || track->color_channel_mask ||
+                       if (!(track->zb_cb_clear || track->color_channel_mask ||
                              track->blend_read_enable)) {
                                continue;
                        }
@@@ -26,7 -26,6 +26,7 @@@
   *          Jerome Glisse
   */
  #include <linux/seq_file.h>
 +#include <linux/slab.h>
  #include "drmP.h"
  #include "drm.h"
  #include "radeon_reg.h"
@@@ -1044,7 -1043,7 +1044,7 @@@ static int r300_packet0_check(struct ra
                break;
        case 0x4d1c:
                /* ZB_BW_CNTL */
-               track->fastfill = !!(idx_value & (1 << 2));
+               track->zb_cb_clear = !!(idx_value & (1 << 5));
                break;
        case 0x4e04:
                /* RB3D_BLENDCNTL */