Merge remote branch 'intel/drm-intel-next' of /ssd/git/drm-next into drm-core-next
authorDave Airlie <airlied@redhat.com>
Tue, 3 Aug 2010 23:51:27 +0000 (09:51 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 3 Aug 2010 23:51:27 +0000 (09:51 +1000)
* 'intel/drm-intel-next' of /ssd/git/drm-next: (230 commits)
  drm/i915: Clear the Ironlake dithering flags when the pipe doesn't want it.
  drm/agp/i915: trim stolen space to 32M
  drm/i915: Unset cursor if out-of-bounds upon mode change (v4)
  drm/i915: Unreference object not handle on creation
  drm/i915: Attempt to uncouple object after catastrophic failure in unbind
  drm/i915: Repeat unbinding during free if interrupted (v6)
  drm/i915: Refactor i915_gem_retire_requests()
  drm/i915: Warn if we run out of FIFO space for a mode
  drm/i915: Round up the watermark entries (v3)
  drm/i915: Typo in (unused) register mask for overlay.
  drm/i915: Check overlay stride errata for i830 and i845
  drm/i915: Validate the mode for eDP by using fixed panel size
  drm/i915: Always use the fixed panel timing for eDP
  drm/i915: Enable panel fitting for eDP
  drm/i915: Add fixed panel mode parsed from EDID for eDP without fixed mode in VBT
  drm/i915/sdvo: Set sync polarity based on actual mode
  drm/i915/hdmi: Set sync polarity based on actual mode
  drm/i915/pch: Set transcoder sync polarity for DP based on actual mode
  drm/i915: Initialize LVDS and eDP outputs before anything else
  drm/i915/dp: Correctly report eDP in the core connector type
  ...

44 files changed:
drivers/gpu/drm/Makefile
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_global.c [moved from drivers/gpu/drm/ttm/ttm_global.c with 79% similarity]
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_ttm.c
drivers/gpu/drm/radeon/atombios_crtc.c
drivers/gpu/drm/radeon/atombios_dp.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r100d.h
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r300d.h
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_atombios.c
drivers/gpu/drm/radeon/radeon_combios.c
drivers/gpu/drm/radeon/radeon_connectors.c
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/radeon_encoders.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_legacy_crtc.c
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
drivers/gpu/drm/radeon/radeon_legacy_tv.c
drivers/gpu/drm/radeon/radeon_pm.c
drivers/gpu/drm/radeon/radeon_ttm.c
drivers/gpu/drm/radeon/reg_srcs/r300
drivers/gpu/drm/radeon/reg_srcs/r420
drivers/gpu/drm/radeon/reg_srcs/rs600
drivers/gpu/drm/radeon/reg_srcs/rv515
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/radeon/rs690.c
drivers/gpu/drm/radeon/rv515.c
drivers/gpu/drm/ttm/Makefile
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_module.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
include/drm/drm.h
include/drm/drmP.h
include/drm/drm_global.h [new file with mode: 0644]
include/drm/radeon_drm.h
include/drm/ttm/ttm_bo_driver.h
include/drm/ttm/ttm_module.h

index df8f923228656c095f7c57d770aa8b0e7af2abc0..f3a23a329f4e29e7817755bf7f9f367cbdd74d0a 100644 (file)
@@ -12,7 +12,7 @@ drm-y       :=        drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \
                drm_platform.o drm_sysfs.o drm_hashtab.o drm_sman.o drm_mm.o \
                drm_crtc.o drm_modes.o drm_edid.o \
                drm_info.o drm_debugfs.o drm_encoder_slave.o \
-               drm_trace_points.o
+               drm_trace_points.o drm_global.o
 
 drm-$(CONFIG_COMPAT) += drm_ioc32.o
 
index b5a51686f492edce08e59bc0bb9fb391a5faae34..d5b349d279f5ce04a2adaaeafe71e8b4ceb7468b 100644 (file)
@@ -288,6 +288,7 @@ static int __init drm_core_init(void)
 {
        int ret = -ENOMEM;
 
+       drm_global_init();
        idr_init(&drm_minors_idr);
 
        if (register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops))
similarity index 79%
rename from drivers/gpu/drm/ttm/ttm_global.c
rename to drivers/gpu/drm/drm_global.c
index b17007178a36e57bb59c82e8f3378fe9f5741d29..c87dc96444de6f1b314f5919ae37c99b2542832b 100644 (file)
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
-#include "ttm/ttm_module.h"
 #include <linux/mutex.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include "drm_global.h"
 
-struct ttm_global_item {
+struct drm_global_item {
        struct mutex mutex;
        void *object;
        int refcount;
 };
 
-static struct ttm_global_item glob[TTM_GLOBAL_NUM];
+static struct drm_global_item glob[DRM_GLOBAL_NUM];
 
-void ttm_global_init(void)
+void drm_global_init(void)
 {
        int i;
 
-       for (i = 0; i < TTM_GLOBAL_NUM; ++i) {
-               struct ttm_global_item *item = &glob[i];
+       for (i = 0; i < DRM_GLOBAL_NUM; ++i) {
+               struct drm_global_item *item = &glob[i];
                mutex_init(&item->mutex);
                item->object = NULL;
                item->refcount = 0;
        }
 }
 
-void ttm_global_release(void)
+void drm_global_release(void)
 {
        int i;
-       for (i = 0; i < TTM_GLOBAL_NUM; ++i) {
-               struct ttm_global_item *item = &glob[i];
+       for (i = 0; i < DRM_GLOBAL_NUM; ++i) {
+               struct drm_global_item *item = &glob[i];
                BUG_ON(item->object != NULL);
                BUG_ON(item->refcount != 0);
        }
 }
 
-int ttm_global_item_ref(struct ttm_global_reference *ref)
+int drm_global_item_ref(struct drm_global_reference *ref)
 {
        int ret;
-       struct ttm_global_item *item = &glob[ref->global_type];
+       struct drm_global_item *item = &glob[ref->global_type];
        void *object;
 
        mutex_lock(&item->mutex);
@@ -93,11 +93,11 @@ out_err:
        item->object = NULL;
        return ret;
 }
-EXPORT_SYMBOL(ttm_global_item_ref);
+EXPORT_SYMBOL(drm_global_item_ref);
 
-void ttm_global_item_unref(struct ttm_global_reference *ref)
+void drm_global_item_unref(struct drm_global_reference *ref)
 {
-       struct ttm_global_item *item = &glob[ref->global_type];
+       struct drm_global_item *item = &glob[ref->global_type];
 
        mutex_lock(&item->mutex);
        BUG_ON(item->refcount == 0);
@@ -108,5 +108,5 @@ void ttm_global_item_unref(struct ttm_global_reference *ref)
        }
        mutex_unlock(&item->mutex);
 }
-EXPORT_SYMBOL(ttm_global_item_unref);
+EXPORT_SYMBOL(drm_global_item_unref);
 
index d0a35d9ba522004d419dba43858593e3ff4e3f0e..e15db15dca77507ec13614ecc2cac5d2ec147bd4 100644 (file)
@@ -533,7 +533,7 @@ struct drm_nouveau_private {
        struct list_head vbl_waiting;
 
        struct {
-               struct ttm_global_reference mem_global_ref;
+               struct drm_global_reference mem_global_ref;
                struct ttm_bo_global_ref bo_global_ref;
                struct ttm_bo_device bdev;
                spinlock_t bo_list_lock;
index c385d50f041b0f6ecf6e08cb6c58effba677c942..bd35f930568c922b9b275aa3de418c502e543e7f 100644 (file)
@@ -42,13 +42,13 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
 }
 
 static int
-nouveau_ttm_mem_global_init(struct ttm_global_reference *ref)
+nouveau_ttm_mem_global_init(struct drm_global_reference *ref)
 {
        return ttm_mem_global_init(ref->object);
 }
 
 static void
-nouveau_ttm_mem_global_release(struct ttm_global_reference *ref)
+nouveau_ttm_mem_global_release(struct drm_global_reference *ref)
 {
        ttm_mem_global_release(ref->object);
 }
@@ -56,16 +56,16 @@ nouveau_ttm_mem_global_release(struct ttm_global_reference *ref)
 int
 nouveau_ttm_global_init(struct drm_nouveau_private *dev_priv)
 {
-       struct ttm_global_reference *global_ref;
+       struct drm_global_reference *global_ref;
        int ret;
 
        global_ref = &dev_priv->ttm.mem_global_ref;
-       global_ref->global_type = TTM_GLOBAL_TTM_MEM;
+       global_ref->global_type = DRM_GLOBAL_TTM_MEM;
        global_ref->size = sizeof(struct ttm_mem_global);
        global_ref->init = &nouveau_ttm_mem_global_init;
        global_ref->release = &nouveau_ttm_mem_global_release;
 
-       ret = ttm_global_item_ref(global_ref);
+       ret = drm_global_item_ref(global_ref);
        if (unlikely(ret != 0)) {
                DRM_ERROR("Failed setting up TTM memory accounting\n");
                dev_priv->ttm.mem_global_ref.release = NULL;
@@ -74,15 +74,15 @@ nouveau_ttm_global_init(struct drm_nouveau_private *dev_priv)
 
        dev_priv->ttm.bo_global_ref.mem_glob = global_ref->object;
        global_ref = &dev_priv->ttm.bo_global_ref.ref;
-       global_ref->global_type = TTM_GLOBAL_TTM_BO;
+       global_ref->global_type = DRM_GLOBAL_TTM_BO;
        global_ref->size = sizeof(struct ttm_bo_global);
        global_ref->init = &ttm_bo_global_init;
        global_ref->release = &ttm_bo_global_release;
 
-       ret = ttm_global_item_ref(global_ref);
+       ret = drm_global_item_ref(global_ref);
        if (unlikely(ret != 0)) {
                DRM_ERROR("Failed setting up TTM BO subsystem\n");
-               ttm_global_item_unref(&dev_priv->ttm.mem_global_ref);
+               drm_global_item_unref(&dev_priv->ttm.mem_global_ref);
                dev_priv->ttm.mem_global_ref.release = NULL;
                return ret;
        }
@@ -96,8 +96,8 @@ nouveau_ttm_global_release(struct drm_nouveau_private *dev_priv)
        if (dev_priv->ttm.mem_global_ref.release == NULL)
                return;
 
-       ttm_global_item_unref(&dev_priv->ttm.bo_global_ref.ref);
-       ttm_global_item_unref(&dev_priv->ttm.mem_global_ref);
+       drm_global_item_unref(&dev_priv->ttm.bo_global_ref.ref);
+       drm_global_item_unref(&dev_priv->ttm.mem_global_ref);
        dev_priv->ttm.mem_global_ref.release = NULL;
 }
 
index ec702345d70e545be2c2c80545d8d1c69a80f0ac..a2e65d9f2a1ce71b36381d704e83906a10f6b1f1 100644 (file)
@@ -818,7 +818,7 @@ static int evergreen_crtc_set_base(struct drm_crtc *crtc, int x, int y,
 
        /* no fb bound */
        if (!crtc->fb) {
-               DRM_DEBUG("No FB bound\n");
+               DRM_DEBUG_KMS("No FB bound\n");
                return 0;
        }
 
@@ -957,7 +957,7 @@ static int avivo_crtc_set_base(struct drm_crtc *crtc, int x, int y,
 
        /* no fb bound */
        if (!crtc->fb) {
-               DRM_DEBUG("No FB bound\n");
+               DRM_DEBUG_KMS("No FB bound\n");
                return 0;
        }
 
index abffb1499e227a39b24170c3c0212d0613c41961..36e0d4b545e60b674380746496525fed8b88ad39 100644 (file)
@@ -296,7 +296,7 @@ static void dp_get_adjust_train(u8 link_status[DP_LINK_STATUS_SIZE],
                u8 this_v = dp_get_adjust_request_voltage(link_status, lane);
                u8 this_p = dp_get_adjust_request_pre_emphasis(link_status, lane);
 
-               DRM_DEBUG("requested signal parameters: lane %d voltage %s pre_emph %s\n",
+               DRM_DEBUG_KMS("requested signal parameters: lane %d voltage %s pre_emph %s\n",
                          lane,
                          voltage_names[this_v >> DP_TRAIN_VOLTAGE_SWING_SHIFT],
                          pre_emph_names[this_p >> DP_TRAIN_PRE_EMPHASIS_SHIFT]);
@@ -313,7 +313,7 @@ static void dp_get_adjust_train(u8 link_status[DP_LINK_STATUS_SIZE],
        if (p >= dp_pre_emphasis_max(v))
                p = dp_pre_emphasis_max(v) | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED;
 
-       DRM_DEBUG("using signal parameters: voltage %s pre_emph %s\n",
+       DRM_DEBUG_KMS("using signal parameters: voltage %s pre_emph %s\n",
                  voltage_names[(v & DP_TRAIN_VOLTAGE_SWING_MASK) >> DP_TRAIN_VOLTAGE_SWING_SHIFT],
                  pre_emph_names[(p & DP_TRAIN_PRE_EMPHASIS_MASK) >> DP_TRAIN_PRE_EMPHASIS_SHIFT]);
 
@@ -358,7 +358,7 @@ retry:
        if (args.v1.ucReplyStatus && !args.v1.ucDataOutLen) {
                if (args.v1.ucReplyStatus == 0x20 && retry_count++ < 10)
                        goto retry;
-               DRM_DEBUG("failed to get auxch %02x%02x %02x %02x 0x%02x %02x after %d retries\n",
+               DRM_DEBUG_KMS("failed to get auxch %02x%02x %02x %02x 0x%02x %02x after %d retries\n",
                          req_bytes[1], req_bytes[0], req_bytes[2], req_bytes[3],
                          chan->rec.i2c_id, args.v1.ucReplyStatus, retry_count);
                return false;
@@ -461,10 +461,10 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
                memcpy(dig_connector->dpcd, msg, 8);
                {
                        int i;
-                       DRM_DEBUG("DPCD: ");
+                       DRM_DEBUG_KMS("DPCD: ");
                        for (i = 0; i < 8; i++)
-                               DRM_DEBUG("%02x ", msg[i]);
-                       DRM_DEBUG("\n");
+                               DRM_DEBUG_KMS("%02x ", msg[i]);
+                       DRM_DEBUG_KMS("\n");
                }
                return true;
        }
@@ -512,7 +512,7 @@ static bool atom_dp_get_link_status(struct radeon_connector *radeon_connector,
                return false;
        }
 
-       DRM_DEBUG("link status %02x %02x %02x %02x %02x %02x\n",
+       DRM_DEBUG_KMS("link status %02x %02x %02x %02x %02x %02x\n",
                  link_status[0], link_status[1], link_status[2],
                  link_status[3], link_status[4], link_status[5]);
        return true;
@@ -695,7 +695,7 @@ void dp_link_train(struct drm_encoder *encoder,
        if (!clock_recovery)
                DRM_ERROR("clock recovery failed\n");
        else
-               DRM_DEBUG("clock recovery at voltage %d pre-emphasis %d\n",
+               DRM_DEBUG_KMS("clock recovery at voltage %d pre-emphasis %d\n",
                          train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK,
                          (train_set[0] & DP_TRAIN_PRE_EMPHASIS_MASK) >>
                          DP_TRAIN_PRE_EMPHASIS_SHIFT);
@@ -739,7 +739,7 @@ void dp_link_train(struct drm_encoder *encoder,
        if (!channel_eq)
                DRM_ERROR("channel eq failed\n");
        else
-               DRM_DEBUG("channel eq at voltage %d pre-emphasis %d\n",
+               DRM_DEBUG_KMS("channel eq at voltage %d pre-emphasis %d\n",
                          train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK,
                          (train_set[0] & DP_TRAIN_PRE_EMPHASIS_MASK)
                          >> DP_TRAIN_PRE_EMPHASIS_SHIFT);
index e115583f84fb03dd48f9716694668a8268d54a60..e817a0bb5eb4a71550d0c9f6f8697cd80c31914e 100644 (file)
@@ -141,7 +141,7 @@ void r100_pm_get_dynpm_state(struct radeon_device *rdev)
        /* only one clock mode per power state */
        rdev->pm.requested_clock_mode_index = 0;
 
-       DRM_DEBUG("Requested: e: %d m: %d p: %d\n",
+       DRM_DEBUG_DRIVER("Requested: e: %d m: %d p: %d\n",
                  rdev->pm.power_state[rdev->pm.requested_power_state_index].
                  clock_info[rdev->pm.requested_clock_mode_index].sclk,
                  rdev->pm.power_state[rdev->pm.requested_power_state_index].
@@ -276,7 +276,7 @@ void r100_pm_misc(struct radeon_device *rdev)
             rdev->pm.power_state[rdev->pm.current_power_state_index].pcie_lanes)) {
                radeon_set_pcie_lanes(rdev,
                                      ps->pcie_lanes);
-               DRM_DEBUG("Setting: p: %d\n", ps->pcie_lanes);
+               DRM_DEBUG_DRIVER("Setting: p: %d\n", ps->pcie_lanes);
        }
 }
 
@@ -849,7 +849,7 @@ static int r100_cp_init_microcode(struct radeon_device *rdev)
        const char *fw_name = NULL;
        int err;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        pdev = platform_device_register_simple("radeon_cp", 0, NULL, 0);
        err = IS_ERR(pdev);
@@ -1803,6 +1803,11 @@ static int r100_packet3_check(struct radeon_cs_parser *p,
                        return r;
                break;
                /* triggers drawing using indices to vertex buffer */
+       case PACKET3_3D_CLEAR_HIZ:
+       case PACKET3_3D_CLEAR_ZMASK:
+               if (p->rdev->hyperz_filp != p->filp)
+                       return -EINVAL;
+               break;
        case PACKET3_NOP:
                break;
        default:
@@ -2642,7 +2647,7 @@ int r100_set_surface_reg(struct radeon_device *rdev, int reg,
                flags |= pitch / 8;
 
 
-       DRM_DEBUG("writing surface %d %d %x %x\n", reg, flags, offset, offset+obj_size-1);
+       DRM_DEBUG_KMS("writing surface %d %d %x %x\n", reg, flags, offset, offset+obj_size-1);
        WREG32(RADEON_SURFACE0_INFO + surf_index, flags);
        WREG32(RADEON_SURFACE0_LOWER_BOUND + surf_index, offset);
        WREG32(RADEON_SURFACE0_UPPER_BOUND + surf_index, offset + obj_size - 1);
@@ -3038,7 +3043,7 @@ void r100_bandwidth_update(struct radeon_device *rdev)
                }
 #endif
 
-               DRM_DEBUG("GRPH_BUFFER_CNTL from to %x\n",
+               DRM_DEBUG_KMS("GRPH_BUFFER_CNTL from to %x\n",
                          /*      (unsigned int)info->SavedReg->grph_buffer_cntl, */
                          (unsigned int)RREG32(RADEON_GRPH_BUFFER_CNTL));
        }
@@ -3134,7 +3139,7 @@ void r100_bandwidth_update(struct radeon_device *rdev)
                        WREG32(RS400_DISP1_REQ_CNTL1, 0x28FBC3AC);
                }
 
-               DRM_DEBUG("GRPH2_BUFFER_CNTL from to %x\n",
+               DRM_DEBUG_KMS("GRPH2_BUFFER_CNTL from to %x\n",
                          (unsigned int)RREG32(RADEON_GRPH2_BUFFER_CNTL));
        }
 }
index d016b16fa116148518fee22d805342f733ccc63a..b121b6c678d4846566e79aa4f387fdfc116408a5 100644 (file)
 #define                PACKET3_3D_DRAW_IMMD            0x29
 #define                PACKET3_3D_DRAW_INDX            0x2A
 #define                PACKET3_3D_LOAD_VBPNTR          0x2F
+#define                PACKET3_3D_CLEAR_ZMASK          0x32
 #define                PACKET3_INDX_BUFFER             0x33
 #define                PACKET3_3D_DRAW_VBUF_2          0x34
 #define                PACKET3_3D_DRAW_IMMD_2          0x35
 #define                PACKET3_3D_DRAW_INDX_2          0x36
+#define                PACKET3_3D_CLEAR_HIZ            0x37
 #define                PACKET3_BITBLT_MULTI            0x9B
 
 #define PACKET0(reg, n)        (CP_PACKET0 |                                   \
index 58eab5d473058fa51aca846452233e850cccca30..c827738ad7ddbe620323937f97c5cc8953365338 100644 (file)
@@ -1048,14 +1048,47 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
                /* RB3D_COLOR_CHANNEL_MASK */
                track->color_channel_mask = idx_value;
                break;
-       case 0x4d1c:
+       case 0x43a4:
+               /* SC_HYPERZ_EN */
+               /* r300c emits this register - we need to disable hyperz for it
+                * without complaining */
+               if (p->rdev->hyperz_filp != p->filp) {
+                       if (idx_value & 0x1)
+                               ib[idx] = idx_value & ~1;
+               }
+               break;
+       case 0x4f1c:
                /* ZB_BW_CNTL */
                track->zb_cb_clear = !!(idx_value & (1 << 5));
+               if (p->rdev->hyperz_filp != p->filp) {
+                       if (idx_value & (R300_HIZ_ENABLE |
+                                        R300_RD_COMP_ENABLE |
+                                        R300_WR_COMP_ENABLE |
+                                        R300_FAST_FILL_ENABLE))
+                               goto fail;
+               }
                break;
        case 0x4e04:
                /* RB3D_BLENDCNTL */
                track->blend_read_enable = !!(idx_value & (1 << 2));
                break;
+       case 0x4f28: /* ZB_DEPTHCLEARVALUE */
+               break;
+       case 0x4f30: /* ZB_MASK_OFFSET */
+       case 0x4f34: /* ZB_ZMASK_PITCH */
+       case 0x4f44: /* ZB_HIZ_OFFSET */
+       case 0x4f54: /* ZB_HIZ_PITCH */
+               if (idx_value && (p->rdev->hyperz_filp != p->filp))
+                       goto fail;
+               break;
+       case 0x4028:
+               if (idx_value && (p->rdev->hyperz_filp != p->filp))
+                       goto fail;
+               /* GB_Z_PEQ_CONFIG */
+               if (p->rdev->family >= CHIP_RV350)
+                       break;
+               goto fail;
+               break;
        case 0x4be8:
                /* valid register only on RV530 */
                if (p->rdev->family == CHIP_RV530)
@@ -1066,8 +1099,8 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
        }
        return 0;
 fail:
-       printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n",
-              reg, idx);
+       printk(KERN_ERR "Forbidden register 0x%04X in cs at %d (val=%08x)\n",
+              reg, idx, idx_value);
        return -EINVAL;
 }
 
@@ -1161,6 +1194,11 @@ static int r300_packet3_check(struct radeon_cs_parser *p,
                        return r;
                }
                break;
+       case PACKET3_3D_CLEAR_HIZ:
+       case PACKET3_3D_CLEAR_ZMASK:
+               if (p->rdev->hyperz_filp != p->filp)
+                       return -EINVAL;
+               break;
        case PACKET3_NOP:
                break;
        default:
index 968a33317fbf64cfdb39738d03de3d0ba524ae45..0c036c60d9df4f8d167ece6b9dfe4909f67c583e 100644 (file)
 #define                PACKET3_3D_DRAW_IMMD            0x29
 #define                PACKET3_3D_DRAW_INDX            0x2A
 #define                PACKET3_3D_LOAD_VBPNTR          0x2F
+#define                PACKET3_3D_CLEAR_ZMASK          0x32
 #define                PACKET3_INDX_BUFFER             0x33
 #define                PACKET3_3D_DRAW_VBUF_2          0x34
 #define                PACKET3_3D_DRAW_IMMD_2          0x35
 #define                PACKET3_3D_DRAW_INDX_2          0x36
+#define                PACKET3_3D_CLEAR_HIZ            0x37
 #define                PACKET3_BITBLT_MULTI            0x9B
 
 #define PACKET0(reg, n)        (CP_PACKET0 |                                   \
index 28e39bc6768b652385a675e17f3300a44ea46150..d0ebae9dde25ba400778b210dfc2e6a86179d682 100644 (file)
@@ -271,7 +271,7 @@ void r600_pm_get_dynpm_state(struct radeon_device *rdev)
                }
        }
 
-       DRM_DEBUG("Requested: e: %d m: %d p: %d\n",
+       DRM_DEBUG_DRIVER("Requested: e: %d m: %d p: %d\n",
                  rdev->pm.power_state[rdev->pm.requested_power_state_index].
                  clock_info[rdev->pm.requested_clock_mode_index].sclk,
                  rdev->pm.power_state[rdev->pm.requested_power_state_index].
@@ -586,7 +586,7 @@ void r600_pm_misc(struct radeon_device *rdev)
                if (voltage->voltage != rdev->pm.current_vddc) {
                        radeon_atom_set_voltage(rdev, voltage->voltage);
                        rdev->pm.current_vddc = voltage->voltage;
-                       DRM_DEBUG("Setting: v: %d\n", voltage->voltage);
+                       DRM_DEBUG_DRIVER("Setting: v: %d\n", voltage->voltage);
                }
        }
 }
index c84f9a311550ae7726709a8bd42258c5207e45cb..3cd1c470b7770639c44151d6c9d627da435db07e 100644 (file)
@@ -235,7 +235,7 @@ struct radeon_surface_reg {
  */
 struct radeon_mman {
        struct ttm_bo_global_ref        bo_global_ref;
-       struct ttm_global_reference     mem_global_ref;
+       struct drm_global_reference     mem_global_ref;
        struct ttm_bo_device            bdev;
        bool                            mem_global_referenced;
        bool                            initialized;
@@ -1098,6 +1098,8 @@ struct radeon_device {
 
        bool powered_down;
        struct notifier_block acpi_nb;
+       /* only one userspace can use Hyperz features at a time */
+       struct drm_file *hyperz_filp;
 };
 
 int radeon_device_init(struct radeon_device *rdev,
index 0a97aeb083ddd12bfeb9b542b9eaa6a1c2c7ed2c..3bc2bcdf530815635c351743a6db7b95f1688462 100644 (file)
@@ -723,7 +723,7 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
                }
 
                if (i == ATOM_DEVICE_CV_INDEX) {
-                       DRM_DEBUG("Skipping Component Video\n");
+                       DRM_DEBUG_KMS("Skipping Component Video\n");
                        continue;
                }
 
@@ -1032,21 +1032,18 @@ bool radeon_atombios_sideport_present(struct radeon_device *rdev)
        u8 frev, crev;
        u16 data_offset;
 
+       /* sideport is AMD only */
+       if (rdev->family == CHIP_RS600)
+               return false;
+
        if (atom_parse_data_header(mode_info->atom_context, index, NULL,
                                   &frev, &crev, &data_offset)) {
                igp_info = (union igp_info *)(mode_info->atom_context->bios +
                                      data_offset);
                switch (crev) {
                case 1:
-                       /* AMD IGPS */
-                       if ((rdev->family == CHIP_RS690) ||
-                           (rdev->family == CHIP_RS740)) {
-                               if (igp_info->info.ulBootUpMemoryClock)
-                                       return true;
-                       } else {
-                               if (igp_info->info.ucMemoryType & 0xf0)
-                                       return true;
-                       }
+                       if (igp_info->info.ulBootUpMemoryClock)
+                               return true;
                        break;
                case 2:
                        if (igp_info->info_2.ucMemoryType & 0x0f)
@@ -1095,7 +1092,7 @@ bool radeon_atombios_get_tmds_info(struct radeon_encoder *encoder,
                            (tmds_info->asMiscInfo[i].
                             ucPLL_VoltageSwing & 0xf) << 16;
 
-                       DRM_DEBUG("TMDS PLL From ATOMBIOS %u %x\n",
+                       DRM_DEBUG_KMS("TMDS PLL From ATOMBIOS %u %x\n",
                                  tmds->tmds_pll[i].freq,
                                  tmds->tmds_pll[i].value);
 
@@ -2187,11 +2184,11 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_TV1_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_TV1_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("TV1 connected\n");
+                       DRM_DEBUG_KMS("TV1 connected\n");
                        bios_3_scratch |= ATOM_S3_TV1_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_TV1;
                } else {
-                       DRM_DEBUG("TV1 disconnected\n");
+                       DRM_DEBUG_KMS("TV1 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_TV1_MASK;
                        bios_3_scratch &= ~ATOM_S3_TV1_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_TV1;
@@ -2200,11 +2197,11 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_CV_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_CV_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("CV connected\n");
+                       DRM_DEBUG_KMS("CV connected\n");
                        bios_3_scratch |= ATOM_S3_CV_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_CV;
                } else {
-                       DRM_DEBUG("CV disconnected\n");
+                       DRM_DEBUG_KMS("CV disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_CV_MASK;
                        bios_3_scratch &= ~ATOM_S3_CV_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_CV;
@@ -2213,12 +2210,12 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_LCD1_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_LCD1_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("LCD1 connected\n");
+                       DRM_DEBUG_KMS("LCD1 connected\n");
                        bios_0_scratch |= ATOM_S0_LCD1;
                        bios_3_scratch |= ATOM_S3_LCD1_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_LCD1;
                } else {
-                       DRM_DEBUG("LCD1 disconnected\n");
+                       DRM_DEBUG_KMS("LCD1 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_LCD1;
                        bios_3_scratch &= ~ATOM_S3_LCD1_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_LCD1;
@@ -2227,12 +2224,12 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_CRT1_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_CRT1_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("CRT1 connected\n");
+                       DRM_DEBUG_KMS("CRT1 connected\n");
                        bios_0_scratch |= ATOM_S0_CRT1_COLOR;
                        bios_3_scratch |= ATOM_S3_CRT1_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_CRT1;
                } else {
-                       DRM_DEBUG("CRT1 disconnected\n");
+                       DRM_DEBUG_KMS("CRT1 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_CRT1_MASK;
                        bios_3_scratch &= ~ATOM_S3_CRT1_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_CRT1;
@@ -2241,12 +2238,12 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_CRT2_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_CRT2_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("CRT2 connected\n");
+                       DRM_DEBUG_KMS("CRT2 connected\n");
                        bios_0_scratch |= ATOM_S0_CRT2_COLOR;
                        bios_3_scratch |= ATOM_S3_CRT2_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_CRT2;
                } else {
-                       DRM_DEBUG("CRT2 disconnected\n");
+                       DRM_DEBUG_KMS("CRT2 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_CRT2_MASK;
                        bios_3_scratch &= ~ATOM_S3_CRT2_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_CRT2;
@@ -2255,12 +2252,12 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_DFP1_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_DFP1_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("DFP1 connected\n");
+                       DRM_DEBUG_KMS("DFP1 connected\n");
                        bios_0_scratch |= ATOM_S0_DFP1;
                        bios_3_scratch |= ATOM_S3_DFP1_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_DFP1;
                } else {
-                       DRM_DEBUG("DFP1 disconnected\n");
+                       DRM_DEBUG_KMS("DFP1 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_DFP1;
                        bios_3_scratch &= ~ATOM_S3_DFP1_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP1;
@@ -2269,12 +2266,12 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_DFP2_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_DFP2_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("DFP2 connected\n");
+                       DRM_DEBUG_KMS("DFP2 connected\n");
                        bios_0_scratch |= ATOM_S0_DFP2;
                        bios_3_scratch |= ATOM_S3_DFP2_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_DFP2;
                } else {
-                       DRM_DEBUG("DFP2 disconnected\n");
+                       DRM_DEBUG_KMS("DFP2 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_DFP2;
                        bios_3_scratch &= ~ATOM_S3_DFP2_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP2;
@@ -2283,12 +2280,12 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_DFP3_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_DFP3_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("DFP3 connected\n");
+                       DRM_DEBUG_KMS("DFP3 connected\n");
                        bios_0_scratch |= ATOM_S0_DFP3;
                        bios_3_scratch |= ATOM_S3_DFP3_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_DFP3;
                } else {
-                       DRM_DEBUG("DFP3 disconnected\n");
+                       DRM_DEBUG_KMS("DFP3 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_DFP3;
                        bios_3_scratch &= ~ATOM_S3_DFP3_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP3;
@@ -2297,12 +2294,12 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_DFP4_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_DFP4_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("DFP4 connected\n");
+                       DRM_DEBUG_KMS("DFP4 connected\n");
                        bios_0_scratch |= ATOM_S0_DFP4;
                        bios_3_scratch |= ATOM_S3_DFP4_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_DFP4;
                } else {
-                       DRM_DEBUG("DFP4 disconnected\n");
+                       DRM_DEBUG_KMS("DFP4 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_DFP4;
                        bios_3_scratch &= ~ATOM_S3_DFP4_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP4;
@@ -2311,12 +2308,12 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_DFP5_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_DFP5_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("DFP5 connected\n");
+                       DRM_DEBUG_KMS("DFP5 connected\n");
                        bios_0_scratch |= ATOM_S0_DFP5;
                        bios_3_scratch |= ATOM_S3_DFP5_ACTIVE;
                        bios_6_scratch |= ATOM_S6_ACC_REQ_DFP5;
                } else {
-                       DRM_DEBUG("DFP5 disconnected\n");
+                       DRM_DEBUG_KMS("DFP5 disconnected\n");
                        bios_0_scratch &= ~ATOM_S0_DFP5;
                        bios_3_scratch &= ~ATOM_S3_DFP5_ACTIVE;
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP5;
index 5e45cb27eb988cc5f38268adc86fef3ede1a59b2..5e1474cde4b4245b7ce8c6b6968da03568a6dc5f 100644 (file)
@@ -693,6 +693,10 @@ bool radeon_combios_sideport_present(struct radeon_device *rdev)
        struct drm_device *dev = rdev->ddev;
        u16 igp_info;
 
+       /* sideport is AMD only */
+       if (rdev->family == CHIP_RS400)
+               return false;
+
        igp_info = combios_get_table_offset(dev, COMBIOS_INTEGRATED_SYSTEM_INFO_TABLE);
 
        if (igp_info) {
@@ -1205,7 +1209,7 @@ bool radeon_legacy_get_tmds_info_from_combios(struct radeon_encoder *encoder,
                                    RBIOS32(tmds_info + i * 10 + 0x08);
                                tmds->tmds_pll[i].freq =
                                    RBIOS16(tmds_info + i * 10 + 0x10);
-                               DRM_DEBUG("TMDS PLL From COMBIOS %u %x\n",
+                               DRM_DEBUG_KMS("TMDS PLL From COMBIOS %u %x\n",
                                          tmds->tmds_pll[i].freq,
                                          tmds->tmds_pll[i].value);
                        }
@@ -1223,7 +1227,7 @@ bool radeon_legacy_get_tmds_info_from_combios(struct radeon_encoder *encoder,
                                        stride += 10;
                                else
                                        stride += 6;
-                               DRM_DEBUG("TMDS PLL From COMBIOS %u %x\n",
+                               DRM_DEBUG_KMS("TMDS PLL From COMBIOS %u %x\n",
                                          tmds->tmds_pll[i].freq,
                                          tmds->tmds_pll[i].value);
                        }
@@ -2208,7 +2212,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
                uint16_t tmds_info =
                    combios_get_table_offset(dev, COMBIOS_DFP_INFO_TABLE);
                if (tmds_info) {
-                       DRM_DEBUG("Found DFP table, assuming DVI connector\n");
+                       DRM_DEBUG_KMS("Found DFP table, assuming DVI connector\n");
 
                        radeon_add_legacy_encoder(dev,
                                                  radeon_get_encoder_id(dev,
@@ -2234,7 +2238,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
                } else {
                        uint16_t crt_info =
                                combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE);
-                       DRM_DEBUG("Found CRT table, assuming VGA connector\n");
+                       DRM_DEBUG_KMS("Found CRT table, assuming VGA connector\n");
                        if (crt_info) {
                                radeon_add_legacy_encoder(dev,
                                                          radeon_get_encoder_id(dev,
@@ -2251,7 +2255,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
                                                            CONNECTOR_OBJECT_ID_VGA,
                                                            &hpd);
                        } else {
-                               DRM_DEBUG("No connector info found\n");
+                               DRM_DEBUG_KMS("No connector info found\n");
                                return false;
                        }
                }
@@ -2340,7 +2344,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
                                        ddc_i2c.valid = false;
                                        break;
                                }
-                               DRM_DEBUG("LCD DDC Info Table found!\n");
+                               DRM_DEBUG_KMS("LCD DDC Info Table found!\n");
                        } else
                                ddc_i2c.valid = false;
 
@@ -3118,14 +3122,14 @@ radeon_combios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_TV1_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_TV1_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("TV1 connected\n");
+                       DRM_DEBUG_KMS("TV1 connected\n");
                        /* fix me */
                        bios_4_scratch |= RADEON_TV1_ATTACHED_SVIDEO;
                        /*save->bios_4_scratch |= RADEON_TV1_ATTACHED_COMP; */
                        bios_5_scratch |= RADEON_TV1_ON;
                        bios_5_scratch |= RADEON_ACC_REQ_TV1;
                } else {
-                       DRM_DEBUG("TV1 disconnected\n");
+                       DRM_DEBUG_KMS("TV1 disconnected\n");
                        bios_4_scratch &= ~RADEON_TV1_ATTACHED_MASK;
                        bios_5_scratch &= ~RADEON_TV1_ON;
                        bios_5_scratch &= ~RADEON_ACC_REQ_TV1;
@@ -3134,12 +3138,12 @@ radeon_combios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_LCD1_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_LCD1_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("LCD1 connected\n");
+                       DRM_DEBUG_KMS("LCD1 connected\n");
                        bios_4_scratch |= RADEON_LCD1_ATTACHED;
                        bios_5_scratch |= RADEON_LCD1_ON;
                        bios_5_scratch |= RADEON_ACC_REQ_LCD1;
                } else {
-                       DRM_DEBUG("LCD1 disconnected\n");
+                       DRM_DEBUG_KMS("LCD1 disconnected\n");
                        bios_4_scratch &= ~RADEON_LCD1_ATTACHED;
                        bios_5_scratch &= ~RADEON_LCD1_ON;
                        bios_5_scratch &= ~RADEON_ACC_REQ_LCD1;
@@ -3148,12 +3152,12 @@ radeon_combios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_CRT1_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_CRT1_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("CRT1 connected\n");
+                       DRM_DEBUG_KMS("CRT1 connected\n");
                        bios_4_scratch |= RADEON_CRT1_ATTACHED_COLOR;
                        bios_5_scratch |= RADEON_CRT1_ON;
                        bios_5_scratch |= RADEON_ACC_REQ_CRT1;
                } else {
-                       DRM_DEBUG("CRT1 disconnected\n");
+                       DRM_DEBUG_KMS("CRT1 disconnected\n");
                        bios_4_scratch &= ~RADEON_CRT1_ATTACHED_MASK;
                        bios_5_scratch &= ~RADEON_CRT1_ON;
                        bios_5_scratch &= ~RADEON_ACC_REQ_CRT1;
@@ -3162,12 +3166,12 @@ radeon_combios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_CRT2_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_CRT2_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("CRT2 connected\n");
+                       DRM_DEBUG_KMS("CRT2 connected\n");
                        bios_4_scratch |= RADEON_CRT2_ATTACHED_COLOR;
                        bios_5_scratch |= RADEON_CRT2_ON;
                        bios_5_scratch |= RADEON_ACC_REQ_CRT2;
                } else {
-                       DRM_DEBUG("CRT2 disconnected\n");
+                       DRM_DEBUG_KMS("CRT2 disconnected\n");
                        bios_4_scratch &= ~RADEON_CRT2_ATTACHED_MASK;
                        bios_5_scratch &= ~RADEON_CRT2_ON;
                        bios_5_scratch &= ~RADEON_ACC_REQ_CRT2;
@@ -3176,12 +3180,12 @@ radeon_combios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_DFP1_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_DFP1_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("DFP1 connected\n");
+                       DRM_DEBUG_KMS("DFP1 connected\n");
                        bios_4_scratch |= RADEON_DFP1_ATTACHED;
                        bios_5_scratch |= RADEON_DFP1_ON;
                        bios_5_scratch |= RADEON_ACC_REQ_DFP1;
                } else {
-                       DRM_DEBUG("DFP1 disconnected\n");
+                       DRM_DEBUG_KMS("DFP1 disconnected\n");
                        bios_4_scratch &= ~RADEON_DFP1_ATTACHED;
                        bios_5_scratch &= ~RADEON_DFP1_ON;
                        bios_5_scratch &= ~RADEON_ACC_REQ_DFP1;
@@ -3190,12 +3194,12 @@ radeon_combios_connected_scratch_regs(struct drm_connector *connector,
        if ((radeon_encoder->devices & ATOM_DEVICE_DFP2_SUPPORT) &&
            (radeon_connector->devices & ATOM_DEVICE_DFP2_SUPPORT)) {
                if (connected) {
-                       DRM_DEBUG("DFP2 connected\n");
+                       DRM_DEBUG_KMS("DFP2 connected\n");
                        bios_4_scratch |= RADEON_DFP2_ATTACHED;
                        bios_5_scratch |= RADEON_DFP2_ON;
                        bios_5_scratch |= RADEON_ACC_REQ_DFP2;
                } else {
-                       DRM_DEBUG("DFP2 disconnected\n");
+                       DRM_DEBUG_KMS("DFP2 disconnected\n");
                        bios_4_scratch &= ~RADEON_DFP2_ATTACHED;
                        bios_5_scratch &= ~RADEON_DFP2_ON;
                        bios_5_scratch &= ~RADEON_ACC_REQ_DFP2;
index adccbc2c202c6b01e22cca3f1ae27dc0334e351b..6b9aac754f10d42ca8eb2a6d5d746bfd29c56812 100644 (file)
@@ -214,7 +214,7 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
                mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
                drm_mode_set_name(mode);
 
-               DRM_DEBUG("Adding native panel mode %s\n", mode->name);
+               DRM_DEBUG_KMS("Adding native panel mode %s\n", mode->name);
        } else if (native_mode->hdisplay != 0 &&
                   native_mode->vdisplay != 0) {
                /* mac laptops without an edid */
@@ -226,7 +226,7 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
                 */
                mode = drm_cvt_mode(dev, native_mode->hdisplay, native_mode->vdisplay, 60, true, false, false);
                mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
-               DRM_DEBUG("Adding cvt approximation of native panel mode %s\n", mode->name);
+               DRM_DEBUG_KMS("Adding cvt approximation of native panel mode %s\n", mode->name);
        }
        return mode;
 }
@@ -522,7 +522,7 @@ static int radeon_lvds_set_property(struct drm_connector *connector,
        struct radeon_encoder *radeon_encoder;
        enum radeon_rmx_type rmx_type;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
        if (property != dev->mode_config.scaling_mode_property)
                return 0;
 
@@ -1082,6 +1082,8 @@ radeon_add_atom_connector(struct drm_device *dev,
                drm_connector_attach_property(&radeon_connector->base,
                                              rdev->mode_info.load_detect_property,
                                              1);
+               /* no HPD on analog connectors */
+               radeon_connector->hpd.hpd = RADEON_HPD_NONE;
                connector->polled = DRM_CONNECTOR_POLL_CONNECT;
                break;
        case DRM_MODE_CONNECTOR_DVIA:
@@ -1096,6 +1098,8 @@ radeon_add_atom_connector(struct drm_device *dev,
                drm_connector_attach_property(&radeon_connector->base,
                                              rdev->mode_info.load_detect_property,
                                              1);
+               /* no HPD on analog connectors */
+               radeon_connector->hpd.hpd = RADEON_HPD_NONE;
                break;
        case DRM_MODE_CONNECTOR_DVII:
        case DRM_MODE_CONNECTOR_DVID:
@@ -1186,6 +1190,8 @@ radeon_add_atom_connector(struct drm_device *dev,
                        drm_connector_attach_property(&radeon_connector->base,
                                                      rdev->mode_info.tv_std_property,
                                                      radeon_atombios_get_tv_info(rdev));
+                       /* no HPD on analog connectors */
+                       radeon_connector->hpd.hpd = RADEON_HPD_NONE;
                }
                break;
        case DRM_MODE_CONNECTOR_LVDS:
@@ -1209,7 +1215,7 @@ radeon_add_atom_connector(struct drm_device *dev,
                break;
        }
 
-       if (hpd->hpd == RADEON_HPD_NONE) {
+       if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) {
                if (i2c_bus->valid)
                        connector->polled = DRM_CONNECTOR_POLL_CONNECT;
        } else
@@ -1276,6 +1282,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
                drm_connector_attach_property(&radeon_connector->base,
                                              rdev->mode_info.load_detect_property,
                                              1);
+               /* no HPD on analog connectors */
+               radeon_connector->hpd.hpd = RADEON_HPD_NONE;
                connector->polled = DRM_CONNECTOR_POLL_CONNECT;
                break;
        case DRM_MODE_CONNECTOR_DVIA:
@@ -1290,6 +1298,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
                drm_connector_attach_property(&radeon_connector->base,
                                              rdev->mode_info.load_detect_property,
                                              1);
+               /* no HPD on analog connectors */
+               radeon_connector->hpd.hpd = RADEON_HPD_NONE;
                break;
        case DRM_MODE_CONNECTOR_DVII:
        case DRM_MODE_CONNECTOR_DVID:
@@ -1328,6 +1338,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
                        drm_connector_attach_property(&radeon_connector->base,
                                                      rdev->mode_info.tv_std_property,
                                                      radeon_combios_get_tv_info(rdev));
+                       /* no HPD on analog connectors */
+                       radeon_connector->hpd.hpd = RADEON_HPD_NONE;
                }
                break;
        case DRM_MODE_CONNECTOR_LVDS:
@@ -1345,7 +1357,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
                break;
        }
 
-       if (hpd->hpd == RADEON_HPD_NONE) {
+       if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) {
                if (i2c_bus->valid)
                        connector->polled = DRM_CONNECTOR_POLL_CONNECT;
        } else
index 0fea894fc1271d428759b26fb8642a22b8394a71..a64811a94519a1ce5bd245d7f2c864e0d68ecf3d 100644 (file)
@@ -737,7 +737,8 @@ void radeon_device_fini(struct radeon_device *rdev)
        destroy_workqueue(rdev->wq);
        vga_switcheroo_unregister_client(rdev->pdev);
        vga_client_register(rdev->pdev, NULL, NULL, NULL);
-       pci_iounmap(rdev->pdev, rdev->rio_mem);
+       if (rdev->rio_mem)
+               pci_iounmap(rdev->pdev, rdev->rio_mem);
        rdev->rio_mem = NULL;
        iounmap(rdev->rmmio);
        rdev->rmmio = NULL;
index a68728dbd41dd2db8e4b2d4d66b305f022e54f06..283beedc2cbf4f9e6701686c6b56033e95ff460b 100644 (file)
@@ -42,7 +42,7 @@ static void avivo_crtc_load_lut(struct drm_crtc *crtc)
        struct radeon_device *rdev = dev->dev_private;
        int i;
 
-       DRM_DEBUG("%d\n", radeon_crtc->crtc_id);
+       DRM_DEBUG_KMS("%d\n", radeon_crtc->crtc_id);
        WREG32(AVIVO_DC_LUTA_CONTROL + radeon_crtc->crtc_offset, 0);
 
        WREG32(AVIVO_DC_LUTA_BLACK_OFFSET_BLUE + radeon_crtc->crtc_offset, 0);
@@ -75,7 +75,7 @@ static void evergreen_crtc_load_lut(struct drm_crtc *crtc)
        struct radeon_device *rdev = dev->dev_private;
        int i;
 
-       DRM_DEBUG("%d\n", radeon_crtc->crtc_id);
+       DRM_DEBUG_KMS("%d\n", radeon_crtc->crtc_id);
        WREG32(EVERGREEN_DC_LUT_CONTROL + radeon_crtc->crtc_offset, 0);
 
        WREG32(EVERGREEN_DC_LUT_BLACK_OFFSET_BLUE + radeon_crtc->crtc_offset, 0);
@@ -469,7 +469,7 @@ static void radeon_compute_pll_legacy(struct radeon_pll *pll,
        uint32_t post_div;
        u32 pll_out_min, pll_out_max;
 
-       DRM_DEBUG("PLL freq %llu %u %u\n", freq, pll->min_ref_div, pll->max_ref_div);
+       DRM_DEBUG_KMS("PLL freq %llu %u %u\n", freq, pll->min_ref_div, pll->max_ref_div);
        freq = freq * 1000;
 
        if (pll->flags & RADEON_PLL_IS_LCD) {
@@ -805,7 +805,7 @@ done:
        *ref_div_p = ref_div;
        *post_div_p = post_div;
 
-       DRM_DEBUG("%u %d.%d, %d, %d\n", *dot_clock_p, *fb_div_p, *frac_fb_div_p, *ref_div_p, *post_div_p);
+       DRM_DEBUG_KMS("%u %d.%d, %d, %d\n", *dot_clock_p, *fb_div_p, *frac_fb_div_p, *ref_div_p, *post_div_p);
 }
 
 void radeon_compute_pll(struct radeon_pll *pll,
index 6f8a2e5728781acab115c2d014e4763b569354a2..795403b0e2cda8ac392e8faac9cded15746fc500 100644 (file)
@@ -46,7 +46,7 @@
  * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
  * - 2.4.0 - add crtc id query
  * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen
- * - 2.6.0 - add tiling config query (r6xx+)
+ * - 2.6.0 - add tiling config query (r6xx+), add initial HiZ support (r300->r500)
  */
 #define KMS_DRIVER_MAJOR       2
 #define KMS_DRIVER_MINOR       6
index e0b30b264c2809997673f481bddec3a22b9d78a9..5e7a0536c9c90eddcd61bd86e983f5515869e570 100644 (file)
@@ -205,7 +205,7 @@ void radeon_encoder_set_active_device(struct drm_encoder *encoder)
                if (connector->encoder == encoder) {
                        struct radeon_connector *radeon_connector = to_radeon_connector(connector);
                        radeon_encoder->active_device = radeon_encoder->devices & radeon_connector->devices;
-                       DRM_DEBUG("setting active device to %08x from %08x %08x for encoder %d\n",
+                       DRM_DEBUG_KMS("setting active device to %08x from %08x %08x for encoder %d\n",
                                  radeon_encoder->active_device, radeon_encoder->devices,
                                  radeon_connector->devices, encoder->encoder_type);
                }
@@ -1021,7 +1021,7 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode)
 
        memset(&args, 0, sizeof(args));
 
-       DRM_DEBUG("encoder dpms %d to mode %d, devices %08x, active_devices %08x\n",
+       DRM_DEBUG_KMS("encoder dpms %d to mode %d, devices %08x, active_devices %08x\n",
                  radeon_encoder->encoder_id, mode, radeon_encoder->devices,
                  radeon_encoder->active_device);
        switch (radeon_encoder->encoder_id) {
@@ -1484,7 +1484,7 @@ radeon_atom_dac_detect(struct drm_encoder *encoder, struct drm_connector *connec
        uint32_t bios_0_scratch;
 
        if (!atombios_dac_load_detect(encoder, connector)) {
-               DRM_DEBUG("detect returned false \n");
+               DRM_DEBUG_KMS("detect returned false \n");
                return connector_status_unknown;
        }
 
@@ -1493,7 +1493,7 @@ radeon_atom_dac_detect(struct drm_encoder *encoder, struct drm_connector *connec
        else
                bios_0_scratch = RREG32(RADEON_BIOS_0_SCRATCH);
 
-       DRM_DEBUG("Bios 0 scratch %x %08x\n", bios_0_scratch, radeon_encoder->devices);
+       DRM_DEBUG_KMS("Bios 0 scratch %x %08x\n", bios_0_scratch, radeon_encoder->devices);
        if (radeon_connector->devices & ATOM_DEVICE_CRT1_SUPPORT) {
                if (bios_0_scratch & ATOM_S0_CRT1_MASK)
                        return connector_status_connected;
index 8931c8e78101fbaa53343b8aeca47ed9e21b57c3..e5b70542738964f6002f8ce8dc04e9efbe8b4299 100644 (file)
@@ -141,7 +141,7 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                        }
                }
                if (!found) {
-                       DRM_DEBUG("unknown crtc id %d\n", value);
+                       DRM_DEBUG_KMS("unknown crtc id %d\n", value);
                        return -EINVAL;
                }
                break;
@@ -156,12 +156,21 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                else if (rdev->family >= CHIP_R600)
                        value = rdev->config.r600.tile_config;
                else {
-                       DRM_DEBUG("tiling config is r6xx+ only!\n");
+                       DRM_DEBUG_KMS("tiling config is r6xx+ only!\n");
                        return -EINVAL;
                }
+       case RADEON_INFO_WANT_HYPERZ:
+               mutex_lock(&dev->struct_mutex);
+               if (rdev->hyperz_filp)
+                       value = 0;
+               else {
+                       rdev->hyperz_filp = filp;
+                       value = 1;
+               }
+               mutex_unlock(&dev->struct_mutex);
                break;
        default:
-               DRM_DEBUG("Invalid request %d\n", info->request);
+               DRM_DEBUG_KMS("Invalid request %d\n", info->request);
                return -EINVAL;
        }
        if (DRM_COPY_TO_USER(value_ptr, &value, sizeof(uint32_t))) {
@@ -199,9 +208,11 @@ void radeon_driver_postclose_kms(struct drm_device *dev,
 void radeon_driver_preclose_kms(struct drm_device *dev,
                                struct drm_file *file_priv)
 {
+       struct radeon_device *rdev = dev->dev_private;
+       if (rdev->hyperz_filp == file_priv)
+               rdev->hyperz_filp = NULL;
 }
 
-
 /*
  * VBlank related functions.
  */
index e1e5255396acc3a5c9c9e0a5d01d79adfff2e601..989df519a1e453b618e2599f0eeced23e637dc91 100644 (file)
@@ -362,10 +362,10 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
        uint32_t gen_cntl_reg, gen_cntl_val;
        int r;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
        /* no fb bound */
        if (!crtc->fb) {
-               DRM_DEBUG("No FB bound\n");
+               DRM_DEBUG_KMS("No FB bound\n");
                return 0;
        }
 
@@ -528,7 +528,7 @@ static bool radeon_set_crtc_timing(struct drm_crtc *crtc, struct drm_display_mod
        uint32_t crtc_v_sync_strt_wid;
        bool is_tv = false;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
        list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
                if (encoder->crtc == crtc) {
                        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
@@ -757,7 +757,7 @@ static void radeon_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
                }
        }
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        if (!use_bios_divs) {
                radeon_compute_pll(pll, mode->clock,
@@ -772,7 +772,7 @@ static void radeon_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
                if (!post_div->divider)
                        post_div = &post_divs[0];
 
-               DRM_DEBUG("dc=%u, fd=%d, rd=%d, pd=%d\n",
+               DRM_DEBUG_KMS("dc=%u, fd=%d, rd=%d, pd=%d\n",
                          (unsigned)freq,
                          feedback_div,
                          reference_div,
@@ -841,12 +841,12 @@ static void radeon_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
                               | RADEON_P2PLL_SLEEP
                               | RADEON_P2PLL_ATOMIC_UPDATE_EN));
 
-               DRM_DEBUG("Wrote2: 0x%08x 0x%08x 0x%08x (0x%08x)\n",
+               DRM_DEBUG_KMS("Wrote2: 0x%08x 0x%08x 0x%08x (0x%08x)\n",
                          (unsigned)pll_ref_div,
                          (unsigned)pll_fb_post_div,
                          (unsigned)htotal_cntl,
                          RREG32_PLL(RADEON_P2PLL_CNTL));
-               DRM_DEBUG("Wrote2: rd=%u, fd=%u, pd=%u\n",
+               DRM_DEBUG_KMS("Wrote2: rd=%u, fd=%u, pd=%u\n",
                          (unsigned)pll_ref_div & RADEON_P2PLL_REF_DIV_MASK,
                          (unsigned)pll_fb_post_div & RADEON_P2PLL_FB0_DIV_MASK,
                          (unsigned)((pll_fb_post_div &
@@ -947,12 +947,12 @@ static void radeon_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
                               | RADEON_PPLL_ATOMIC_UPDATE_EN
                               | RADEON_PPLL_VGA_ATOMIC_UPDATE_EN));
 
-               DRM_DEBUG("Wrote: 0x%08x 0x%08x 0x%08x (0x%08x)\n",
+               DRM_DEBUG_KMS("Wrote: 0x%08x 0x%08x 0x%08x (0x%08x)\n",
                          pll_ref_div,
                          pll_fb_post_div,
                          (unsigned)htotal_cntl,
                          RREG32_PLL(RADEON_PPLL_CNTL));
-               DRM_DEBUG("Wrote: rd=%d, fd=%d, pd=%d\n",
+               DRM_DEBUG_KMS("Wrote: rd=%d, fd=%d, pd=%d\n",
                          pll_ref_div & RADEON_PPLL_REF_DIV_MASK,
                          pll_fb_post_div & RADEON_PPLL_FB3_DIV_MASK,
                          (pll_fb_post_div & RADEON_PPLL_POST3_DIV_MASK) >> 16);
index 5688a0cf6bbecbea020edd8c96bcc9c70c0b28e5..b8149cbc0c70ca3511f748d13e05cb85c16073e9 100644 (file)
@@ -47,7 +47,7 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode)
        uint32_t lvds_gen_cntl, lvds_pll_cntl, pixclks_cntl, disp_pwr_man;
        int panel_pwr_delay = 2000;
        bool is_mac = false;
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        if (radeon_encoder->enc_priv) {
                if (rdev->is_atom_bios) {
@@ -151,7 +151,7 @@ static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder,
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        uint32_t lvds_pll_cntl, lvds_gen_cntl, lvds_ss_gen_cntl;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        lvds_pll_cntl = RREG32(RADEON_LVDS_PLL_CNTL);
        lvds_pll_cntl &= ~RADEON_LVDS_PLL_EN;
@@ -167,7 +167,7 @@ static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder,
        } else {
                struct radeon_encoder_lvds *lvds = (struct radeon_encoder_lvds *)radeon_encoder->enc_priv;
                if (lvds) {
-                       DRM_DEBUG("bios LVDS_GEN_CNTL: 0x%x\n", lvds->lvds_gen_cntl);
+                       DRM_DEBUG_KMS("bios LVDS_GEN_CNTL: 0x%x\n", lvds->lvds_gen_cntl);
                        lvds_gen_cntl = lvds->lvds_gen_cntl;
                        lvds_ss_gen_cntl &= ~((0xf << RADEON_LVDS_PWRSEQ_DELAY1_SHIFT) |
                                              (0xf << RADEON_LVDS_PWRSEQ_DELAY2_SHIFT));
@@ -250,7 +250,7 @@ static void radeon_legacy_primary_dac_dpms(struct drm_encoder *encoder, int mode
        uint32_t dac_cntl = RREG32(RADEON_DAC_CNTL);
        uint32_t dac_macro_cntl = RREG32(RADEON_DAC_MACRO_CNTL);
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        switch (mode) {
        case DRM_MODE_DPMS_ON:
@@ -315,7 +315,7 @@ static void radeon_legacy_primary_dac_mode_set(struct drm_encoder *encoder,
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        uint32_t disp_output_cntl, dac_cntl, dac2_cntl, dac_macro_cntl;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        if (radeon_crtc->crtc_id == 0) {
                if (rdev->family == CHIP_R200 || ASIC_IS_R300(rdev)) {
@@ -446,7 +446,7 @@ static void radeon_legacy_tmds_int_dpms(struct drm_encoder *encoder, int mode)
        struct drm_device *dev = encoder->dev;
        struct radeon_device *rdev = dev->dev_private;
        uint32_t fp_gen_cntl = RREG32(RADEON_FP_GEN_CNTL);
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        switch (mode) {
        case DRM_MODE_DPMS_ON:
@@ -502,7 +502,7 @@ static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder,
        uint32_t tmp, tmds_pll_cntl, tmds_transmitter_cntl, fp_gen_cntl;
        int i;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        tmp = tmds_pll_cntl = RREG32(RADEON_TMDS_PLL_CNTL);
        tmp &= 0xfffff;
@@ -610,7 +610,7 @@ static void radeon_legacy_tmds_ext_dpms(struct drm_encoder *encoder, int mode)
        struct drm_device *dev = encoder->dev;
        struct radeon_device *rdev = dev->dev_private;
        uint32_t fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL);
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        switch (mode) {
        case DRM_MODE_DPMS_ON:
@@ -666,7 +666,7 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        uint32_t fp2_gen_cntl;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        if (rdev->is_atom_bios) {
                radeon_encoder->pixel_clock = adjusted_mode->clock;
@@ -760,7 +760,7 @@ static void radeon_legacy_tv_dac_dpms(struct drm_encoder *encoder, int mode)
        uint32_t fp2_gen_cntl = 0, crtc2_gen_cntl = 0, tv_dac_cntl = 0;
        uint32_t tv_master_cntl = 0;
        bool is_tv;
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        is_tv = radeon_encoder->active_device & ATOM_DEVICE_TV_SUPPORT ? true : false;
 
@@ -878,7 +878,7 @@ static void radeon_legacy_tv_dac_mode_set(struct drm_encoder *encoder,
        uint32_t disp_hw_debug = 0, fp2_gen_cntl = 0, disp_tv_out_cntl = 0;
        bool is_tv = false;
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG_KMS("\n");
 
        is_tv = radeon_encoder->active_device & ATOM_DEVICE_TV_SUPPORT ? true : false;
 
@@ -1075,10 +1075,10 @@ static bool r300_legacy_tv_detect(struct drm_encoder *encoder,
        tmp = RREG32(RADEON_TV_DAC_CNTL);
        if ((tmp & RADEON_TV_DAC_GDACDET) != 0) {
                found = true;
-               DRM_DEBUG("S-video TV connection detected\n");
+               DRM_DEBUG_KMS("S-video TV connection detected\n");
        } else if ((tmp & RADEON_TV_DAC_BDACDET) != 0) {
                found = true;
-               DRM_DEBUG("Composite TV connection detected\n");
+               DRM_DEBUG_KMS("Composite TV connection detected\n");
        }
 
        WREG32(RADEON_TV_DAC_CNTL, tv_dac_cntl);
@@ -1141,10 +1141,10 @@ static bool radeon_legacy_tv_detect(struct drm_encoder *encoder,
        tmp = RREG32(RADEON_TV_DAC_CNTL);
        if (tmp & RADEON_TV_DAC_GDACDET) {
                found = true;
-               DRM_DEBUG("S-video TV connection detected\n");
+               DRM_DEBUG_KMS("S-video TV connection detected\n");
        } else if ((tmp & RADEON_TV_DAC_BDACDET) != 0) {
                found = true;
-               DRM_DEBUG("Composite TV connection detected\n");
+               DRM_DEBUG_KMS("Composite TV connection detected\n");
        }
 
        WREG32(RADEON_TV_PRE_DAC_MUX_CNTL, tv_pre_dac_mux_cntl);
index 03204039774308bc01eefdd69616f310b50af739..c7b6cb428d096de2f0efdba0082357c9bae569f6 100644 (file)
@@ -496,7 +496,7 @@ static bool radeon_legacy_tv_init_restarts(struct drm_encoder *encoder)
 
        restart -= v_offset + h_offset;
 
-       DRM_DEBUG("compute_restarts: def = %u h = %d v = %d, p1 = %04x, p2 = %04x, restart = %d\n",
+       DRM_DEBUG_KMS("compute_restarts: def = %u h = %d v = %d, p1 = %04x, p2 = %04x, restart = %d\n",
                  const_ptr->def_restart, tv_dac->h_pos, tv_dac->v_pos, p1, p2, restart);
 
        tv_dac->tv.hrestart = restart % h_total;
@@ -505,7 +505,7 @@ static bool radeon_legacy_tv_init_restarts(struct drm_encoder *encoder)
        restart /= v_total;
        tv_dac->tv.frestart = restart % f_total;
 
-       DRM_DEBUG("compute_restart: F/H/V=%u,%u,%u\n",
+       DRM_DEBUG_KMS("compute_restart: F/H/V=%u,%u,%u\n",
                  (unsigned)tv_dac->tv.frestart,
                  (unsigned)tv_dac->tv.vrestart,
                  (unsigned)tv_dac->tv.hrestart);
@@ -523,7 +523,7 @@ static bool radeon_legacy_tv_init_restarts(struct drm_encoder *encoder)
        tv_dac->tv.timing_cntl = (tv_dac->tv.timing_cntl & ~RADEON_H_INC_MASK) |
                ((u32)h_inc << RADEON_H_INC_SHIFT);
 
-       DRM_DEBUG("compute_restart: h_size = %d h_inc = %d\n", tv_dac->h_size, h_inc);
+       DRM_DEBUG_KMS("compute_restart: h_size = %d h_inc = %d\n", tv_dac->h_size, h_inc);
 
        return h_changed;
 }
index 07579ae2ab68499228ae241955b1700de75d5717..95f8b3a3c43d993ee6eac9ea3a713b5aa35d3935 100644 (file)
@@ -62,9 +62,9 @@ static int radeon_acpi_event(struct notifier_block *nb,
 
        if (strcmp(entry->device_class, ACPI_AC_CLASS) == 0) {
                if (power_supply_is_system_supplied() > 0)
-                       DRM_DEBUG("pm: AC\n");
+                       DRM_DEBUG_DRIVER("pm: AC\n");
                else
-                       DRM_DEBUG("pm: DC\n");
+                       DRM_DEBUG_DRIVER("pm: DC\n");
 
                if (rdev->pm.pm_method == PM_METHOD_PROFILE) {
                        if (rdev->pm.profile == PM_PROFILE_AUTO) {
@@ -198,7 +198,7 @@ static void radeon_set_power_state(struct radeon_device *rdev)
                        radeon_set_engine_clock(rdev, sclk);
                        radeon_pm_debug_check_in_vbl(rdev, true);
                        rdev->pm.current_sclk = sclk;
-                       DRM_DEBUG("Setting: e: %d\n", sclk);
+                       DRM_DEBUG_DRIVER("Setting: e: %d\n", sclk);
                }
 
                /* set memory clock */
@@ -207,7 +207,7 @@ static void radeon_set_power_state(struct radeon_device *rdev)
                        radeon_set_memory_clock(rdev, mclk);
                        radeon_pm_debug_check_in_vbl(rdev, true);
                        rdev->pm.current_mclk = mclk;
-                       DRM_DEBUG("Setting: m: %d\n", mclk);
+                       DRM_DEBUG_DRIVER("Setting: m: %d\n", mclk);
                }
 
                if (misc_after)
@@ -219,7 +219,7 @@ static void radeon_set_power_state(struct radeon_device *rdev)
                rdev->pm.current_power_state_index = rdev->pm.requested_power_state_index;
                rdev->pm.current_clock_mode_index = rdev->pm.requested_clock_mode_index;
        } else
-               DRM_DEBUG("pm: GUI not idle!!!\n");
+               DRM_DEBUG_DRIVER("pm: GUI not idle!!!\n");
 }
 
 static void radeon_pm_set_clocks(struct radeon_device *rdev)
@@ -294,27 +294,27 @@ static void radeon_pm_print_states(struct radeon_device *rdev)
        struct radeon_power_state *power_state;
        struct radeon_pm_clock_info *clock_info;
 
-       DRM_DEBUG("%d Power State(s)\n", rdev->pm.num_power_states);
+       DRM_DEBUG_DRIVER("%d Power State(s)\n", rdev->pm.num_power_states);
        for (i = 0; i < rdev->pm.num_power_states; i++) {
                power_state = &rdev->pm.power_state[i];
-               DRM_DEBUG("State %d: %s\n", i,
+               DRM_DEBUG_DRIVER("State %d: %s\n", i,
                        radeon_pm_state_type_name[power_state->type]);
                if (i == rdev->pm.default_power_state_index)
-                       DRM_DEBUG("\tDefault");
+                       DRM_DEBUG_DRIVER("\tDefault");
                if ((rdev->flags & RADEON_IS_PCIE) && !(rdev->flags & RADEON_IS_IGP))
-                       DRM_DEBUG("\t%d PCIE Lanes\n", power_state->pcie_lanes);
+                       DRM_DEBUG_DRIVER("\t%d PCIE Lanes\n", power_state->pcie_lanes);
                if (power_state->flags & RADEON_PM_STATE_SINGLE_DISPLAY_ONLY)
-                       DRM_DEBUG("\tSingle display only\n");
-               DRM_DEBUG("\t%d Clock Mode(s)\n", power_state->num_clock_modes);
+                       DRM_DEBUG_DRIVER("\tSingle display only\n");
+               DRM_DEBUG_DRIVER("\t%d Clock Mode(s)\n", power_state->num_clock_modes);
                for (j = 0; j < power_state->num_clock_modes; j++) {
                        clock_info = &(power_state->clock_info[j]);
                        if (rdev->flags & RADEON_IS_IGP)
-                               DRM_DEBUG("\t\t%d e: %d%s\n",
+                               DRM_DEBUG_DRIVER("\t\t%d e: %d%s\n",
                                        j,
                                        clock_info->sclk * 10,
                                        clock_info->flags & RADEON_PM_MODE_NO_DISPLAY ? "\tNo display only" : "");
                        else
-                               DRM_DEBUG("\t\t%d e: %d\tm: %d\tv: %d%s\n",
+                               DRM_DEBUG_DRIVER("\t\t%d e: %d\tm: %d\tv: %d%s\n",
                                        j,
                                        clock_info->sclk * 10,
                                        clock_info->mclk * 10,
@@ -658,7 +658,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev)
                                        radeon_pm_get_dynpm_state(rdev);
                                        radeon_pm_set_clocks(rdev);
 
-                                       DRM_DEBUG("radeon: dynamic power management deactivated\n");
+                                       DRM_DEBUG_DRIVER("radeon: dynamic power management deactivated\n");
                                }
                        } else if (rdev->pm.active_crtc_count == 1) {
                                /* TODO: Increase clocks if needed for current mode */
@@ -675,7 +675,7 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev)
                                        rdev->pm.dynpm_state = DYNPM_STATE_ACTIVE;
                                        queue_delayed_work(rdev->wq, &rdev->pm.dynpm_idle_work,
                                                           msecs_to_jiffies(RADEON_IDLE_LOOP_MS));
-                                       DRM_DEBUG("radeon: dynamic power management activated\n");
+                                       DRM_DEBUG_DRIVER("radeon: dynamic power management activated\n");
                                }
                        } else { /* count == 0 */
                                if (rdev->pm.dynpm_state != DYNPM_STATE_MINIMUM) {
@@ -771,7 +771,7 @@ static bool radeon_pm_debug_check_in_vbl(struct radeon_device *rdev, bool finish
        bool in_vbl = radeon_pm_in_vbl(rdev);
 
        if (in_vbl == false)
-               DRM_DEBUG("not in vbl for pm change %08x at %s\n", stat_crtc,
+               DRM_DEBUG_DRIVER("not in vbl for pm change %08x at %s\n", stat_crtc,
                         finish ? "exit" : "entry");
        return in_vbl;
 }
index e9918d88f5b049675cfebe754d15ef83338bb91d..84c53e41a88fd783d6f7ba32c9155109eb3c95be 100644 (file)
@@ -59,28 +59,28 @@ static struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev)
 /*
  * Global memory.
  */
-static int radeon_ttm_mem_global_init(struct ttm_global_reference *ref)
+static int radeon_ttm_mem_global_init(struct drm_global_reference *ref)
 {
        return ttm_mem_global_init(ref->object);
 }
 
-static void radeon_ttm_mem_global_release(struct ttm_global_reference *ref)
+static void radeon_ttm_mem_global_release(struct drm_global_reference *ref)
 {
        ttm_mem_global_release(ref->object);
 }
 
 static int radeon_ttm_global_init(struct radeon_device *rdev)
 {
-       struct ttm_global_reference *global_ref;
+       struct drm_global_reference *global_ref;
        int r;
 
        rdev->mman.mem_global_referenced = false;
        global_ref = &rdev->mman.mem_global_ref;
-       global_ref->global_type = TTM_GLOBAL_TTM_MEM;
+       global_ref->global_type = DRM_GLOBAL_TTM_MEM;
        global_ref->size = sizeof(struct ttm_mem_global);
        global_ref->init = &radeon_ttm_mem_global_init;
        global_ref->release = &radeon_ttm_mem_global_release;
-       r = ttm_global_item_ref(global_ref);
+       r = drm_global_item_ref(global_ref);
        if (r != 0) {
                DRM_ERROR("Failed setting up TTM memory accounting "
                          "subsystem.\n");
@@ -90,14 +90,14 @@ static int radeon_ttm_global_init(struct radeon_device *rdev)
        rdev->mman.bo_global_ref.mem_glob =
                rdev->mman.mem_global_ref.object;
        global_ref = &rdev->mman.bo_global_ref.ref;
-       global_ref->global_type = TTM_GLOBAL_TTM_BO;
+       global_ref->global_type = DRM_GLOBAL_TTM_BO;
        global_ref->size = sizeof(struct ttm_bo_global);
        global_ref->init = &ttm_bo_global_init;
        global_ref->release = &ttm_bo_global_release;
-       r = ttm_global_item_ref(global_ref);
+       r = drm_global_item_ref(global_ref);
        if (r != 0) {
                DRM_ERROR("Failed setting up TTM BO subsystem.\n");
-               ttm_global_item_unref(&rdev->mman.mem_global_ref);
+               drm_global_item_unref(&rdev->mman.mem_global_ref);
                return r;
        }
 
@@ -108,8 +108,8 @@ static int radeon_ttm_global_init(struct radeon_device *rdev)
 static void radeon_ttm_global_fini(struct radeon_device *rdev)
 {
        if (rdev->mman.mem_global_referenced) {
-               ttm_global_item_unref(&rdev->mman.bo_global_ref.ref);
-               ttm_global_item_unref(&rdev->mman.mem_global_ref);
+               drm_global_item_unref(&rdev->mman.bo_global_ref.ref);
+               drm_global_item_unref(&rdev->mman.mem_global_ref);
                rdev->mman.mem_global_referenced = false;
        }
 }
index 1e97b2d129fd90240056630cf60357ece84a7561..b506ec1cab4b330e298bb884f0645ca06a0d6244 100644 (file)
@@ -187,7 +187,6 @@ r300 0x4f60
 0x4364 RS_INST_13
 0x4368 RS_INST_14
 0x436C RS_INST_15
-0x43A4 SC_HYPERZ_EN
 0x43A8 SC_EDGERULE
 0x43B0 SC_CLIP_0_A
 0x43B4 SC_CLIP_0_B
@@ -716,16 +715,4 @@ r300 0x4f60
 0x4F08 ZB_STENCILREFMASK
 0x4F14 ZB_ZTOP
 0x4F18 ZB_ZCACHE_CTLSTAT
-0x4F1C ZB_BW_CNTL
-0x4F28 ZB_DEPTHCLEARVALUE
-0x4F30 ZB_ZMASK_OFFSET
-0x4F34 ZB_ZMASK_PITCH
-0x4F38 ZB_ZMASK_WRINDEX
-0x4F3C ZB_ZMASK_DWORD
-0x4F40 ZB_ZMASK_RDINDEX
-0x4F44 ZB_HIZ_OFFSET
-0x4F48 ZB_HIZ_WRINDEX
-0x4F4C ZB_HIZ_DWORD
-0x4F50 ZB_HIZ_RDINDEX
-0x4F54 ZB_HIZ_PITCH
 0x4F58 ZB_ZPASS_DATA
index e958980d00f19d15b113bd8b95d186add903b246..8c1214c2390fdcc1d93682cb96af3208c1957134 100644 (file)
@@ -130,6 +130,7 @@ r420 0x4f60
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
+0x4028 GB_Z_PEQ_CONFIG
 0x4100 TX_INVALTAGS
 0x4200 GA_POINT_S0
 0x4204 GA_POINT_T0
@@ -187,7 +188,6 @@ r420 0x4f60
 0x4364 RS_INST_13
 0x4368 RS_INST_14
 0x436C RS_INST_15
-0x43A4 SC_HYPERZ_EN
 0x43A8 SC_EDGERULE
 0x43B0 SC_CLIP_0_A
 0x43B4 SC_CLIP_0_B
@@ -782,16 +782,4 @@ r420 0x4f60
 0x4F08 ZB_STENCILREFMASK
 0x4F14 ZB_ZTOP
 0x4F18 ZB_ZCACHE_CTLSTAT
-0x4F1C ZB_BW_CNTL
-0x4F28 ZB_DEPTHCLEARVALUE
-0x4F30 ZB_ZMASK_OFFSET
-0x4F34 ZB_ZMASK_PITCH
-0x4F38 ZB_ZMASK_WRINDEX
-0x4F3C ZB_ZMASK_DWORD
-0x4F40 ZB_ZMASK_RDINDEX
-0x4F44 ZB_HIZ_OFFSET
-0x4F48 ZB_HIZ_WRINDEX
-0x4F4C ZB_HIZ_DWORD
-0x4F50 ZB_HIZ_RDINDEX
-0x4F54 ZB_HIZ_PITCH
 0x4F58 ZB_ZPASS_DATA
index 83e8bc0c2bb249d9fa11e90bea35b6716bcca236..0828d80396f29f9a994b51a1ec6526a1f9afff3f 100644 (file)
@@ -187,7 +187,6 @@ rs600 0x6d40
 0x4364 RS_INST_13
 0x4368 RS_INST_14
 0x436C RS_INST_15
-0x43A4 SC_HYPERZ_EN
 0x43A8 SC_EDGERULE
 0x43B0 SC_CLIP_0_A
 0x43B4 SC_CLIP_0_B
@@ -782,16 +781,4 @@ rs600 0x6d40
 0x4F08 ZB_STENCILREFMASK
 0x4F14 ZB_ZTOP
 0x4F18 ZB_ZCACHE_CTLSTAT
-0x4F1C ZB_BW_CNTL
-0x4F28 ZB_DEPTHCLEARVALUE
-0x4F30 ZB_ZMASK_OFFSET
-0x4F34 ZB_ZMASK_PITCH
-0x4F38 ZB_ZMASK_WRINDEX
-0x4F3C ZB_ZMASK_DWORD
-0x4F40 ZB_ZMASK_RDINDEX
-0x4F44 ZB_HIZ_OFFSET
-0x4F48 ZB_HIZ_WRINDEX
-0x4F4C ZB_HIZ_DWORD
-0x4F50 ZB_HIZ_RDINDEX
-0x4F54 ZB_HIZ_PITCH
 0x4F58 ZB_ZPASS_DATA
index 1e46233985eb265106d5011d92402375632ea3f1..8293855f5f0d7d9aa1b24c4fb8c9660d5b9f7528 100644 (file)
@@ -235,7 +235,6 @@ rv515 0x6d40
 0x4354 RS_INST_13
 0x4358 RS_INST_14
 0x435C RS_INST_15
-0x43A4 SC_HYPERZ_EN
 0x43A8 SC_EDGERULE
 0x43B0 SC_CLIP_0_A
 0x43B4 SC_CLIP_0_B
@@ -479,17 +478,5 @@ rv515 0x6d40
 0x4F08 ZB_STENCILREFMASK
 0x4F14 ZB_ZTOP
 0x4F18 ZB_ZCACHE_CTLSTAT
-0x4F1C ZB_BW_CNTL
-0x4F28 ZB_DEPTHCLEARVALUE
-0x4F30 ZB_ZMASK_OFFSET
-0x4F34 ZB_ZMASK_PITCH
-0x4F38 ZB_ZMASK_WRINDEX
-0x4F3C ZB_ZMASK_DWORD
-0x4F40 ZB_ZMASK_RDINDEX
-0x4F44 ZB_HIZ_OFFSET
-0x4F48 ZB_HIZ_WRINDEX
-0x4F4C ZB_HIZ_DWORD
-0x4F50 ZB_HIZ_RDINDEX
-0x4F54 ZB_HIZ_PITCH
 0x4F58 ZB_ZPASS_DATA
 0x4FD4 ZB_STENCILREFMASK_BF
index 85cd911952c1715eb0165393bb842ed142bb51dd..cc05b230d7effbbae88524da0d698dace6228ccf 100644 (file)
@@ -696,7 +696,6 @@ void rs600_mc_init(struct radeon_device *rdev)
        rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
        base = RREG32_MC(R_000004_MC_FB_LOCATION);
        base = G_000004_MC_FB_START(base) << 16;
-       rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
        radeon_vram_location(rdev, &rdev->mc, base);
        rdev->mc.gtt_base_align = 0;
        radeon_gtt_location(rdev, &rdev->mc);
index f3a8c9344c64b27600bed94bbe9c81a7bfc9f6f7..3e3f75718be3e83ab156465dc80a11f604b58a64 100644 (file)
@@ -159,8 +159,8 @@ void rs690_mc_init(struct radeon_device *rdev)
        rdev->mc.visible_vram_size = rdev->mc.aper_size;
        base = RREG32_MC(R_000100_MCCFG_FB_LOCATION);
        base = G_000100_MC_FB_START(base) << 16;
-       rs690_pm_info(rdev);
        rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
+       rs690_pm_info(rdev);
        radeon_vram_location(rdev, &rdev->mc, base);
        rdev->mc.gtt_base_align = rdev->mc.gtt_size - 1;
        radeon_gtt_location(rdev, &rdev->mc);
@@ -398,7 +398,9 @@ void rs690_bandwidth_update(struct radeon_device *rdev)
        struct drm_display_mode *mode1 = NULL;
        struct rs690_watermark wm0;
        struct rs690_watermark wm1;
-       u32 tmp, d1mode_priority_a_cnt, d2mode_priority_a_cnt;
+       u32 tmp;
+       u32 d1mode_priority_a_cnt = S_006548_D1MODE_PRIORITY_A_OFF(1);
+       u32 d2mode_priority_a_cnt = S_006548_D1MODE_PRIORITY_A_OFF(1);
        fixed20_12 priority_mark02, priority_mark12, fill_rate;
        fixed20_12 a, b;
 
@@ -495,10 +497,6 @@ void rs690_bandwidth_update(struct radeon_device *rdev)
                        d1mode_priority_a_cnt |= S_006548_D1MODE_PRIORITY_A_ALWAYS_ON(1);
                        d2mode_priority_a_cnt |= S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON(1);
                }
-               WREG32(R_006548_D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
-               WREG32(R_00654C_D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
-               WREG32(R_006D48_D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt);
-               WREG32(R_006D4C_D2MODE_PRIORITY_B_CNT, d2mode_priority_a_cnt);
        } else if (mode0) {
                if (dfixed_trunc(wm0.dbpp) > 64)
                        a.full = dfixed_mul(wm0.dbpp, wm0.num_line_pair);
@@ -528,13 +526,7 @@ void rs690_bandwidth_update(struct radeon_device *rdev)
                d1mode_priority_a_cnt = dfixed_trunc(priority_mark02);
                if (rdev->disp_priority == 2)
                        d1mode_priority_a_cnt |= S_006548_D1MODE_PRIORITY_A_ALWAYS_ON(1);
-               WREG32(R_006548_D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
-               WREG32(R_00654C_D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
-               WREG32(R_006D48_D2MODE_PRIORITY_A_CNT,
-                       S_006D48_D2MODE_PRIORITY_A_OFF(1));
-               WREG32(R_006D4C_D2MODE_PRIORITY_B_CNT,
-                       S_006D4C_D2MODE_PRIORITY_B_OFF(1));
-       } else {
+       } else if (mode1) {
                if (dfixed_trunc(wm1.dbpp) > 64)
                        a.full = dfixed_mul(wm1.dbpp, wm1.num_line_pair);
                else
@@ -563,13 +555,12 @@ void rs690_bandwidth_update(struct radeon_device *rdev)
                d2mode_priority_a_cnt = dfixed_trunc(priority_mark12);
                if (rdev->disp_priority == 2)
                        d2mode_priority_a_cnt |= S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON(1);
-               WREG32(R_006548_D1MODE_PRIORITY_A_CNT,
-                       S_006548_D1MODE_PRIORITY_A_OFF(1));
-               WREG32(R_00654C_D1MODE_PRIORITY_B_CNT,
-                       S_00654C_D1MODE_PRIORITY_B_OFF(1));
-               WREG32(R_006D48_D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt);
-               WREG32(R_006D4C_D2MODE_PRIORITY_B_CNT, d2mode_priority_a_cnt);
        }
+
+       WREG32(R_006548_D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
+       WREG32(R_00654C_D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
+       WREG32(R_006D48_D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt);
+       WREG32(R_006D4C_D2MODE_PRIORITY_B_CNT, d2mode_priority_a_cnt);
 }
 
 uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg)
index b951b8790175eb5c82e76f21cbfb8a8e44411c6c..4d6e86041a9fde07f8caa56c4f90ba75c05a9f9e 100644 (file)
@@ -927,7 +927,9 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
        struct drm_display_mode *mode1 = NULL;
        struct rv515_watermark wm0;
        struct rv515_watermark wm1;
-       u32 tmp, d1mode_priority_a_cnt, d2mode_priority_a_cnt;
+       u32 tmp;
+       u32 d1mode_priority_a_cnt = MODE_PRIORITY_OFF;
+       u32 d2mode_priority_a_cnt = MODE_PRIORITY_OFF;
        fixed20_12 priority_mark02, priority_mark12, fill_rate;
        fixed20_12 a, b;
 
@@ -1001,10 +1003,6 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
                        d1mode_priority_a_cnt |= MODE_PRIORITY_ALWAYS_ON;
                        d2mode_priority_a_cnt |= MODE_PRIORITY_ALWAYS_ON;
                }
-               WREG32(D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
-               WREG32(D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
-               WREG32(D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt);
-               WREG32(D2MODE_PRIORITY_B_CNT, d2mode_priority_a_cnt);
        } else if (mode0) {
                if (dfixed_trunc(wm0.dbpp) > 64)
                        a.full = dfixed_div(wm0.dbpp, wm0.num_line_pair);
@@ -1034,11 +1032,7 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
                d1mode_priority_a_cnt = dfixed_trunc(priority_mark02);
                if (rdev->disp_priority == 2)
                        d1mode_priority_a_cnt |= MODE_PRIORITY_ALWAYS_ON;
-               WREG32(D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
-               WREG32(D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
-               WREG32(D2MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
-               WREG32(D2MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
-       } else {
+       } else if (mode1) {
                if (dfixed_trunc(wm1.dbpp) > 64)
                        a.full = dfixed_div(wm1.dbpp, wm1.num_line_pair);
                else
@@ -1067,11 +1061,12 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
                d2mode_priority_a_cnt = dfixed_trunc(priority_mark12);
                if (rdev->disp_priority == 2)
                        d2mode_priority_a_cnt |= MODE_PRIORITY_ALWAYS_ON;
-               WREG32(D1MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
-               WREG32(D1MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
-               WREG32(D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt);
-               WREG32(D2MODE_PRIORITY_B_CNT, d2mode_priority_a_cnt);
        }
+
+       WREG32(D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
+       WREG32(D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
+       WREG32(D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt);
+       WREG32(D2MODE_PRIORITY_B_CNT, d2mode_priority_a_cnt);
 }
 
 void rv515_bandwidth_update(struct radeon_device *rdev)
index 4256e200647614b339f5d3110ff54732b29fa809..b256d4adfafe76710cf1dd6e3b03371e03f7fd46 100644 (file)
@@ -3,7 +3,7 @@
 
 ccflags-y := -Iinclude/drm
 ttm-y := ttm_agp_backend.o ttm_memory.o ttm_tt.o ttm_bo.o \
-       ttm_bo_util.o ttm_bo_vm.o ttm_module.o ttm_global.o \
+       ttm_bo_util.o ttm_bo_vm.o ttm_module.o \
        ttm_object.o ttm_lock.o ttm_execbuf_util.o ttm_page_alloc.o
 
 obj-$(CONFIG_DRM_TTM) += ttm.o
index 9763288c6b2d300f355f2bba367a405a7bd859f1..cb4cf7ef4d1eee9bc726c4d4ee34f8962526b316 100644 (file)
@@ -1395,7 +1395,7 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj)
        kfree(glob);
 }
 
-void ttm_bo_global_release(struct ttm_global_reference *ref)
+void ttm_bo_global_release(struct drm_global_reference *ref)
 {
        struct ttm_bo_global *glob = ref->object;
 
@@ -1404,7 +1404,7 @@ void ttm_bo_global_release(struct ttm_global_reference *ref)
 }
 EXPORT_SYMBOL(ttm_bo_global_release);
 
-int ttm_bo_global_init(struct ttm_global_reference *ref)
+int ttm_bo_global_init(struct drm_global_reference *ref)
 {
        struct ttm_bo_global_ref *bo_ref =
                container_of(ref, struct ttm_bo_global_ref, ref);
index 9a6edbfeaa9e49c7369623dbb542eb61204fe904..902d7cf9fb4eb5a59cc4bdb13518449344208a22 100644 (file)
@@ -70,8 +70,6 @@ static int __init ttm_init(void)
        if (unlikely(ret != 0))
                return ret;
 
-       ttm_global_init();
-
        atomic_set(&device_released, 0);
        ret = drm_class_device_register(&ttm_drm_class_device);
        if (unlikely(ret != 0))
@@ -81,7 +79,6 @@ static int __init ttm_init(void)
 out_no_dev_reg:
        atomic_set(&device_released, 1);
        wake_up_all(&exit_q);
-       ttm_global_release();
        return ret;
 }
 
@@ -95,7 +92,6 @@ static void __exit ttm_exit(void)
         */
 
        wait_event(exit_q, atomic_read(&device_released) == 1);
-       ttm_global_release();
 }
 
 module_init(ttm_init);
index eaad520953393f5f5da3601627e0ec141c4c4a1f..429f917b60bf4b30ecdfd0946f9f1f0978bd5c58 100644 (file)
@@ -164,7 +164,7 @@ struct vmw_vga_topology_state {
 struct vmw_private {
        struct ttm_bo_device bdev;
        struct ttm_bo_global_ref bo_global_ref;
-       struct ttm_global_reference mem_global_ref;
+       struct drm_global_reference mem_global_ref;
 
        struct vmw_fifo_state fifo;
 
index e3df4adfb4d8ce4b89a0902bb6c24d9db2bc45a3..83123287c60c2d3f245fa3ab0a9696db2f694ede 100644 (file)
@@ -44,29 +44,29 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma)
        return ttm_bo_mmap(filp, vma, &dev_priv->bdev);
 }
 
-static int vmw_ttm_mem_global_init(struct ttm_global_reference *ref)
+static int vmw_ttm_mem_global_init(struct drm_global_reference *ref)
 {
        DRM_INFO("global init.\n");
        return ttm_mem_global_init(ref->object);
 }
 
-static void vmw_ttm_mem_global_release(struct ttm_global_reference *ref)
+static void vmw_ttm_mem_global_release(struct drm_global_reference *ref)
 {
        ttm_mem_global_release(ref->object);
 }
 
 int vmw_ttm_global_init(struct vmw_private *dev_priv)
 {
-       struct ttm_global_reference *global_ref;
+       struct drm_global_reference *global_ref;
        int ret;
 
        global_ref = &dev_priv->mem_global_ref;
-       global_ref->global_type = TTM_GLOBAL_TTM_MEM;
+       global_ref->global_type = DRM_GLOBAL_TTM_MEM;
        global_ref->size = sizeof(struct ttm_mem_global);
        global_ref->init = &vmw_ttm_mem_global_init;
        global_ref->release = &vmw_ttm_mem_global_release;
 
-       ret = ttm_global_item_ref(global_ref);
+       ret = drm_global_item_ref(global_ref);
        if (unlikely(ret != 0)) {
                DRM_ERROR("Failed setting up TTM memory accounting.\n");
                return ret;
@@ -75,11 +75,11 @@ int vmw_ttm_global_init(struct vmw_private *dev_priv)
        dev_priv->bo_global_ref.mem_glob =
                dev_priv->mem_global_ref.object;
        global_ref = &dev_priv->bo_global_ref.ref;
-       global_ref->global_type = TTM_GLOBAL_TTM_BO;
+       global_ref->global_type = DRM_GLOBAL_TTM_BO;
        global_ref->size = sizeof(struct ttm_bo_global);
        global_ref->init = &ttm_bo_global_init;
        global_ref->release = &ttm_bo_global_release;
-               ret = ttm_global_item_ref(global_ref);
+       ret = drm_global_item_ref(global_ref);
 
        if (unlikely(ret != 0)) {
                DRM_ERROR("Failed setting up TTM buffer objects.\n");
@@ -88,12 +88,12 @@ int vmw_ttm_global_init(struct vmw_private *dev_priv)
 
        return 0;
 out_no_bo:
-       ttm_global_item_unref(&dev_priv->mem_global_ref);
+       drm_global_item_unref(&dev_priv->mem_global_ref);
        return ret;
 }
 
 void vmw_ttm_global_release(struct vmw_private *dev_priv)
 {
-       ttm_global_item_unref(&dev_priv->bo_global_ref.ref);
-       ttm_global_item_unref(&dev_priv->mem_global_ref);
+       drm_global_item_unref(&dev_priv->bo_global_ref.ref);
+       drm_global_item_unref(&dev_priv->mem_global_ref);
 }
index e3f46e0cb7dc305f8ab0b9ea7af3f96deb3bba0d..e5f70617dec55db8b8671c5d6c4444a23a698837 100644 (file)
@@ -663,6 +663,8 @@ struct drm_gem_open {
 #define DRM_IOCTL_UNLOCK               DRM_IOW( 0x2b, struct drm_lock)
 #define DRM_IOCTL_FINISH               DRM_IOW( 0x2c, struct drm_lock)
 
+#define DRM_IOCTL_GEM_PRIME_OPEN        DRM_IOWR(0x2e, struct drm_gem_open)
+
 #define DRM_IOCTL_AGP_ACQUIRE          DRM_IO(  0x30)
 #define DRM_IOCTL_AGP_RELEASE          DRM_IO(  0x31)
 #define DRM_IOCTL_AGP_ENABLE           DRM_IOW( 0x32, struct drm_agp_mode)
index 04b564bfc4a1f0084a9c6cd60e52af03ba930764..53017ba0ab7b646e8185a83db0dc42f4d76938ec 100644 (file)
@@ -1453,6 +1453,8 @@ void drm_gem_vm_open(struct vm_area_struct *vma);
 void drm_gem_vm_close(struct vm_area_struct *vma);
 int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
 
+#include "drm_global.h"
+
 static inline void
 drm_gem_object_reference(struct drm_gem_object *obj)
 {
diff --git a/include/drm/drm_global.h b/include/drm/drm_global.h
new file mode 100644 (file)
index 0000000..a06805e
--- /dev/null
@@ -0,0 +1,53 @@
+/**************************************************************************
+ *
+ * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
+ */
+
+#ifndef _DRM_GLOBAL_H_
+#define _DRM_GLOBAL_H_
+enum drm_global_types {
+       DRM_GLOBAL_TTM_MEM = 0,
+       DRM_GLOBAL_TTM_BO,
+       DRM_GLOBAL_TTM_OBJECT,
+       DRM_GLOBAL_NUM
+};
+
+struct drm_global_reference {
+       enum drm_global_types global_type;
+       size_t size;
+       void *object;
+       int (*init) (struct drm_global_reference *);
+       void (*release) (struct drm_global_reference *);
+};
+
+extern void drm_global_init(void);
+extern void drm_global_release(void);
+extern int drm_global_item_ref(struct drm_global_reference *ref);
+extern void drm_global_item_unref(struct drm_global_reference *ref);
+
+#endif
index ac5f0403d53722ea5cbf2118a486f76d371ee054..0acaf8f9143751791f54b3a2da0be0c40653ad19 100644 (file)
@@ -905,6 +905,7 @@ struct drm_radeon_cs {
 #define RADEON_INFO_CRTC_FROM_ID       0x04
 #define RADEON_INFO_ACCEL_WORKING2     0x05
 #define RADEON_INFO_TILING_CONFIG      0x06
+#define RADEON_INFO_WANT_HYPERZ                0x07
 
 struct drm_radeon_info {
        uint32_t                request;
index 0ea602da43e7787bced23b98527ba257c695c888..b87504235f183f45c01d527ae585cbbafbd197ab 100644 (file)
@@ -34,6 +34,7 @@
 #include "ttm/ttm_memory.h"
 #include "ttm/ttm_module.h"
 #include "drm_mm.h"
+#include "drm_global.h"
 #include "linux/workqueue.h"
 #include "linux/fs.h"
 #include "linux/spinlock.h"
@@ -362,7 +363,7 @@ struct ttm_bo_driver {
  */
 
 struct ttm_bo_global_ref {
-       struct ttm_global_reference ref;
+       struct drm_global_reference ref;
        struct ttm_mem_global *mem_glob;
 };
 
@@ -687,8 +688,8 @@ extern int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
 extern void ttm_mem_io_free(struct ttm_bo_device *bdev,
                                struct ttm_mem_reg *mem);
 
-extern void ttm_bo_global_release(struct ttm_global_reference *ref);
-extern int ttm_bo_global_init(struct ttm_global_reference *ref);
+extern void ttm_bo_global_release(struct drm_global_reference *ref);
+extern int ttm_bo_global_init(struct drm_global_reference *ref);
 
 extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
 
index cf416aee19affcfaaa519e111e9f6d3b4e1f30d6..45fa318c158525b8ea9b30809ba20e0f99b4071d 100644 (file)
 struct kobject;
 
 #define TTM_PFX "[TTM] "
-
-enum ttm_global_types {
-       TTM_GLOBAL_TTM_MEM = 0,
-       TTM_GLOBAL_TTM_BO,
-       TTM_GLOBAL_TTM_OBJECT,
-       TTM_GLOBAL_NUM
-};
-
-struct ttm_global_reference {
-       enum ttm_global_types global_type;
-       size_t size;
-       void *object;
-       int (*init) (struct ttm_global_reference *);
-       void (*release) (struct ttm_global_reference *);
-};
-
-extern void ttm_global_init(void);
-extern void ttm_global_release(void);
-extern int ttm_global_item_ref(struct ttm_global_reference *ref);
-extern void ttm_global_item_unref(struct ttm_global_reference *ref);
 extern struct kobject *ttm_get_kobj(void);
 
 #endif /* _TTM_MODULE_H_ */