aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2014-02-27 17:50:06 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-07 05:07:21 -0400
commit22c5aee39906e19d51b6db9cfbfce1b9f6ecb65a (patch)
tree8e9ddd685ac1948c4495b454b04712e3511db282
parent843db716a9c3d3089a3a1f1b9b7af9a33943ab85 (diff)
drm/i915: Fix drain latency precision multipler for VLV
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h50
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c12
2 files changed, 31 insertions, 31 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index fe5c27630e95..e4d7607da2c4 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3863,47 +3863,47 @@ enum punit_power_well {
3863 3863
3864/* drain latency register values*/ 3864/* drain latency register values*/
3865#define DRAIN_LATENCY_PRECISION_32 32 3865#define DRAIN_LATENCY_PRECISION_32 32
3866#define DRAIN_LATENCY_PRECISION_16 16 3866#define DRAIN_LATENCY_PRECISION_64 64
3867#define VLV_DDL1 (VLV_DISPLAY_BASE + 0x70050) 3867#define VLV_DDL1 (VLV_DISPLAY_BASE + 0x70050)
3868#define DDL_CURSORA_PRECISION_32 (1<<31) 3868#define DDL_CURSORA_PRECISION_64 (1<<31)
3869#define DDL_CURSORA_PRECISION_16 (0<<31) 3869#define DDL_CURSORA_PRECISION_32 (0<<31)
3870#define DDL_CURSORA_SHIFT 24 3870#define DDL_CURSORA_SHIFT 24
3871#define DDL_SPRITEB_PRECISION_32 (1<<23) 3871#define DDL_SPRITEB_PRECISION_64 (1<<23)
3872#define DDL_SPRITEB_PRECISION_16 (0<<23) 3872#define DDL_SPRITEB_PRECISION_32 (0<<23)
3873#define DDL_SPRITEB_SHIFT 16 3873#define DDL_SPRITEB_SHIFT 16
3874#define DDL_SPRITEA_PRECISION_32 (1<<15) 3874#define DDL_SPRITEA_PRECISION_64 (1<<15)
3875#define DDL_SPRITEA_PRECISION_16 (0<<15) 3875#define DDL_SPRITEA_PRECISION_32 (0<<15)
3876#define DDL_SPRITEA_SHIFT 8 3876#define DDL_SPRITEA_SHIFT 8
3877#define DDL_PLANEA_PRECISION_32 (1<<7) 3877#define DDL_PLANEA_PRECISION_64 (1<<7)
3878#define DDL_PLANEA_PRECISION_16 (0<<7) 3878#define DDL_PLANEA_PRECISION_32 (0<<7)
3879#define DDL_PLANEA_SHIFT 0 3879#define DDL_PLANEA_SHIFT 0
3880 3880
3881#define VLV_DDL2 (VLV_DISPLAY_BASE + 0x70054) 3881#define VLV_DDL2 (VLV_DISPLAY_BASE + 0x70054)
3882#define DDL_CURSORB_PRECISION_32 (1<<31) 3882#define DDL_CURSORB_PRECISION_64 (1<<31)
3883#define DDL_CURSORB_PRECISION_16 (0<<31) 3883#define DDL_CURSORB_PRECISION_32 (0<<31)
3884#define DDL_CURSORB_SHIFT 24 3884#define DDL_CURSORB_SHIFT 24
3885#define DDL_SPRITED_PRECISION_32 (1<<23) 3885#define DDL_SPRITED_PRECISION_64 (1<<23)
3886#define DDL_SPRITED_PRECISION_16 (0<<23) 3886#define DDL_SPRITED_PRECISION_32 (0<<23)
3887#define DDL_SPRITED_SHIFT 16 3887#define DDL_SPRITED_SHIFT 16
3888#define DDL_SPRITEC_PRECISION_32 (1<<15) 3888#define DDL_SPRITEC_PRECISION_64 (1<<15)
3889#define DDL_SPRITEC_PRECISION_16 (0<<15) 3889#define DDL_SPRITEC_PRECISION_32 (0<<15)
3890#define DDL_SPRITEC_SHIFT 8 3890#define DDL_SPRITEC_SHIFT 8
3891#define DDL_PLANEB_PRECISION_32 (1<<7) 3891#define DDL_PLANEB_PRECISION_64 (1<<7)
3892#define DDL_PLANEB_PRECISION_16 (0<<7) 3892#define DDL_PLANEB_PRECISION_32 (0<<7)
3893#define DDL_PLANEB_SHIFT 0 3893#define DDL_PLANEB_SHIFT 0
3894 3894
3895#define VLV_DDL3 (VLV_DISPLAY_BASE + 0x70058) 3895#define VLV_DDL3 (VLV_DISPLAY_BASE + 0x70058)
3896#define DDL_CURSORC_PRECISION_32 (1<<31) 3896#define DDL_CURSORC_PRECISION_64 (1<<31)
3897#define DDL_CURSORC_PRECISION_16 (0<<31) 3897#define DDL_CURSORC_PRECISION_32 (0<<31)
3898#define DDL_CURSORC_SHIFT 24 3898#define DDL_CURSORC_SHIFT 24
3899#define DDL_SPRITEF_PRECISION_32 (1<<23) 3899#define DDL_SPRITEF_PRECISION_64 (1<<23)
3900#define DDL_SPRITEF_PRECISION_16 (0<<23) 3900#define DDL_SPRITEF_PRECISION_32 (0<<23)
3901#define DDL_SPRITEF_SHIFT 16 3901#define DDL_SPRITEF_SHIFT 16
3902#define DDL_SPRITEE_PRECISION_32 (1<<15) 3902#define DDL_SPRITEE_PRECISION_64 (1<<15)
3903#define DDL_SPRITEE_PRECISION_16 (0<<15) 3903#define DDL_SPRITEE_PRECISION_32 (0<<15)
3904#define DDL_SPRITEE_SHIFT 8 3904#define DDL_SPRITEE_SHIFT 8
3905#define DDL_PLANEC_PRECISION_32 (1<<7) 3905#define DDL_PLANEC_PRECISION_64 (1<<7)
3906#define DDL_PLANEC_PRECISION_16 (0<<7) 3906#define DDL_PLANEC_PRECISION_32 (0<<7)
3907#define DDL_PLANEC_SHIFT 0 3907#define DDL_PLANEC_SHIFT 0
3908 3908
3909/* FIFO watermark sizes etc */ 3909/* FIFO watermark sizes etc */
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 72948a05312c..91edd47e9bce 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1288,13 +1288,13 @@ static bool vlv_compute_drain_latency(struct drm_device *dev,
1288 1288
1289 entries = (clock / 1000) * pixel_size; 1289 entries = (clock / 1000) * pixel_size;
1290 *plane_prec_mult = (entries > 256) ? 1290 *plane_prec_mult = (entries > 256) ?
1291 DRAIN_LATENCY_PRECISION_32 : DRAIN_LATENCY_PRECISION_16; 1291 DRAIN_LATENCY_PRECISION_64 : DRAIN_LATENCY_PRECISION_32;
1292 *plane_dl = (64 * (*plane_prec_mult) * 4) / ((clock / 1000) * 1292 *plane_dl = (64 * (*plane_prec_mult) * 4) / ((clock / 1000) *
1293 pixel_size); 1293 pixel_size);
1294 1294
1295 entries = (clock / 1000) * 4; /* BPP is always 4 for cursor */ 1295 entries = (clock / 1000) * 4; /* BPP is always 4 for cursor */
1296 *cursor_prec_mult = (entries > 256) ? 1296 *cursor_prec_mult = (entries > 256) ?
1297 DRAIN_LATENCY_PRECISION_32 : DRAIN_LATENCY_PRECISION_16; 1297 DRAIN_LATENCY_PRECISION_64 : DRAIN_LATENCY_PRECISION_32;
1298 *cursor_dl = (64 * (*cursor_prec_mult) * 4) / ((clock / 1000) * 4); 1298 *cursor_dl = (64 * (*cursor_prec_mult) * 4) / ((clock / 1000) * 4);
1299 1299
1300 return true; 1300 return true;
@@ -1320,9 +1320,9 @@ static void vlv_update_drain_latency(struct drm_device *dev)
1320 if (vlv_compute_drain_latency(dev, 0, &plane_prec_mult, &planea_dl, 1320 if (vlv_compute_drain_latency(dev, 0, &plane_prec_mult, &planea_dl,
1321 &cursor_prec_mult, &cursora_dl)) { 1321 &cursor_prec_mult, &cursora_dl)) {
1322 cursora_prec = (cursor_prec_mult == DRAIN_LATENCY_PRECISION_32) ? 1322 cursora_prec = (cursor_prec_mult == DRAIN_LATENCY_PRECISION_32) ?
1323 DDL_CURSORA_PRECISION_32 : DDL_CURSORA_PRECISION_16; 1323 DDL_CURSORA_PRECISION_32 : DDL_CURSORA_PRECISION_64;
1324 planea_prec = (plane_prec_mult == DRAIN_LATENCY_PRECISION_32) ? 1324 planea_prec = (plane_prec_mult == DRAIN_LATENCY_PRECISION_32) ?
1325 DDL_PLANEA_PRECISION_32 : DDL_PLANEA_PRECISION_16; 1325 DDL_PLANEA_PRECISION_32 : DDL_PLANEA_PRECISION_64;
1326 1326
1327 I915_WRITE(VLV_DDL1, cursora_prec | 1327 I915_WRITE(VLV_DDL1, cursora_prec |
1328 (cursora_dl << DDL_CURSORA_SHIFT) | 1328 (cursora_dl << DDL_CURSORA_SHIFT) |
@@ -1333,9 +1333,9 @@ static void vlv_update_drain_latency(struct drm_device *dev)
1333 if (vlv_compute_drain_latency(dev, 1, &plane_prec_mult, &planeb_dl, 1333 if (vlv_compute_drain_latency(dev, 1, &plane_prec_mult, &planeb_dl,
1334 &cursor_prec_mult, &cursorb_dl)) { 1334 &cursor_prec_mult, &cursorb_dl)) {
1335 cursorb_prec = (cursor_prec_mult == DRAIN_LATENCY_PRECISION_32) ? 1335 cursorb_prec = (cursor_prec_mult == DRAIN_LATENCY_PRECISION_32) ?
1336 DDL_CURSORB_PRECISION_32 : DDL_CURSORB_PRECISION_16; 1336 DDL_CURSORB_PRECISION_32 : DDL_CURSORB_PRECISION_64;
1337 planeb_prec = (plane_prec_mult == DRAIN_LATENCY_PRECISION_32) ? 1337 planeb_prec = (plane_prec_mult == DRAIN_LATENCY_PRECISION_32) ?
1338 DDL_PLANEB_PRECISION_32 : DDL_PLANEB_PRECISION_16; 1338 DDL_PLANEB_PRECISION_32 : DDL_PLANEB_PRECISION_64;
1339 1339
1340 I915_WRITE(VLV_DDL2, cursorb_prec | 1340 I915_WRITE(VLV_DDL2, cursorb_prec |
1341 (cursorb_dl << DDL_CURSORB_SHIFT) | 1341 (cursorb_dl << DDL_CURSORB_SHIFT) |