[Intel-gfx] [PATCH 1/7] drm: Fix DP_TEST_COUNT_MASK

2015-07-23 Thread Rodrigo Vivi
By Vesa's DP 1.2 Spec this counter has 4 bits [3:0].

This mask is wrong since when the counter was introduced by myself
on commit ad9dc91b6e21266bfc6f466db4b95e10211f31ee
Author: Rodrigo Vivi rodrigo.v...@gmail.com
Date:   Tue Sep 16 19:18:12 2014 -0400

drm/i915: Fix Sink CRC

Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 include/drm/drm_dp_helper.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 2e86f64..94898f6 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -420,7 +420,7 @@
 
 #define DP_TEST_SINK_MISC  0x246
 # define DP_TEST_CRC_SUPPORTED (1  5)
-# define DP_TEST_COUNT_MASK0x7
+# define DP_TEST_COUNT_MASK0xf
 
 #define DP_TEST_RESPONSE   0x260
 # define DP_TEST_ACK   (1  0)
-- 
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 4/7] drm/i915: Split sink_crc function in start, stop and read.

2015-07-23 Thread Rodrigo Vivi
No functional change. Just a preparation patch to make clear
what operation we are performing.

Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/intel_dp.c | 89 +++--
 1 file changed, 50 insertions(+), 39 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 44f8a32..10cbc98 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3958,40 +3958,64 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
return intel_dp-is_mst;
 }
 
-int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
+static void intel_dp_sink_crc_stop(struct intel_dp *intel_dp)
 {
-   struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct drm_device *dev = intel_dig_port-base.base.dev;
-   struct intel_crtc *intel_crtc =
-   to_intel_crtc(intel_dig_port-base.base.crtc);
+   struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
+   struct intel_crtc *intel_crtc = to_intel_crtc(dig_port-base.base.crtc);
u8 buf;
-   int test_crc_count;
-   int attempts = 6;
-   int ret = 0;
-
-   hsw_disable_ips(intel_crtc);
 
-   if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK_MISC, buf)  0) {
-   ret = -EIO;
-   goto out;
+   if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK, buf)  0) {
+   DRM_DEBUG_KMS(Sink CRC couldn't be stopped properly\n);
+   return;
}
 
-   if (!(buf  DP_TEST_CRC_SUPPORTED)) {
-   ret = -ENOTTY;
-   goto out;
-   }
+   if (drm_dp_dpcd_writeb(intel_dp-aux, DP_TEST_SINK,
+  buf  ~DP_TEST_SINK_START)  0)
+   DRM_DEBUG_KMS(Sink CRC couldn't be stopped properly\n);
 
-   if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK, buf)  0) {
-   ret = -EIO;
-   goto out;
-   }
+   hsw_enable_ips(intel_crtc);
+}
+
+static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
+{
+   struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
+   struct intel_crtc *intel_crtc = to_intel_crtc(dig_port-base.base.crtc);
+   u8 buf;
+
+   if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK_MISC, buf)  0)
+   return -EIO;
+
+   if (!(buf  DP_TEST_CRC_SUPPORTED))
+   return -ENOTTY;
+
+   if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK, buf)  0)
+   return -EIO;
+
+   hsw_disable_ips(intel_crtc);
 
if (drm_dp_dpcd_writeb(intel_dp-aux, DP_TEST_SINK,
-   buf | DP_TEST_SINK_START)  0) {
-   ret = -EIO;
-   goto out;
+  buf | DP_TEST_SINK_START)  0) {
+   hsw_enable_ips(intel_crtc);
+   return -EIO;
}
 
+   return 0;
+}
+
+int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
+{
+   struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
+   struct drm_device *dev = dig_port-base.base.dev;
+   struct intel_crtc *intel_crtc = to_intel_crtc(dig_port-base.base.crtc);
+   u8 buf;
+   int test_crc_count;
+   int attempts = 6;
+   int ret;
+
+   ret = intel_dp_sink_crc_start(intel_dp);
+   if (ret)
+   return ret;
+
if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK_MISC, buf)  0) {
ret = -EIO;
goto stop;
@@ -4014,23 +4038,10 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 
*crc)
goto stop;
}
 
-   if (drm_dp_dpcd_read(intel_dp-aux, DP_TEST_CRC_R_CR, crc, 6)  0) {
+   if (drm_dp_dpcd_read(intel_dp-aux, DP_TEST_CRC_R_CR, crc, 6)  0)
ret = -EIO;
-   goto stop;
-   }
-
 stop:
-   if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK, buf)  0) {
-   DRM_DEBUG_KMS(Sink CRC couldn't be stopped properly\n);
-   goto out;
-   }
-   if (drm_dp_dpcd_writeb(intel_dp-aux, DP_TEST_SINK,
-  buf  ~DP_TEST_SINK_START)  0) {
-   DRM_DEBUG_KMS(Sink CRC couldn't be stopped properly\n);
-   goto out;
-   }
-out:
-   hsw_enable_ips(intel_crtc);
+   intel_dp_sink_crc_stop(intel_dp);
return ret;
 }
 
-- 
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 2/7] drm/i915: Try to stop sink crc calculation on error.

2015-07-23 Thread Rodrigo Vivi
Right now if we face any kind of error sink crc calculation
stays enabled.

So, let's give a shot and try to stop it anyway if it got enabled.

Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/intel_dp.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f1b9f93..70a4a37 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3994,7 +3994,7 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
 
if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK_MISC, buf)  0) {
ret = -EIO;
-   goto out;
+   goto stop;
}
 
test_crc_count = buf  DP_TEST_COUNT_MASK;
@@ -4003,7 +4003,7 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
if (drm_dp_dpcd_readb(intel_dp-aux,
  DP_TEST_SINK_MISC, buf)  0) {
ret = -EIO;
-   goto out;
+   goto stop;
}
intel_wait_for_vblank(dev, intel_crtc-pipe);
} while (--attempts  (buf  DP_TEST_COUNT_MASK) == test_crc_count);
@@ -4011,14 +4011,15 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 
*crc)
if (attempts == 0) {
DRM_DEBUG_KMS(Panel is unable to calculate CRC after 6 
vblanks\n);
ret = -ETIMEDOUT;
-   goto out;
+   goto stop;
}
 
if (drm_dp_dpcd_read(intel_dp-aux, DP_TEST_CRC_R_CR, crc, 6)  0) {
ret = -EIO;
-   goto out;
+   goto stop;
}
 
+stop:
if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK, buf)  0) {
ret = -EIO;
goto out;
-- 
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 7/7] drm/i915: Dont -ETIMEDOUT on identical new and previous (count, crc).

2015-07-23 Thread Rodrigo Vivi
By Vesa DP 1.2 spec TEST_CRC_COUNT is a 4 bit wrap counter which
increments each time the TEST_CRC_x_x are updated.

However if we are trying to verify the screen hasn't changed we get
same (count, crc) pair twice. Without this patch we would return
-ETIMEOUT in this case.

So, if in 6 vblanks the pair (count, crc) hasn't changed we
return it anyway instead of returning error and let test case decide
if it was right or not.

Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/intel_dp.c | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index c7372a1..e99ec7a 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4028,6 +4028,7 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
u8 buf;
int count, ret;
int attempts = 6;
+   bool old_equal_new;
 
ret = intel_dp_sink_crc_start(intel_dp);
if (ret)
@@ -4042,6 +4043,7 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
goto stop;
}
count = buf  DP_TEST_COUNT_MASK;
+
/*
 * Count might be reset during the loop. In this case
 * last known count needs to be reset as well.
@@ -4053,17 +4055,24 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 
*crc)
ret = -EIO;
goto stop;
}
-   } while (--attempts  (count == 0 || (count == 
intel_dp-sink_crc.last_count 
-  
!memcmp(intel_dp-sink_crc.last_crc, crc,
-  6 * sizeof(u8);
+
+   old_equal_new = (count == intel_dp-sink_crc.last_count 
+!memcmp(intel_dp-sink_crc.last_crc, crc,
+6 * sizeof(u8)));
+
+   } while (--attempts  (count == 0 || old_equal_new));
 
intel_dp-sink_crc.last_count = buf  DP_TEST_COUNT_MASK;
memcpy(intel_dp-sink_crc.last_crc, crc, 6 * sizeof(u8));
 
if (attempts == 0) {
-   DRM_DEBUG_KMS(Panel is unable to calculate CRC after 6 
vblanks\n);
-   ret = -ETIMEDOUT;
-   goto stop;
+   if (old_equal_new) {
+   DRM_DEBUG_KMS(Unreliable Sink CRC counter: Current 
returned CRC is identical to the previous one\n);
+   } else {
+   DRM_ERROR(Panel is unable to calculate any CRC after 6 
vblanks\n);
+   ret = -ETIMEDOUT;
+   goto stop;
+   }
}
 
 stop:
-- 
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 3/7] drm/i915: Don't return error on sink crc stop.

2015-07-23 Thread Rodrigo Vivi
If we got to the point where we are trying to stop sink CRC
the main output of this function was already gotten properly,
so don't return the error and let userspace use the crc data.

Let's replace the errnos returns with some log messages.

Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/intel_dp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 70a4a37..44f8a32 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4021,12 +4021,12 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 
*crc)
 
 stop:
if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK, buf)  0) {
-   ret = -EIO;
+   DRM_DEBUG_KMS(Sink CRC couldn't be stopped properly\n);
goto out;
}
if (drm_dp_dpcd_writeb(intel_dp-aux, DP_TEST_SINK,
   buf  ~DP_TEST_SINK_START)  0) {
-   ret = -EIO;
+   DRM_DEBUG_KMS(Sink CRC couldn't be stopped properly\n);
goto out;
}
 out:
-- 
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 5/7] drm/i915: Force sink crc stop before start.

2015-07-23 Thread Rodrigo Vivi
By Vesa DP spec, test counter at DP_TEST_SINK_MISC just reset to 0
when unsetting DP_TEST_SINK_START, so let's force this stop here.

But let's minimize the aux transactions and just do it when we know
it hasn't been properly stoped.

Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/intel_dp.c  | 22 +++---
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 10cbc98..3ba031d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3958,22 +3958,30 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
return intel_dp-is_mst;
 }
 
-static void intel_dp_sink_crc_stop(struct intel_dp *intel_dp)
+static int intel_dp_sink_crc_stop(struct intel_dp *intel_dp)
 {
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
struct intel_crtc *intel_crtc = to_intel_crtc(dig_port-base.base.crtc);
u8 buf;
+   int ret = 0;
 
if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK, buf)  0) {
DRM_DEBUG_KMS(Sink CRC couldn't be stopped properly\n);
-   return;
+   ret = -EIO;
+   goto out;
}
 
if (drm_dp_dpcd_writeb(intel_dp-aux, DP_TEST_SINK,
-  buf  ~DP_TEST_SINK_START)  0)
+  buf  ~DP_TEST_SINK_START)  0) {
DRM_DEBUG_KMS(Sink CRC couldn't be stopped properly\n);
+   ret = -EIO;
+   goto out;
+   }
 
+   intel_dp-sink_crc_started = false;
+ out:
hsw_enable_ips(intel_crtc);
+   return ret;
 }
 
 static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
@@ -3981,6 +3989,13 @@ static int intel_dp_sink_crc_start(struct intel_dp 
*intel_dp)
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
struct intel_crtc *intel_crtc = to_intel_crtc(dig_port-base.base.crtc);
u8 buf;
+   int ret;
+
+   if (intel_dp-sink_crc_started) {
+   ret = intel_dp_sink_crc_stop(intel_dp);
+   if (ret)
+   return ret;
+   }
 
if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK_MISC, buf)  0)
return -EIO;
@@ -3999,6 +4014,7 @@ static int intel_dp_sink_crc_start(struct intel_dp 
*intel_dp)
return -EIO;
}
 
+   intel_dp-sink_crc_started = true;
return 0;
 }
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 47cef0e..cc74400 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -714,6 +714,7 @@ struct intel_dp {
/* sink rates as reported by DP_SUPPORTED_LINK_RATES */
uint8_t num_sink_rates;
int sink_rates[DP_MAX_SUPPORTED_RATES];
+   bool sink_crc_started;
struct drm_dp_aux aux;
uint8_t train_set[4];
int panel_power_up_delay;
-- 
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 6/7] drm/i915: Save latest known sink CRC to compensate delayed counter reset.

2015-07-23 Thread Rodrigo Vivi
By Vesa DP 1.2 Spec TEST_CRC_COUNT should be
reset to 0 when TEST_SINK bit 0 = 0.

However for some strange reason when PSR is enabled in
certain platforms this is not true. At least not immediatelly.

So we face cases like this:

first get_sink_crc operation:
 count: 0, crc: 
 count: 1, crc: c101c101c101
returned expected crc: c101c101c101

secont get_sink_crc operation:
 count: 1, crc: c101c101c101
 count: 0, crc: 
 count: 1, crc: c101
should return expected crc: c101

But also the reset to 0 should be faster resulting into:

get_sink_crc operation:
 count: 1, crc: c101c101c101
 count: 1, crc: c101
should return expected crc: c101

So in order to know that the second one is valid one
we need to compare the pair (count, crc) with latest (count, crc).

If the pair changed you have your valid CRC.

Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/intel_dp.c  | 42 +---
 drivers/gpu/drm/i915/intel_drv.h |  8 +++-
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 3ba031d..c7372a1 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3978,7 +3978,7 @@ static int intel_dp_sink_crc_stop(struct intel_dp 
*intel_dp)
goto out;
}
 
-   intel_dp-sink_crc_started = false;
+   intel_dp-sink_crc.started = false;
  out:
hsw_enable_ips(intel_crtc);
return ret;
@@ -3991,7 +3991,7 @@ static int intel_dp_sink_crc_start(struct intel_dp 
*intel_dp)
u8 buf;
int ret;
 
-   if (intel_dp-sink_crc_started) {
+   if (intel_dp-sink_crc.started) {
ret = intel_dp_sink_crc_stop(intel_dp);
if (ret)
return ret;
@@ -4003,6 +4003,8 @@ static int intel_dp_sink_crc_start(struct intel_dp 
*intel_dp)
if (!(buf  DP_TEST_CRC_SUPPORTED))
return -ENOTTY;
 
+   intel_dp-sink_crc.last_count = buf  DP_TEST_COUNT_MASK;
+
if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK, buf)  0)
return -EIO;
 
@@ -4014,7 +4016,7 @@ static int intel_dp_sink_crc_start(struct intel_dp 
*intel_dp)
return -EIO;
}
 
-   intel_dp-sink_crc_started = true;
+   intel_dp-sink_crc.started = true;
return 0;
 }
 
@@ -4024,29 +4026,39 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 
*crc)
struct drm_device *dev = dig_port-base.base.dev;
struct intel_crtc *intel_crtc = to_intel_crtc(dig_port-base.base.crtc);
u8 buf;
-   int test_crc_count;
+   int count, ret;
int attempts = 6;
-   int ret;
 
ret = intel_dp_sink_crc_start(intel_dp);
if (ret)
return ret;
 
-   if (drm_dp_dpcd_readb(intel_dp-aux, DP_TEST_SINK_MISC, buf)  0) {
-   ret = -EIO;
-   goto stop;
-   }
-
-   test_crc_count = buf  DP_TEST_COUNT_MASK;
-
do {
+   intel_wait_for_vblank(dev, intel_crtc-pipe);
+
if (drm_dp_dpcd_readb(intel_dp-aux,
  DP_TEST_SINK_MISC, buf)  0) {
ret = -EIO;
goto stop;
}
-   intel_wait_for_vblank(dev, intel_crtc-pipe);
-   } while (--attempts  (buf  DP_TEST_COUNT_MASK) == test_crc_count);
+   count = buf  DP_TEST_COUNT_MASK;
+   /*
+* Count might be reset during the loop. In this case
+* last known count needs to be reset as well.
+*/
+   if (count == 0)
+   intel_dp-sink_crc.last_count = 0;
+
+   if (drm_dp_dpcd_read(intel_dp-aux, DP_TEST_CRC_R_CR, crc, 6) 
 0) {
+   ret = -EIO;
+   goto stop;
+   }
+   } while (--attempts  (count == 0 || (count == 
intel_dp-sink_crc.last_count 
+  
!memcmp(intel_dp-sink_crc.last_crc, crc,
+  6 * sizeof(u8);
+
+   intel_dp-sink_crc.last_count = buf  DP_TEST_COUNT_MASK;
+   memcpy(intel_dp-sink_crc.last_crc, crc, 6 * sizeof(u8));
 
if (attempts == 0) {
DRM_DEBUG_KMS(Panel is unable to calculate CRC after 6 
vblanks\n);
@@ -4054,8 +4066,6 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
goto stop;
}
 
-   if (drm_dp_dpcd_read(intel_dp-aux, DP_TEST_CRC_R_CR, crc, 6)  0)
-   ret = -EIO;
 stop:
intel_dp_sink_crc_stop(intel_dp);
return ret;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index cc74400..c072820 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ 

Re: [Intel-gfx] [PATCH] drm/i915: fix checksum write for automated test reply

2015-07-23 Thread shuang . he
Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: 
shuang...@intel.com)
Task id: 6848
-Summary-
Platform  Delta  drm-intel-nightly  Series Applied
ILK  295/295  295/295
SNB  315/315  315/315
IVB  342/342  342/342
BYT  285/285  285/285
HSW  378/380  378/380
-Detailed-
Platform  Testdrm-intel-nightly  Series 
Applied
Note: You need to pay more attention to line start with '*'
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 0/4] Add support for Hyperlinks and Markup on kernel-doc

2015-07-23 Thread Jonathan Corbet
On Thu, 23 Jul 2015 15:16:23 -0300
Danilo Cesar Lemes de Paula danilo.ce...@collabora.co.uk wrote:

 This series add supports for hyperlink cross-references on Docbooks and
 an optional markup syntax for in-source Documentation.

I like the idea; just be warned that it's likely to be a week or two and
one more ocean crossing before I can take a serious look at this...

Thanks,

jon
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush.

2015-07-23 Thread Ander Conselvan De Oliveira
Reviewed-by: Ander Conselvan de Oliveira conselv...@gmail.com

On Tue, 2015-07-21 at 13:28 +0200, Maarten Lankhorst wrote:
 In intel it's useful to keep track of some state changes with old
 crtc state vs new state, for example to disable initial planes or
 when a modeset's prevented during fastboot.
 
 Cc: dri-de...@lists.freedesktop.org
 Signed-off-by: Maarten Lankhorst maarten.lankho...@linux.intel.com
 ---
  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c |  6 --
  drivers/gpu/drm/drm_atomic_helper.c|  8 
  drivers/gpu/drm/drm_plane_helper.c |  4 ++--
  drivers/gpu/drm/i915/intel_display.c   | 10 ++
  drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c   |  6 --
  drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c   |  6 --
  drivers/gpu/drm/rcar-du/rcar_du_crtc.c |  6 --
  drivers/gpu/drm/sti/sti_drm_crtc.c |  6 --
  drivers/gpu/drm/tegra/dc.c |  6 --
  include/drm/drm_crtc_helper.h  |  6 --
  10 files changed, 40 insertions(+), 24 deletions(-)
 
 diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c 
 b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
 index f69b92535505..8b8fe3762ca9 100644
 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
 +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
 @@ -239,7 +239,8 @@ static int atmel_hlcdc_crtc_atomic_check(struct 
 drm_crtc *c,
   return atmel_hlcdc_plane_prepare_disc_area(s);
  }
  
 -static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c)
 +static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c,
 +   struct drm_crtc_state 
 *old_s)
  {
   struct atmel_hlcdc_crtc *crtc = 
 drm_crtc_to_atmel_hlcdc_crtc(c);
  
 @@ -253,7 +254,8 @@ static void atmel_hlcdc_crtc_atomic_begin(struct 
 drm_crtc *c)
   }
  }
  
 -static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc)
 +static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc,
 +   struct drm_crtc_state 
 *old_s)
  {
   /* TODO: write common plane control register if available */
  }
 diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
 b/drivers/gpu/drm/drm_atomic_helper.c
 index ac6601071414..4a48d76c4fb1 100644
 --- a/drivers/gpu/drm/drm_atomic_helper.c
 +++ b/drivers/gpu/drm/drm_atomic_helper.c
 @@ -1170,7 +1170,7 @@ void drm_atomic_helper_commit_planes(struct 
 drm_device *dev,
   if (!funcs || !funcs-atomic_begin)
   continue;
  
 - funcs-atomic_begin(crtc);
 + funcs-atomic_begin(crtc, old_crtc_state);
   }
  
   for_each_plane_in_state(old_state, plane, old_plane_state, 
 i) {
 @@ -1200,7 +1200,7 @@ void drm_atomic_helper_commit_planes(struct 
 drm_device *dev,
   if (!funcs || !funcs-atomic_flush)
   continue;
  
 - funcs-atomic_flush(crtc);
 + funcs-atomic_flush(crtc, old_crtc_state);
   }
  }
  EXPORT_SYMBOL(drm_atomic_helper_commit_planes);
 @@ -1236,7 +1236,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct 
 drm_crtc_state *old_crtc_state)
  
   crtc_funcs = crtc-helper_private;
   if (crtc_funcs  crtc_funcs-atomic_begin)
 - crtc_funcs-atomic_begin(crtc);
 + crtc_funcs-atomic_begin(crtc, old_crtc_state);
  
   drm_for_each_plane_mask(plane, crtc-dev, plane_mask) {
   struct drm_plane_state *old_plane_state =
 @@ -1259,7 +1259,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct 
 drm_crtc_state *old_crtc_state)
   }
  
   if (crtc_funcs  crtc_funcs-atomic_flush)
 - crtc_funcs-atomic_flush(crtc);
 + crtc_funcs-atomic_flush(crtc, old_crtc_state);
  }
  EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc);
  
 diff --git a/drivers/gpu/drm/drm_plane_helper.c 
 b/drivers/gpu/drm/drm_plane_helper.c
 index 03b7afe455e6..cb5dab4c4337 100644
 --- a/drivers/gpu/drm/drm_plane_helper.c
 +++ b/drivers/gpu/drm/drm_plane_helper.c
 @@ -436,7 +436,7 @@ int drm_plane_helper_commit(struct drm_plane 
 *plane,
  
   for (i = 0; i  2; i++) {
   if (crtc_funcs[i]  crtc_funcs[i]-atomic_begin)
 - crtc_funcs[i]-atomic_begin(crtc[i]);
 + crtc_funcs[i]-atomic_begin(crtc[i], crtc[i]
 -state);
   }
  
   /*
 @@ -451,7 +451,7 @@ int drm_plane_helper_commit(struct drm_plane 
 *plane,
  
   for (i = 0; i  2; i++) {
   if (crtc_funcs[i]  crtc_funcs[i]-atomic_flush)
 - crtc_funcs[i]-atomic_flush(crtc[i]);
 + crtc_funcs[i]-atomic_flush(crtc[i], crtc[i]
 -state);
   }
  
   /*
 diff --git a/drivers/gpu/drm/i915/intel_display.c 
 b/drivers/gpu/drm/i915/intel_display.c
 index 671ca2820f82..def9444eeae2 100644
 --- a/drivers/gpu/drm/i915/intel_display.c
 +++ b/drivers/gpu/drm/i915/intel_display.c
 @@ -102,8 +102,8 @@ static void vlv_prepare_pll(struct intel_crtc 
 *crtc,
 

[Intel-gfx] [PATCH i-g-t] tools/Makefile.sources: fix igt_stats complie error on android

2015-07-23 Thread Derek Morton
There are two versions of igt_stats.c in tools and lib\tests
which causes the build system to have two build modules with
the same name.
This patch specifies a different target name for the tool so
there is no clash.

Signed-off-by: Derek Morton derek.j.mor...@intel.com
---
 tools/Makefile.sources | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/Makefile.sources b/tools/Makefile.sources
index 8ca9351..d19ef96 100644
--- a/tools/Makefile.sources
+++ b/tools/Makefile.sources
@@ -5,7 +5,7 @@ noinst_PROGRAMS = \
$(NULL)
 
 bin_PROGRAMS = \
-   igt_stats   \
+   igt_statistics  \
intel_audio_dump\
intel_reg   \
intel_backlight \
@@ -63,3 +63,9 @@ intel_l3_parity_SOURCES = \
intel_l3_parity.h   \
intel_l3_udev_listener.c
 
+# Android does not like building multiple targets with the same name
+# tools/igt_stats.c clashes with lib/tests/igt_stats.c. Simplest fix is to
+# specify a different target name here.
+igt_statistics_SOURCES =   \
+   igt_stats.c
+
-- 
1.9.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/6] drm/atomic: add connectors_changed to separate it from mode_changed, v2

2015-07-23 Thread Ander Conselvan De Oliveira
On Tue, 2015-07-21 at 13:28 +0200, Maarten Lankhorst wrote:
 This can be a separate case from mode_changed, when connectors stay 
 the
 same but only the mode is different. Drivers may choose to implement 
 specific
 optimizations to prevent a full modeset for this case.
 
 Changes since v1:
 - Update kerneldocs slightly.
 
 Cc: dri-de...@lists.freedesktop.org
 Signed-off-by: Maarten Lankhorst maarten.lankho...@linux.intel.com

I have a couple of nits below, but anyway,

Reviewed-by: Ander Conselvan de Oliveira conselv...@gmail.com

 ---
  drivers/gpu/drm/drm_atomic_helper.c  | 39 
 +++-
  drivers/gpu/drm/i915/intel_display.c |  2 +-
  include/drm/drm_atomic.h |  3 ++-
  include/drm/drm_crtc.h   |  8 +---
  4 files changed, 38 insertions(+), 14 deletions(-)
 
 diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
 b/drivers/gpu/drm/drm_atomic_helper.c
 index 0ea8c5d476ef..ac6601071414 100644
 --- a/drivers/gpu/drm/drm_atomic_helper.c
 +++ b/drivers/gpu/drm/drm_atomic_helper.c
 @@ -124,7 +124,7 @@ steal_encoder(struct drm_atomic_state *state,
   if (IS_ERR(crtc_state))
   return PTR_ERR(crtc_state);
  
 - crtc_state-mode_changed = true;
 + crtc_state-connectors_changed = true;
  
   list_for_each_entry(connector, config-connector_list, 
 head) {
   if (connector-state-best_encoder != encoder)
 @@ -174,14 +174,14 @@ update_connector_routing(struct 
 drm_atomic_state *state, int conn_idx)
   idx = drm_crtc_index(connector-state
 -crtc);
  
   crtc_state = state-crtc_states[idx];
 - crtc_state-mode_changed = true;
 + crtc_state-connectors_changed = true;
   }
  
   if (connector_state-crtc) {
   idx = drm_crtc_index(connector_state-crtc);
  
   crtc_state = state-crtc_states[idx];
 - crtc_state-mode_changed = true;
 + crtc_state-connectors_changed = true;
   }
   }
  
 @@ -233,7 +233,7 @@ update_connector_routing(struct drm_atomic_state 
 *state, int conn_idx)
   idx = drm_crtc_index(connector_state-crtc);
  
   crtc_state = state-crtc_states[idx];
 - crtc_state-mode_changed = true;
 + crtc_state-connectors_changed = true;
  

There's a comment above the call to update_connector_routing() that
mentions setting crtc_state-mode_changed. That should be updated to
reflect the changes above.

   DRM_DEBUG_ATOMIC([CONNECTOR:%d:%s] using [ENCODER:%d:%s] on 
 [CRTC:%d]\n,
connector-base.id,
 

[...]

 @@ -338,9 +340,14 @@ mode_fixup(struct drm_atomic_state *state)
   *
   * Check the state object to see if the requested state is physically 
 possible.
   * This does all the crtc and connector related computations for an atomic
 - * update. It computes and updates crtc_state-mode_changed, adds any 
 additional
 - * connectors needed for full modesets and calls down into -mode_fixup
 - * functions of the driver backend.
 + * update and adds any additional connectors needed for full modesets and 
 calls

The first 'and' should be replaced with a comma.

[...]

Ander
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t] benchmark/: fix gem_exec_nop complie error on android

2015-07-23 Thread Derek Morton
There are two versions of gem_exec_nop.c in benchmarks and tests
which causes the build system to have two build modules with
the same name.
This patch renames benchmarks/gem_exec_nop.c to
benchmarks/gem_exec_nop_benchmark.c using the existing
gem_userptr_benchmark.c as a naming convention.

Signed-off-by: Derek Morton derek.j.mor...@intel.com
---
 benchmarks/Makefile.sources |   6 +-
 benchmarks/gem_exec_nop.c   | 153 
 benchmarks/gem_exec_nop_benchmark.c | 153 
 3 files changed, 158 insertions(+), 154 deletions(-)
 delete mode 100644 benchmarks/gem_exec_nop.c
 create mode 100644 benchmarks/gem_exec_nop_benchmark.c

diff --git a/benchmarks/Makefile.sources b/benchmarks/Makefile.sources
index d8a7440..ab2dc89 100644
--- a/benchmarks/Makefile.sources
+++ b/benchmarks/Makefile.sources
@@ -1,7 +1,11 @@
+# If you copy a test to benckmarks, rename it _benchmark
+# The andriod build will fail when trying to build multiple binaries with
+# the same name.
+
 bin_PROGRAMS =  \
intel_upload_blit_large \
intel_upload_blit_large_gtt \
intel_upload_blit_large_map \
intel_upload_blit_small \
-   gem_exec_nop\
+   gem_exec_nop_benchmark  \
gem_userptr_benchmark
diff --git a/benchmarks/gem_exec_nop.c b/benchmarks/gem_exec_nop.c
deleted file mode 100644
index 2a3abd2..000
--- a/benchmarks/gem_exec_nop.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright © 2011 Intel Corporation
- *
- * 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, sublicense,
- * 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 NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS 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:
- *Chris Wilson ch...@chris-wilson.co.uk
- *
- */
-
-#include unistd.h
-#include stdlib.h
-#include stdint.h
-#include stdio.h
-#include string.h
-#include fcntl.h
-#include inttypes.h
-#include errno.h
-#include sys/stat.h
-#include sys/ioctl.h
-#include sys/time.h
-#include time.h
-
-#include drm.h
-#include ioctl_wrappers.h
-#include drmtest.h
-#include intel_io.h
-#include igt_stats.h
-
-#define LOCAL_I915_EXEC_NO_RELOC (111)
-#define LOCAL_I915_EXEC_HANDLE_LUT (112)
-
-static uint64_t elapsed(const struct timespec *start,
-   const struct timespec *end,
-   int loop)
-{
-   return (10ULL*(end-tv_sec - start-tv_sec) + (end-tv_nsec - 
start-tv_nsec))/loop;
-}
-
-static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
-{
-   int err = 0;
-   if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf))
-   err = -errno;
-   return err;
-}
-
-static uint32_t batch(int fd)
-{
-   const uint32_t buf[] = {MI_BATCH_BUFFER_END};
-   uint32_t handle = gem_create(fd, 4096);
-   gem_write(fd, handle, 0, buf, sizeof(buf));
-   return handle;
-}
-
-static int loop(unsigned ring, int reps)
-{
-   struct drm_i915_gem_execbuffer2 execbuf;
-   struct drm_i915_gem_exec_object2 gem_exec;
-   int count, fd;
-
-   fd = drm_open_any();
-
-   memset(gem_exec, 0, sizeof(gem_exec));
-   gem_exec.handle = batch(fd);
-
-   memset(execbuf, 0, sizeof(execbuf));
-   execbuf.buffers_ptr = (uintptr_t)gem_exec;
-   execbuf.buffer_count = 1;
-   execbuf.flags = ring;
-   execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT;
-   execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC;
-   if (__gem_execbuf(fd, execbuf)) {
-   execbuf.flags = ring;
-   if (__gem_execbuf(fd, execbuf))
-   return 77;
-   }
-
-   for (count = 1; count = 116; count = 1) {
-   igt_stats_t stats;
-   int n;
-
-   igt_stats_init_with_size(stats, reps);
-
-   for (n = 0; n  reps; n++) {
-   struct timespec start, end;
-   int loops = count;
-   sleep(1); /* wait for the hw to go back to sleep 

Re: [Intel-gfx] [PATCH 1/7] drm: Fix DP_TEST_COUNT_MASK

2015-07-23 Thread Sivakumar Thulasimani

Reviewed-by: Sivakumar Thulasimani sivakumar.thulasim...@intel.com

On 7/24/2015 5:04 AM, Rodrigo Vivi wrote:

By Vesa's DP 1.2 Spec this counter has 4 bits [3:0].

This mask is wrong since when the counter was introduced by myself
on commit ad9dc91b6e21266bfc6f466db4b95e10211f31ee
Author: Rodrigo Vivi rodrigo.v...@gmail.com
Date:   Tue Sep 16 19:18:12 2014 -0400

 drm/i915: Fix Sink CRC

Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
  include/drm/drm_dp_helper.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 2e86f64..94898f6 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -420,7 +420,7 @@
  
  #define DP_TEST_SINK_MISC		0x246

  # define DP_TEST_CRC_SUPPORTED(1  5)
-# define DP_TEST_COUNT_MASK0x7
+# define DP_TEST_COUNT_MASK0xf
  
  #define DP_TEST_RESPONSE		0x260

  # define DP_TEST_ACK  (1  0)


--
regards,
Sivakumar

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [RFC 5/9] drm/i915: Add per context timelines to fence object

2015-07-23 Thread Tvrtko Ursulin


Hi,

On 07/17/2015 03:31 PM, john.c.harri...@intel.com wrote:

From: John Harrison john.c.harri...@intel.com

The fence object used inside the request structure requires a sequence number.
Although this is not used by the i915 driver itself, it could potentially be
used by non-i915 code if the fence is passed outside of the driver. This is the
intention as it allows external kernel drivers and user applications to wait on
batch buffer completion asynchronously via the dma-buff fence API.

To ensure that such external users are not confused by strange things happening
with the seqno, this patch adds in a per context timeline that can provide a
guaranteed in-order seqno value for the fence. This is safe because the
scheduler will not re-order batch buffers within a context - they are considered
to be mutually dependent.

[new patch in series]

For: VIZ-5190
Signed-off-by: John Harrison john.c.harri...@intel.com
---
  drivers/gpu/drm/i915/i915_drv.h | 25 
  drivers/gpu/drm/i915/i915_gem.c | 69 ++---
  drivers/gpu/drm/i915/i915_gem_context.c | 15 ++-
  drivers/gpu/drm/i915/intel_lrc.c|  8 
  drivers/gpu/drm/i915/intel_ringbuffer.h |  1 -
  5 files changed, 103 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0c7df46..88a4746 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -840,6 +840,15 @@ struct i915_ctx_hang_stats {
bool banned;
  };

+struct i915_fence_timeline {
+   unsignedfence_context;
+   uint32_tcontext;


Unused field?


+   uint32_tnext;


fence.h defines seqnos as 'unsigned', which matches this in practice, 
but maybe it would be nicer to use the same type name.



+
+   struct intel_context *ctx;
+   struct intel_engine_cs *ring;
+};
+
  /* This must match up with the value previously used for execbuf2.rsvd1. */
  #define DEFAULT_CONTEXT_HANDLE 0

@@ -885,6 +894,7 @@ struct intel_context {
struct drm_i915_gem_object *state;
struct intel_ringbuffer *ringbuf;
int pin_count;
+   struct i915_fence_timeline fence_timeline;
} engine[I915_NUM_RINGS];

struct list_head link;
@@ -2153,13 +2163,10 @@ void i915_gem_track_fb(struct drm_i915_gem_object *old,
  struct drm_i915_gem_request {
/**
 * Underlying object for implementing the signal/wait stuff.
-* NB: Never call fence_later() or return this fence object to user
-* land! Due to lazy allocation, scheduler re-ordering, pre-emption,
-* etc., there is no guarantee at all about the validity or
-* sequentiality of the fence's seqno! It is also unsafe to let
-* anything outside of the i915 driver get hold of the fence object
-* as the clean up when decrementing the reference count requires
-* holding the driver mutex lock.
+* NB: Never return this fence object to user land! It is unsafe to
+* let anything outside of the i915 driver get hold of the fence
+* object as the clean up when decrementing the reference count
+* requires holding the driver mutex lock.
 */
struct fence fence;

@@ -2239,6 +2246,10 @@ int i915_gem_request_alloc(struct intel_engine_cs *ring,
   struct drm_i915_gem_request **req_out);
  void i915_gem_request_cancel(struct drm_i915_gem_request *req);

+int i915_create_fence_timeline(struct drm_device *dev,
+  struct intel_context *ctx,
+  struct intel_engine_cs *ring);
+
  static inline bool i915_gem_request_completed(struct drm_i915_gem_request 
*req)
  {
return fence_is_signaled(req-fence);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3970250..af79716 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2671,6 +2671,25 @@ static bool i915_gem_request_is_completed(struct fence 
*req_fence)
return i915_seqno_passed(seqno, req-seqno);
  }

+static void i915_fence_timeline_value_str(struct fence *fence, char *str, int 
size)
+{
+   struct drm_i915_gem_request *req;
+
+   req = container_of(fence, typeof(*req), fence);
+
+   /* Last signalled timeline value ??? */
+   snprintf(str, size, ? [%d]/*, tl-value*/, 
req-ring-get_seqno(req-ring, true));
+}


If timelines are per context now maybe we should update 
i915_gem_request_get_timeline_name to be per context instead of per 
engine as well? Like this we have a name space overlap / seqno 
collisions from userspace point of view.



+static void i915_fence_value_str(struct fence *fence, char *str, int size)
+{
+   struct drm_i915_gem_request *req;
+
+   req = container_of(fence, typeof(*req), fence);
+
+   snprintf(str, size, %d [%d], req-fence.seqno, req-seqno);
+}
+
  static const struct 

Re: [Intel-gfx] [RFC 6/9] drm/i915: Delay the freeing of requests until retire time

2015-07-23 Thread Tvrtko Ursulin


Hi,

On 07/17/2015 03:31 PM, john.c.harri...@intel.com wrote:

From: John Harrison john.c.harri...@intel.com

The request structure is reference counted. When the count reached
zero, the request was immediately freed and all associated objects
were unrefereced/unallocated. This meant that the driver mutex lock
must be held at the point where the count reaches zero. This was fine
while all references were held internally to the driver. However, the
plan is to allow the underlying fence object (and hence the request
itself) to be returned to other drivers and to userland. External
users cannot be expected to acquire a driver private mutex lock.

Rather than attempt to disentangle the request structure from the
driver mutex lock, the decsion was to defer the free code until a
later (safer) point. Hence this patch changes the unreference callback
to merely move the request onto a delayed free list. The driver's
retire worker thread will then process the list and actually call the
free function on the requests.

[new patch in series]

For: VIZ-5190
Signed-off-by: John Harrison john.c.harri...@intel.com
---
  drivers/gpu/drm/i915/i915_drv.h | 22 +++---
  drivers/gpu/drm/i915/i915_gem.c | 41 +
  drivers/gpu/drm/i915/intel_display.c|  2 +-
  drivers/gpu/drm/i915/intel_lrc.c|  2 ++
  drivers/gpu/drm/i915/intel_pm.c |  2 +-
  drivers/gpu/drm/i915/intel_ringbuffer.c |  2 ++
  drivers/gpu/drm/i915/intel_ringbuffer.h |  4 
  7 files changed, 50 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 88a4746..61c3db2 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2161,14 +2161,9 @@ void i915_gem_track_fb(struct drm_i915_gem_object *old,
   * initial reference taken using kref_init
   */
  struct drm_i915_gem_request {
-   /**
-* Underlying object for implementing the signal/wait stuff.
-* NB: Never return this fence object to user land! It is unsafe to
-* let anything outside of the i915 driver get hold of the fence
-* object as the clean up when decrementing the reference count
-* requires holding the driver mutex lock.
-*/
+   /** Underlying object for implementing the signal/wait stuff. */
struct fence fence;
+   struct list_head delay_free_list;


Maybe call this delay_free_link to continue the established convention.



/** On Which ring this request was generated */
struct drm_i915_private *i915;
@@ -2281,21 +2276,10 @@ i915_gem_request_reference(struct drm_i915_gem_request 
*req)
  static inline void
  i915_gem_request_unreference(struct drm_i915_gem_request *req)
  {
-   WARN_ON(!mutex_is_locked(req-ring-dev-struct_mutex));
-   fence_put(req-fence);
-}
-
-static inline void
-i915_gem_request_unreference__unlocked(struct drm_i915_gem_request *req)
-{
-   struct drm_device *dev;
-
if (!req)
return;

-   dev = req-ring-dev;
-   if (kref_put_mutex(req-fence.refcount, fence_release, 
dev-struct_mutex))
-   mutex_unlock(dev-struct_mutex);
+   fence_put(req-fence);
  }

  static inline void i915_gem_request_assign(struct drm_i915_gem_request **pdst,
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index af79716..482835a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2616,10 +2616,27 @@ static void i915_set_reset_status(struct 
drm_i915_private *dev_priv,
}
  }

-static void i915_gem_request_free(struct fence *req_fence)
+static void i915_gem_request_release(struct fence *req_fence)
  {
struct drm_i915_gem_request *req = container_of(req_fence,
 typeof(*req), fence);
+   struct intel_engine_cs *ring = req-ring;
+   struct drm_i915_private *dev_priv = to_i915(ring-dev);
+   unsigned long flags;
+
+   /*
+* Need to add the request to a deferred dereference list to be
+* processed at a mutex lock safe time.
+*/
+   spin_lock_irqsave(ring-delayed_free_lock, flags);


At the moment there is no request unreferencing from irq handlers right? 
Unless (or until) you plan to add that you could use simple spin_lock 
here. (And in the i915_gem_retire_requests_ring.)



+   list_add_tail(req-delay_free_list, ring-delayed_free_list);
+   spin_unlock_irqrestore(ring-delayed_free_lock, flags);
+
+   queue_delayed_work(dev_priv-wq, dev_priv-mm.retire_work, 0);


Have you decided to re-use the retire worker just for convenience of for 
some other reason as well?


I found it a bit unexpected and though dedicated request free worker 
would be cleaner, but I don't know, not a strong opinion.



+}
+
+static void i915_gem_request_free(struct drm_i915_gem_request *req)
+{
struct intel_context *ctx = req-ctx;


[Intel-gfx] [PATCH v2] drm/i915: load driver even if debugfs fails

2015-07-23 Thread Sudip Mukherjee
debugfs files are not necessary for the usual operation of the driver
and the device. No need to check for the return values from the debugfs
file creation. Even if one debugfs file fails to create we try with the
next debugfs file and ultimately return success always so that the
driver continues to load.
cleanup will clean all the created debugfs files as the list of file
that are created are maintained in minor-debugfs_list.

Cc: Chris Wilson ch...@chris-wilson.co.uk
Signed-off-by: Sudip Mukherjee su...@vectorindia.org
---

v1 was drm/i915: add error path

 drivers/gpu/drm/i915/i915_debugfs.c | 31 ---
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index caf1382..8b1a42a 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -5138,29 +5138,22 @@ void intel_display_crc_init(struct drm_device *dev)
 
 int i915_debugfs_init(struct drm_minor *minor)
 {
-   int ret, i;
+   int i;
 
-   ret = i915_forcewake_create(minor-debugfs_root, minor);
-   if (ret)
-   return ret;
+   i915_forcewake_create(minor-debugfs_root, minor);
 
-   for (i = 0; i  ARRAY_SIZE(i915_pipe_crc_data); i++) {
-   ret = i915_pipe_crc_create(minor-debugfs_root, minor, i);
-   if (ret)
-   return ret;
-   }
+   for (i = 0; i  ARRAY_SIZE(i915_pipe_crc_data); i++)
+   i915_pipe_crc_create(minor-debugfs_root, minor, i);
 
-   for (i = 0; i  ARRAY_SIZE(i915_debugfs_files); i++) {
-   ret = i915_debugfs_create(minor-debugfs_root, minor,
- i915_debugfs_files[i].name,
- i915_debugfs_files[i].fops);
-   if (ret)
-   return ret;
-   }
+   for (i = 0; i  ARRAY_SIZE(i915_debugfs_files); i++)
+   i915_debugfs_create(minor-debugfs_root, minor,
+   i915_debugfs_files[i].name,
+   i915_debugfs_files[i].fops);
+
+   drm_debugfs_create_files(i915_debugfs_list, I915_DEBUGFS_ENTRIES,
+minor-debugfs_root, minor);
 
-   return drm_debugfs_create_files(i915_debugfs_list,
-   I915_DEBUGFS_ENTRIES,
-   minor-debugfs_root, minor);
+   return 0;
 }
 
 void i915_debugfs_cleanup(struct drm_minor *minor)
-- 
1.8.1.2

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/4] drm/i915: Add audio hotplug info struct

2015-07-23 Thread David Henningsson



On 2015-07-23 08:17, David Henningsson wrote:

I'm about to go on vacation so it would be good to get some closure
here. If you both prefer this setup, how about I remove struct
i915_audio_hotplug_info for now? We will then have:

 const struct i915_audio_component_audio_ops {
 void (*hotplug_notify)(struct hdac_bus *);
 }


Sorry, it would look like this:

  const struct i915_audio_component_audio_ops {
  void (*hotplug_notify)(struct hdac_bus *, int port, int 
port_mst_index);

  }

...to indicate what port needs updating.


--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/4] drm/i915: Add audio hotplug info struct

2015-07-23 Thread David Henningsson



On 2015-07-22 22:31, Takashi Iwai wrote:

On Wed, 22 Jul 2015 19:52:23 +0200,
David Henningsson wrote:




On 2015-07-22 16:13, Vinod Koul wrote:

On Wed, Jul 22, 2015 at 10:55:55AM +0200, Takashi Iwai wrote:

On Wed, 22 Jul 2015 10:50:03 +0200,
David Henningsson wrote:



struct i915_audio_component {
struct device *dev;
+   struct hdac_bus *hdac_bus;


If we want to be more generic, using a struct device would be better,
e.g.
struct device *audio_dev;


Does this work? If we want to have the hdac_bus.dev ptr instead of a
hdac_bus ptr, there does not seem to be an obvious way to go from the
audio_dev back to the hdac_bus struct (as snd_hdac_bus_init takes an
arbitrary dev pointer).


Hrm, right, currently it's not straightforward.  Scratch the idea,
then.


That depends on the device we register this with. Actually this makes more
sense to me :)

If we register with struct device *audio_dev, which in this case would be
the codec device we create while probing the bus. This way you are linking i915
ops to the codec device. Ofcourse hdac_device has bus pointer but you can
invoke device callback without even searching for the device :)


It would require some extra setup, so I skipped it (at least for now).

I e, in order to detect codecs, we need to call hdac_i915 functions to
turn the power well on. And in order to connect the codec to the
i915_audio_component, we need to have detected a codec.

Which, now that I think of it, actually gives an interesting potential
race condition, in case the following happens:

1) Monitor is plugged in at boot time
2) i915 initializes
3) hda starts initializing and sets up the audio component
4) i915 finishes initialization and as part of that, calls the hotplug
notify to let hda know that the monitor is plugged in. However, at this
point, hda has not finished initialization yet, so there are no codecs
that listen for this information.

Anyhow, this is not a problem really yet, but it might be if we ever
decide to not write the ELD to the hardware.


For avoid such a problem, maybe we need two ops, one for notification
and one for getting the assigned data.  At the initialization time,
the audio driver queries the assigned status and data.  When a hotplug
happens, it's just notified.  That is, it simply replaces the current
unsol event and the ELD data read via two ops.


I'm about to go on vacation so it would be good to get some closure 
here. If you both prefer this setup, how about I remove struct 
i915_audio_hotplug_info for now? We will then have:


const struct i915_audio_component_audio_ops {
void (*hotplug_notify)(struct hdac_bus *);
}

...which will make the hda driver read from the hardware. Asking the 
i915 driver for ELD, connector and hotplug status can then be done in a 
later patch.


--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 2/4] drm/i915: Call audio hotplug notify function

2015-07-23 Thread David Henningsson
On HDMI hotplug events, notify the audio driver. This will enable
the audio driver to get the notification at all times (even when
audio is in different powersave states).

Signed-off-by: David Henningsson david.hennings...@canonical.com
---
 drivers/gpu/drm/i915/i915_drv.h|1 +
 drivers/gpu/drm/i915/intel_audio.c |   23 ---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 542fac6..696624c 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1808,6 +1808,7 @@ struct drm_i915_private {
struct drm_property *force_audio_property;
 
/* hda/i915 audio component */
+   struct i915_audio_component *audio_component;
bool audio_component_registered;
 
uint32_t hw_context_size;
diff --git a/drivers/gpu/drm/i915/intel_audio.c 
b/drivers/gpu/drm/i915/intel_audio.c
index 3da9b84..3cc8849 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -399,6 +399,9 @@ void intel_audio_codec_enable(struct intel_encoder 
*intel_encoder)
struct drm_connector *connector;
struct drm_device *dev = encoder-dev;
struct drm_i915_private *dev_priv = dev-dev_private;
+   struct i915_audio_component *acomp = dev_priv-audio_component;
+   struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
+   enum port port = intel_dig_port-port;
 
connector = drm_select_eld(encoder, mode);
if (!connector)
@@ -419,6 +422,9 @@ void intel_audio_codec_enable(struct intel_encoder 
*intel_encoder)
 
if (dev_priv-display.audio_codec_enable)
dev_priv-display.audio_codec_enable(connector, intel_encoder, 
mode);
+
+   if (acomp  acomp-audio_ops  acomp-audio_ops-hotplug_notify)
+   acomp-audio_ops-hotplug_notify(acomp-audio_ptr, (int) port, 
0);
 }
 
 /**
@@ -428,13 +434,20 @@ void intel_audio_codec_enable(struct intel_encoder 
*intel_encoder)
  * The disable sequences must be performed before disabling the transcoder or
  * port.
  */
-void intel_audio_codec_disable(struct intel_encoder *encoder)
+void intel_audio_codec_disable(struct intel_encoder *intel_encoder)
 {
-   struct drm_device *dev = encoder-base.dev;
+   struct drm_encoder *encoder = intel_encoder-base;
+   struct drm_device *dev = encoder-dev;
struct drm_i915_private *dev_priv = dev-dev_private;
+   struct i915_audio_component *acomp = dev_priv-audio_component;
+   struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
+   enum port port = intel_dig_port-port;
 
if (dev_priv-display.audio_codec_disable)
-   dev_priv-display.audio_codec_disable(encoder);
+   dev_priv-display.audio_codec_disable(intel_encoder);
+
+   if (acomp  acomp-audio_ops  acomp-audio_ops-hotplug_notify)
+   acomp-audio_ops-hotplug_notify(acomp-audio_ptr, (int) port, 
0);
 }
 
 /**
@@ -525,12 +538,14 @@ static int i915_audio_component_bind(struct device 
*i915_dev,
 struct device *hda_dev, void *data)
 {
struct i915_audio_component *acomp = data;
+   struct drm_i915_private *dev_priv = dev_to_i915(i915_dev);
 
if (WARN_ON(acomp-ops || acomp-dev))
return -EEXIST;
 
acomp-ops = i915_audio_component_ops;
acomp-dev = i915_dev;
+   dev_priv-audio_component = acomp;
 
return 0;
 }
@@ -539,9 +554,11 @@ static void i915_audio_component_unbind(struct device 
*i915_dev,
struct device *hda_dev, void *data)
 {
struct i915_audio_component *acomp = data;
+   struct drm_i915_private *dev_priv = dev_to_i915(i915_dev);
 
acomp-ops = NULL;
acomp-dev = NULL;
+   dev_priv-audio_component = NULL;
 }
 
 static const struct component_ops i915_audio_component_bind_ops = {
-- 
1.7.9.5

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 3/4] ALSA: hda - Dispatch incoming HDMI hotplug i915 callback

2015-07-23 Thread David Henningsson
This lets interested codec(s) be notified of HDMI hotplug
events sent from the i915 driver.

Signed-off-by: David Henningsson david.hennings...@canonical.com
---
 include/sound/hdaudio.h |4 
 sound/hda/hdac_i915.c   |   23 +++
 2 files changed, 27 insertions(+)

diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index 4caf1fd..8142d03 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -79,6 +79,10 @@ struct hdac_device {
int (*exec_verb)(struct hdac_device *dev, unsigned int cmd,
 unsigned int flags, unsigned int *res);
 
+   /* Used for hotplug notification from i915 driver */
+   void (*i915_hotplug_notify)(struct hdac_device *, int port,
+   int port_mst_index);
+
/* widgets */
unsigned int num_nodes;
hda_nid_t start_nid, end_nid;
diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c
index 5676b84..17295c2 100644
--- a/sound/hda/hdac_i915.c
+++ b/sound/hda/hdac_i915.c
@@ -118,6 +118,8 @@ static void hdac_component_master_unbind(struct device *dev)
 {
struct i915_audio_component *acomp = hdac_acomp;
 
+   acomp-audio_ops = NULL;
+   acomp-audio_ptr = NULL;
module_put(acomp-ops-owner);
component_unbind_all(dev, acomp);
WARN_ON(acomp-ops || acomp-dev);
@@ -128,6 +130,24 @@ static const struct component_master_ops 
hdac_component_master_ops = {
.unbind = hdac_component_master_unbind,
 };
 
+static void i915_audio_component_hotplug_notify(void *audio_ptr,
+   int port, int port_mst_index)
+{
+   struct hdac_device *d;
+   struct hdac_bus *bus = audio_ptr;
+
+   dev_dbg(bus-dev, i915 hotplug event (port = %d:%d),
+   port, port_mst_index);
+
+   list_for_each_entry(d, bus-codec_list, list)
+   if (d-i915_hotplug_notify)
+   d-i915_hotplug_notify(d, port, port_mst_index);
+}
+
+static const struct i915_audio_component_audio_ops 
i915_audio_component_audio_ops = {
+   .hotplug_notify = i915_audio_component_hotplug_notify,
+};
+
 static int hdac_component_master_match(struct device *dev, void *data)
 {
/* i915 is the only supported component */
@@ -163,6 +183,9 @@ int snd_hdac_i915_init(struct hdac_bus *bus)
ret = -ENODEV;
goto out_master_del;
}
+   acomp-audio_ops = i915_audio_component_audio_ops;
+   acomp-audio_ptr = bus;
+
dev_dbg(dev, bound to i915 component master\n);
 
return 0;
-- 
1.7.9.5

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 4/4] ALSA: hda - Wake the codec up on hotplug notify events

2015-07-23 Thread David Henningsson
Whenever there is an event from the i915 driver, wake the codec
and recheck plug/unplug + ELD status.

This fixes the issue with lost unsol events in power save mode,
the codec and controller can now sleep in D3 and still know when
the HDMI monitor has been connected.

Signed-off-by: David Henningsson david.hennings...@canonical.com
---
 sound/pci/hda/patch_hdmi.c |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 2f24338..6cc1524 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2316,6 +2316,15 @@ static void haswell_set_power_state(struct hda_codec 
*codec, hda_nid_t fg,
snd_hda_codec_set_power_to_all(codec, fg, power_state);
 }
 
+static void intel_hotplug_notify(struct hdac_device *dev, int port,
+int port_mst_index)
+{
+   struct hda_codec *codec = container_of(dev, struct hda_codec, core);
+   int pin_nid = is_valleyview(codec) ? 0x03 : port + 0x04;
+
+   check_presence_and_report(codec, pin_nid);
+}
+
 static int patch_generic_hdmi(struct hda_codec *codec)
 {
struct hdmi_spec *spec;
@@ -2342,8 +2351,10 @@ static int patch_generic_hdmi(struct hda_codec *codec)
if (is_valleyview_plus(codec) || is_skylake(codec))
codec-core.link_power_control = 1;
 
-   if (is_haswell_plus(codec) || is_valleyview_plus(codec))
+   if (is_haswell_plus(codec) || is_valleyview_plus(codec)) {
codec-depop_delay = 0;
+   codec-core.i915_hotplug_notify = intel_hotplug_notify;
+   }
 
if (hdmi_parse_codec(codec)  0) {
codec-spec = NULL;
-- 
1.7.9.5

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH v3 0/4] i915 to call hda driver on HDMI plug/unplug

2015-07-23 Thread David Henningsson
Changes since v2 is that the patch set has diminished to not transfer
connector/eld information, since it might be better that such information
to be transferred by a separate call in the ordinary direction. That
could be added in a later patch set.

The audio_ptr is now a void* (instead of a hdac_bus*) so that the audio
side can easily refactor the ptr to point to the codec instead of the bus
if we would find that beneficial.

David Henningsson (4):
  drm/i915: Add audio hotplug info callback
  drm/i915: Call audio hotplug notify function
  ALSA: hda - Dispatch incoming HDMI hotplug i915 callback
  ALSA: hda - Wake the codec up on hotplug notify events

 drivers/gpu/drm/i915/i915_drv.h|1 +
 drivers/gpu/drm/i915/intel_audio.c |   23 ---
 include/drm/i915_component.h   |5 +
 include/sound/hdaudio.h|4 
 sound/hda/hdac_i915.c  |   23 +++
 sound/pci/hda/patch_hdmi.c |   13 -
 6 files changed, 65 insertions(+), 4 deletions(-)

-- 
1.7.9.5

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/4] drm/i915: Add audio hotplug info callback

2015-07-23 Thread David Henningsson
This callback will be called by the i915 driver to notify the hda
driver that HDMI has been hotplugged.

Signed-off-by: David Henningsson david.hennings...@canonical.com
---
 include/drm/i915_component.h |5 +
 1 file changed, 5 insertions(+)

diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h
index c9a8b64..d053008 100644
--- a/include/drm/i915_component.h
+++ b/include/drm/i915_component.h
@@ -26,6 +26,7 @@
 
 struct i915_audio_component {
struct device *dev;
+   void *audio_ptr;
 
const struct i915_audio_component_ops {
struct module *owner;
@@ -34,6 +35,10 @@ struct i915_audio_component {
void (*codec_wake_override)(struct device *, bool enable);
int (*get_cdclk_freq)(struct device *);
} *ops;
+
+   const struct i915_audio_component_audio_ops {
+   void (*hotplug_notify)(void *audio_ptr, int port, int 
port_mst_index);
+   } *audio_ops;
 };
 
 #endif /* _I915_COMPONENT_H_ */
-- 
1.7.9.5

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/6] drm/i915: Set csc coefficients in update_pipe_size.

2015-07-23 Thread Ander Conselvan De Oliveira
On Tue, 2015-07-21 at 13:28 +0200, Maarten Lankhorst wrote:
This might not have been set during boot, and when we preserve
the initial mode this can result in a black screen.


Cc: Daniel Stone dani...@collabora.com
Signed-off-by: Maarten Lankhorst maarten.lankho...@linux.intel.com
---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)


diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index def9444eeae2..443328033981 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3277,6 +3277,9 @@ static void intel_update_pipe_size(struct intel_crtc 
*crtc)
if (!i915.fastboot)
return;
 
+   if (HAS_DDI(dev))
+   intel_set_pipe_csc(crtc-base);
+
/*
 * Update pipe size and adjust fitter if needed: the reason for this is
 * that in compute_mode_changes we check the native mode (not the pfit

Reviewed-by: Ander Conselvan de Oliveira conselv...@gmail.com
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 4/4] drm/doc: Convert to markdown

2015-07-23 Thread Danilo Cesar Lemes de Paula
DRM Docbook is now Markdown ready. This means its doc is able to
use markdown text on it.

* Documentation/DocBook/drm.tmpl: Contains a table duplicated from
  drivers/gpu/drm/i915/i915_reg.h. This is not needed anymore

* drivers/gpu/drm/drm_modeset_lock.c: had a code example that used
  to look pretty bad on html. Fixed by using proper code markup.

* drivers/gpu/drm/drm_prime.c: Remove spaces between lines to make
  a proper markup list.

* drivers/gpu/drm/i915/i915_reg.h: Altought pandoc supports tables,
  it doesn't support table cell spanning. But we can use fixed-width
  for those special cases.

* include/drm/drm_vma_manager.h: Another code example that should be
  proper indented with four spaces.

Signed-off-by: Danilo Cesar Lemes de Paula danilo.ce...@collabora.co.uk
Cc: Randy Dunlap rdun...@infradead.org
Cc: Daniel Vetter daniel.vet...@ffwll.ch
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Jonathan Corbet cor...@lwn.net
Cc: Herbert Xu herb...@gondor.apana.org.au
Cc: Stephan Mueller smuel...@chronox.de
Cc: Michal Marek mma...@suse.cz
Cc: linux-ker...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: intel-gfx intel-gfx@lists.freedesktop.org
Cc: dri-devel dri-de...@lists.freedesktop.org
---
 Documentation/DocBook/Makefile |  2 +-
 Documentation/DocBook/drm.tmpl | 86 --
 drivers/gpu/drm/drm_modeset_lock.c | 14 +++
 drivers/gpu/drm/drm_prime.c| 16 +++
 drivers/gpu/drm/i915/i915_reg.h| 48 ++---
 include/drm/drm_vma_manager.h  | 10 ++---
 6 files changed, 42 insertions(+), 134 deletions(-)

diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 7c404b3..702e812 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -17,7 +17,7 @@ DOCBOOKS := z8530book.xml device-drivers.xml \
tracepoint.xml drm.xml media_api.xml w1.xml \
writing_musb_glue_layer.xml crypto-API.xml
 
-MARKDOWNREADY := 
+MARKDOWNREADY := drm.xml
 
 include Documentation/DocBook/media/Makefile
 
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index 2fb9a54..4fb4636 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -4073,92 +4073,6 @@ int num_ioctls;/synopsis
   sect2
 titleDPIO/title
 !Pdrivers/gpu/drm/i915/i915_reg.h DPIO
-   table id=dpiox2
- titleDual channel PHY (VLV/CHV/BXT)/title
- tgroup cols=8
-   colspec colname=c0 /
-   colspec colname=c1 /
-   colspec colname=c2 /
-   colspec colname=c3 /
-   colspec colname=c4 /
-   colspec colname=c5 /
-   colspec colname=c6 /
-   colspec colname=c7 /
-   spanspec spanname=ch0 namest=c0 nameend=c3 /
-   spanspec spanname=ch1 namest=c4 nameend=c7 /
-   spanspec spanname=ch0pcs01 namest=c0 nameend=c1 /
-   spanspec spanname=ch0pcs23 namest=c2 nameend=c3 /
-   spanspec spanname=ch1pcs01 namest=c4 nameend=c5 /
-   spanspec spanname=ch1pcs23 namest=c6 nameend=c7 /
-   thead
- row
-   entry spanname=ch0CH0/entry
-   entry spanname=ch1CH1/entry
- /row
-   /thead
-   tbody valign=top align=center
- row
-   entry spanname=ch0CMN/PLL/REF/entry
-   entry spanname=ch1CMN/PLL/REF/entry
- /row
- row
-   entry spanname=ch0pcs01PCS01/entry
-   entry spanname=ch0pcs23PCS23/entry
-   entry spanname=ch1pcs01PCS01/entry
-   entry spanname=ch1pcs23PCS23/entry
- /row
- row
-   entryTX0/entry
-   entryTX1/entry
-   entryTX2/entry
-   entryTX3/entry
-   entryTX0/entry
-   entryTX1/entry
-   entryTX2/entry
-   entryTX3/entry
- /row
- row
-   entry spanname=ch0DDI0/entry
-   entry spanname=ch1DDI1/entry
- /row
-   /tbody
- /tgroup
-   /table
-   table id=dpiox1
- titleSingle channel PHY (CHV/BXT)/title
- tgroup cols=4
-   colspec colname=c0 /
-   colspec colname=c1 /
-   colspec colname=c2 /
-   colspec colname=c3 /
-   spanspec spanname=ch0 namest=c0 nameend=c3 /
-   spanspec spanname=ch0pcs01 namest=c0 nameend=c1 /
-   spanspec spanname=ch0pcs23 namest=c2 nameend=c3 /
-   thead
- row
-   entry spanname=ch0CH0/entry
- /row
-   /thead
-   tbody valign=top align=center
- row
-   entry spanname=ch0CMN/PLL/REF/entry
- /row
- row
-   entry spanname=ch0pcs01PCS01/entry
-   entry spanname=ch0pcs23PCS23/entry
- /row
- row
-   

[Intel-gfx] [PATCH 3/4] scripts/kernel-doc: Adding infrastructure for markdown support

2015-07-23 Thread Danilo Cesar Lemes de Paula
Markdown support is given by calling an external tool, pandoc, for all
highlighted text on kernel-doc.

Pandoc converts Markdown text to proper Docbook tags, which will be
later translated to pdf, html or other targets.

This adds the capability of adding human-readle text highlight (bold,
underline, etc), bullet and numbered lists, simple tables, fixed-width
text (including asciiart), requiring minimal changes to current documentation.

At this moment, pandoc is totally optional. Docbooks ready for markdown
should be added to the MARKDOWNREADY variable inside the Makefile. In
case the developer doesn't have pandoc installed, Make will throw a
warning and the documentation build will continue, generating
simple Documentation without the features brought by pandoc.

Signed-off-by: Danilo Cesar Lemes de Paula danilo.ce...@collabora.co.uk
Cc: Randy Dunlap rdun...@infradead.org
Cc: Daniel Vetter daniel.vet...@ffwll.ch
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Jonathan Corbet cor...@lwn.net
Cc: Herbert Xu herb...@gondor.apana.org.au
Cc: Stephan Mueller smuel...@chronox.de
Cc: Michal Marek mma...@suse.cz
Cc: linux-ker...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: intel-gfx intel-gfx@lists.freedesktop.org
Cc: dri-devel dri-de...@lists.freedesktop.org
---
 Documentation/DocBook/Makefile | 25 +++-
 scripts/docproc.c  | 49 +--
 scripts/kernel-doc | 66 --
 3 files changed, 115 insertions(+), 25 deletions(-)

diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 322255b..7c404b3 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -17,6 +17,8 @@ DOCBOOKS := z8530book.xml device-drivers.xml \
tracepoint.xml drm.xml media_api.xml w1.xml \
writing_musb_glue_layer.xml crypto-API.xml
 
+MARKDOWNREADY := 
+
 include Documentation/DocBook/media/Makefile
 
 ###
@@ -79,18 +81,23 @@ XMLTOFLAGS += --skip-validation
 # The following rules are used to generate the .xml documentation
 # required to generate the final targets. (ps, pdf, html).
 quiet_cmd_docproc = DOCPROC $@
-  cmd_docproc = SRCTREE=$(srctree)/ $(DOCPROC) doc $ $@
+  cmd_docproc = SRCTREE=$(srctree)/ $(DOCPROC) doc $ $$USEMARKDOWN $@
 define rule_docproc
-   set -e; \
-$(if $($(quiet)cmd_$(1)),echo '  $($(quiet)cmd_$(1))';)\
-$(cmd_$(1));   \
-(  \
-  echo 'cmd_$@ := $(cmd_$(1))';\
-  echo $@: `SRCTREE=$(srctree) $(DOCPROC) depend $`;  \
+   set -e; 
\
+   USEMARKDOWN=; 
\
+   FILE=`basename $@`; 
\
+   [[ $(MARKDOWNREADY) =~ $${FILE} ]]  USEMARKDOWN=-use-markdown;  
\
+$(if $($(quiet)cmd_$(1)),echo '  $($(quiet)cmd_$(1))';)
\
+$(cmd_$(1));   
\
+(  
\
+  echo 'cmd_$@ := $(cmd_$(1))';
\
+  echo $@: `SRCTREE=$(srctree) $(DOCPROC) depend $`;  
\
 )  $(dir $@).$(notdir $@).cmd
 endef
 
 %.xml: %.tmpl $(KERNELDOC) $(DOCPROC) $(KERNELDOCXMLREF) FORCE
+   @(which pandoc  /dev/null 21) || \
+   (echo *** To get propper documentation you need to install pandoc 
***;)
$(call if_changed_rule,docproc)
 
 # Tell kbuild to always build the programs
@@ -101,6 +108,10 @@ notfoundtemplate = echo *** You have to install 
docbook-utils or xmlto ***; \
 db2xtemplate = db2TYPE -o $(dir $@) $
 xmltotemplate = xmlto TYPE $(XMLTOFLAGS) -o $(dir $@) $
 
+ifneq ($(shell which pandoc /dev/null 21  echo found),found)
+   MARKDOWNREADY := ;
+endif
+
 # determine which methods are available
 ifeq ($(shell which db2ps /dev/null 21  echo found),found)
use-db2x = db2x
diff --git a/scripts/docproc.c b/scripts/docproc.c
index e267e621..45140b2 100644
--- a/scripts/docproc.c
+++ b/scripts/docproc.c
@@ -73,12 +73,15 @@ FILELINE * docsection;
 #define NOFUNCTION-nofunction
 #define NODOCSECTIONS -no-doc-sections
 #define SHOWNOTFOUND  -show-not-found
+#define USEMARKDOWN   -use-markdown
 
 static char *srctree, *kernsrctree;
 
 static char **all_list = NULL;
 static int all_list_len = 0;
 
+static int use_markdown = 0;
+
 static void consume_symbol(const char *sym)
 {
int i;
@@ -95,10 +98,11 @@ static void consume_symbol(const char *sym)
 
 static void usage (void)
 {
-   fprintf(stderr, Usage: docproc {doc|depend} file\n);
+   fprintf(stderr, Usage: docproc 

[Intel-gfx] [PATCH 1/4] scripts/kernel-doc: Adding cross-reference links to html documentation.

2015-07-23 Thread Danilo Cesar Lemes de Paula
Functions, Structs and Parameters definitions on kernel documentation
are pure cosmetic, it only highlights the element.

To ease the navigation in the documentation we should use links inside
those tags so readers can easily jump between methods directly.

This was discussed in 2014[1] and is implemented by getting a list
of refentries from the DocBook XML to generate a database. Then it looks
for function,structnames and paramdef tags that matches the ones in
the database. As it only links existent references, no broken links are
added.

[1] - lists.freedesktop.org/archives/dri-devel/2014-August/065404.html

Signed-off-by: Danilo Cesar Lemes de Paula danilo.ce...@collabora.co.uk
Cc: Randy Dunlap rdun...@infradead.org
Cc: Daniel Vetter daniel.vet...@ffwll.ch
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Jonathan Corbet cor...@lwn.net
Cc: Herbert Xu herb...@gondor.apana.org.au
Cc: Stephan Mueller smuel...@chronox.de
Cc: Michal Marek mma...@suse.cz
Cc: linux-ker...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: intel-gfx intel-gfx@lists.freedesktop.org
Cc: dri-devel dri-de...@lists.freedesktop.org
---
 Documentation/DocBook/Makefile |  43 ++---
 scripts/kernel-doc-xml-ref | 198 +
 2 files changed, 228 insertions(+), 13 deletions(-)
 create mode 100755 scripts/kernel-doc-xml-ref

diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index b6a6a2e..322255b 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -64,8 +64,9 @@ installmandocs: mandocs
 
 ###
 #External programs used
-KERNELDOC = $(srctree)/scripts/kernel-doc
-DOCPROC   = $(objtree)/scripts/docproc
+KERNELDOCXMLREF = $(srctree)/scripts/kernel-doc-xml-ref
+KERNELDOC   = $(srctree)/scripts/kernel-doc
+DOCPROC = $(objtree)/scripts/docproc
 
 XMLTOFLAGS = -m $(srctree)/$(src)/stylesheet.xsl
 XMLTOFLAGS += --skip-validation
@@ -89,7 +90,7 @@ define rule_docproc
 )  $(dir $@).$(notdir $@).cmd
 endef
 
-%.xml: %.tmpl $(KERNELDOC) $(DOCPROC) FORCE
+%.xml: %.tmpl $(KERNELDOC) $(DOCPROC) $(KERNELDOCXMLREF) FORCE
$(call if_changed_rule,docproc)
 
 # Tell kbuild to always build the programs
@@ -140,7 +141,20 @@ quiet_cmd_db2html = HTML$@
echo 'a HREF=$(patsubst %.html,%,$(notdir $@))/index.html \
$(patsubst %.html,%,$(notdir $@))/ap'  $@
 
-%.html:%.xml
+###
+# Rules to create an aux XML and .db, and use them to re-process the DocBook 
XML
+# to fill internal hyperlinks
+   gen_aux_xml = :
+ quiet_gen_aux_xml = echo '  XMLREF  $@'
+silent_gen_aux_xml = :
+%.aux.xml: %.xml
+   @$($(quiet)gen_aux_xml)
+   @rm -rf $@
+   @(cat $ | egrep ^refentry id | egrep -o \.*\ | cut -f 2 -d \  
$.db)
+   @$(KERNELDOCXMLREF) -db $.db $  $@
+.PRECIOUS: %.aux.xml
+
+%.html:%.aux.xml
@(which xmlto  /dev/null 21) || \
 (echo *** You need to install xmlto ***; \
  exit 1)
@@ -209,15 +223,18 @@ dochelp:
 ###
 # Temporary files left by various tools
 clean-files := $(DOCBOOKS) \
-   $(patsubst %.xml, %.dvi,  $(DOCBOOKS)) \
-   $(patsubst %.xml, %.aux,  $(DOCBOOKS)) \
-   $(patsubst %.xml, %.tex,  $(DOCBOOKS)) \
-   $(patsubst %.xml, %.log,  $(DOCBOOKS)) \
-   $(patsubst %.xml, %.out,  $(DOCBOOKS)) \
-   $(patsubst %.xml, %.ps,   $(DOCBOOKS)) \
-   $(patsubst %.xml, %.pdf,  $(DOCBOOKS)) \
-   $(patsubst %.xml, %.html, $(DOCBOOKS)) \
-   $(patsubst %.xml, %.9,$(DOCBOOKS)) \
+   $(patsubst %.xml, %.dvi, $(DOCBOOKS)) \
+   $(patsubst %.xml, %.aux, $(DOCBOOKS)) \
+   $(patsubst %.xml, %.tex, $(DOCBOOKS)) \
+   $(patsubst %.xml, %.log, $(DOCBOOKS)) \
+   $(patsubst %.xml, %.out, $(DOCBOOKS)) \
+   $(patsubst %.xml, %.ps,  $(DOCBOOKS)) \
+   $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \
+   $(patsubst %.xml, %.html,$(DOCBOOKS)) \
+   $(patsubst %.xml, %.9,   $(DOCBOOKS)) \
+   $(patsubst %.xml, %.aux.xml, $(DOCBOOKS)) \
+   $(patsubst %.xml, %.xml.db,  $(DOCBOOKS)) \
+   $(patsubst %.xml, %.xml, $(DOCBOOKS)) \
$(index)
 
 clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
diff --git a/scripts/kernel-doc-xml-ref b/scripts/kernel-doc-xml-ref
new file mode 100755
index 000..104a5a5
--- /dev/null
+++ b/scripts/kernel-doc-xml-ref
@@ -0,0 +1,198 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+## Copyright (C) 2015  Intel Corporation ##
+###
+## This software falls under the GNU General Public License. ##
+## Please read the COPYING file for more information ##
+#
+#
+# This software reads a XML file and a list of valid interal
+# references to replace Docbook tags with links.
+#
+# The list of valid internal references must be one-per-line in the 
following format:
+#  API-struct-foo
+#  API-enum-bar
+#  API-my-function

[Intel-gfx] [PATCH 2/4] scripts/kernel-doc: Replacing highlights hash by an array

2015-07-23 Thread Danilo Cesar Lemes de Paula
The highlight code is very sensible to the order of the hash keys,
but the order of the keys cannot be predicted on Perl. It generates
faulty DocBook entries like:
- @functiondevice_for_each_child/function

We should use an array for that job, so we can guarantee that the order
of the regex execution on dohighlight won't change.

Signed-off-by: Danilo Cesar Lemes de Paula danilo.ce...@collabora.co.uk
Cc: Randy Dunlap rdun...@infradead.org
Cc: Daniel Vetter daniel.vet...@ffwll.ch
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Jonathan Corbet cor...@lwn.net
Cc: Herbert Xu herb...@gondor.apana.org.au
Cc: Stephan Mueller smuel...@chronox.de
Cc: Michal Marek mma...@suse.cz
Cc: linux-ker...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: intel-gfx intel-gfx@lists.freedesktop.org
Cc: dri-devel dri-de...@lists.freedesktop.org
---
 scripts/kernel-doc | 104 ++---
 1 file changed, 60 insertions(+), 44 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 9922e66..a38a69a 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -182,59 +182,73 @@ my $type_env = '(\$\w+)';
 #  One for each output format
 
 # these work fairly well
-my %highlights_html = ( $type_constant, i\$1/i,
-   $type_func, b\$1/b,
-   $type_struct_xml, i\$1/i,
-   $type_env, bi\$1/i/b,
-   $type_param, ttb\$1/b/tt );
+my @highlights_html = (
+   [$type_constant, i\$1/i],
+   [$type_func, b\$1/b],
+   [$type_struct_xml, i\$1/i],
+   [$type_env, bi\$1/i/b],
+   [$type_param, ttb\$1/b/tt]
+  );
 my $local_lt = lt:;
 my $local_gt = gt:;
 my $blankline_html = $local_lt . p . $local_gt;  # was p
 
 # html version 5
-my %highlights_html5 = ( $type_constant, span class=\const\\$1/span,
-   $type_func, span class=\func\\$1/span,
-   $type_struct_xml, span class=\struct\\$1/span,
-   $type_env, span class=\env\\$1/span,
-   $type_param, span class=\param\\$1/span );
+my @highlights_html5 = (
+[$type_constant, span class=\const\\$1/span],
+[$type_func, span class=\func\\$1/span],
+[$type_struct_xml, span 
class=\struct\\$1/span],
+[$type_env, span class=\env\\$1/span],
+[$type_param, span class=\param\\$1/span]]
+  );
 my $blankline_html5 = $local_lt . br / . $local_gt;
 
 # XML, docbook format
-my %highlights_xml = ( ([^=])\\\([^\\\]+)\\\, \$1quote\$2/quote,
-   $type_constant, constant\$1/constant,
-   $type_func, function\$1/function,
-   $type_struct_xml, structname\$1/structname,
-   $type_env, envar\$1/envar,
-   $type_param, parameter\$1/parameter );
+my @highlights_xml = (
+  [([^=])\\\([^\\\]+)\\\, \$1quote\$2/quote],
+  [$type_constant, constant\$1/constant],
+  [$type_struct_xml, structname\$1/structname],
+  [$type_param, parameter\$1/parameter],
+  [$type_func, function\$1/function],
+  [$type_env, envar\$1/envar]
+);
 my $blankline_xml = $local_lt . /para . $local_gt . $local_lt . para . 
$local_gt . \n;
 
 # gnome, docbook format
-my %highlights_gnome = ( $type_constant, replaceable 
class=\option\\$1/replaceable,
-$type_func, function\$1/function,
-$type_struct, structname\$1/structname,
-$type_env, envar\$1/envar,
-$type_param, parameter\$1/parameter );
+my @highlights_gnome = (
+[$type_constant, replaceable 
class=\option\\$1/replaceable],
+[$type_func, function\$1/function],
+[$type_struct, structname\$1/structname],
+[$type_env, envar\$1/envar],
+[$type_param, parameter\$1/parameter ]
+  );
 my $blankline_gnome = /parapara\n;
 
 # these are pretty rough
-my %highlights_man = ( $type_constant, \$1,
-  $type_func, fB\$1fP,
-  $type_struct, fI\$1fP,
-  $type_param, fI\$1fP );
+my @highlights_man = (
+  [$type_constant, \$1],
+  [$type_func, fB\$1fP],
+  [$type_struct, fI\$1fP],
+  [$type_param, fI\$1fP]
+);
 my $blankline_man = ;
 
 # text-mode
-my %highlights_text = ( $type_constant, \$1,
-   $type_func, \$1,
-  

[Intel-gfx] [PATCH 0/4] Add support for Hyperlinks and Markup on kernel-doc

2015-07-23 Thread Danilo Cesar Lemes de Paula
This series add supports for hyperlink cross-references on Docbooks and
an optional markup syntax for in-source Documentation.

Danilo Cesar Lemes de Paula (4):
  scripts/kernel-doc: Adding cross-reference links to html
documentation.
  scripts/kernel-doc: Replacing highlights hash by an array
  scripts/kernel-doc: Adding infrastructure for markdown support
  drm/doc: Convert to markdown

 Documentation/DocBook/Makefile |  68 +
 Documentation/DocBook/drm.tmpl |  86 
 drivers/gpu/drm/drm_modeset_lock.c |  14 ++-
 drivers/gpu/drm/drm_prime.c|  16 ++-
 drivers/gpu/drm/i915/i915_reg.h|  48 -
 include/drm/drm_vma_manager.h  |  10 +-
 scripts/docproc.c  |  49 ++---
 scripts/kernel-doc | 170 ++-
 scripts/kernel-doc-xml-ref | 198 +
 9 files changed, 444 insertions(+), 215 deletions(-)
 create mode 100755 scripts/kernel-doc-xml-ref

-- 
2.1.4

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PULL] drm-intel-fixes

2015-07-23 Thread Daniel Vetter
Hi Dave,

arb_timer kernel side fix from Chris.

Cheers, Daniel


The following changes since commit 52721d9d3334c1cb1f76219a161084094ec634dc:

  Linux 4.2-rc3 (2015-07-19 14:45:02 -0700)

are available in the git repository at:

  git://anongit.freedesktop.org/drm-intel tags/drm-intel-fixes-2015-07-23

for you to fetch changes up to 648a9bc5308d952f2c80772301b339f73026f013:

  drm/i915: Use two 32bit reads for select 64bit REG_READ ioctls (2015-07-21 
11:49:13 +0200)


Chris Wilson (1):
  drm/i915: Use two 32bit reads for select 64bit REG_READ ioctls

 drivers/gpu/drm/i915/intel_uncore.c | 26 +++---
 include/uapi/drm/i915_drm.h |  8 
 2 files changed, 27 insertions(+), 7 deletions(-)

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PULL] topic/drm-misc

2015-07-23 Thread Daniel Vetter
Hi Dave,

Update drm-misc pull request since the first one didn't go in yet. Few
atomic helper patches, rejecting some old dri1 crap for modern drivers and
a few trivial things on top.

Cheers, Daniel


The following changes since commit 8b72ce158cf0dba443e36fc66e0bb29c2580e0b6:

  drm: Always enable atomic API (2015-06-24 11:21:35 +1000)

are available in the git repository at:

  git://anongit.freedesktop.org/drm-intel tags/topic/drm-misc-2015-07-23

for you to fetch changes up to f9fe4b9b2ad4f2b801fdff3d634b07c9f9fc4327:

  drm/mgag200: remove unneeded variable (2015-07-17 08:50:45 +0200)


Chad Versace (1):
  drm/fourcc: Add formats R8, RG88, GR88

Daniel Vetter (6):
  drm: Convert drm_legacy_ctxbitmap_init to void return type
  drm: Reject DRI1 hw lock ioctl functions for kms drivers
  drm/crtc-helper: Fixup error handling in drm_helper_crtc_mode_set
  drm: reset empty state in transitional helpers
  drm: Update plane-fb also for page_flip
  drm/gem: rip out drm vma accounting for gem mmaps

Dave Airlie (1):
  drm/fb: drop panic handling

Jarkko Sakkinen (1):
  drm: remove redundant code form drm_ioc32.c

Maarten Lankhorst (3):
  drm/atomic: Update old_fb after setting a property.
  drm/atomic: Cleanup on error properly in the atomic ioctl.
  drm/atomic: Only update crtc-x/y if it's part of the state, v2.

Masanari Iida (1):
  drm: Fix warning with make xmldocs caused by drm_irq.c

Peter Antoine (1):
  drm: Turn off Legacy Context Functions

Sudip Mukherjee (2):
  drm/mgag200: remove unused variables
  drm/mgag200: remove unneeded variable

Thierry Reding (1):
  drm: Remove useless blank line

 drivers/gpu/drm/drm_atomic.c   | 76 --
 drivers/gpu/drm/drm_atomic_helper.c| 14 ---
 drivers/gpu/drm/drm_context.c  | 51 ++-
 drivers/gpu/drm/drm_crtc.c |  9 +---
 drivers/gpu/drm/drm_crtc_helper.c  | 24 +--
 drivers/gpu/drm/drm_drv.c  |  7 +---
 drivers/gpu/drm/drm_fb_helper.c| 26 
 drivers/gpu/drm/drm_gem.c  | 11 +
 drivers/gpu/drm/drm_ioc32.c| 55 
 drivers/gpu/drm/drm_irq.c  |  2 +-
 drivers/gpu/drm/drm_legacy.h   |  2 +-
 drivers/gpu/drm/drm_lock.c |  6 +++
 drivers/gpu/drm/drm_plane_helper.c | 16 ---
 drivers/gpu/drm/mgag200/mgag200_fb.c   |  2 -
 drivers/gpu/drm/mgag200/mgag200_mode.c |  9 ++--
 drivers/gpu/drm/mgag200/mgag200_ttm.c  |  8 +---
 drivers/gpu/drm/nouveau/nouveau_drm.c  |  3 +-
 include/drm/drmP.h | 23 +-
 include/uapi/drm/drm_fourcc.h  |  7 
 19 files changed, 178 insertions(+), 173 deletions(-)

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PULL] topic/crc-pmic

2015-07-23 Thread Daniel Vetter
Oops, somehow removed the mailing lists from Cc: when adding all other
maintainers. Fixed that now.
-Daniel

On Thu, Jul 23, 2015 at 9:31 AM, Daniel Vetter daniel.vet...@ffwll.ch wrote:
 Hi Dave,

 crystalcove pmic support from Shobhit. Patch series has all acks/r-bs from
 other mainainers so ok to pull into drm-next. But I'm cc'ing all other
 maintainers as fyi and in case they want to pull it into their trees too
 to avoid conflicts.

 Cheers, Daniel


 The following changes since commit 52721d9d3334c1cb1f76219a161084094ec634dc:

   Linux 4.2-rc3 (2015-07-19 14:45:02 -0700)

 are available in the git repository at:

   git://anongit.freedesktop.org/drm-intel tags/topic/crc-pmic-2015-07-23

 for you to fetch changes up to 04cbfe68c3190f23bcfec230bfd832b533f35554:

   mfd: Add GPIOLIB dependency if INTEL_SOC_PMIC is to be enabled (2015-07-22 
 11:18:41 +0200)

 
 Shobhit Kumar (8):
   gpiolib: Add support for removing registered consumer lookup table
   mfd: intel_soc_pmic_core: Add lookup table for Panel Control as GPIO 
 signal
   mfd: intel_soc_pmic_crc: Add PWM cell device for Crystalcove PMIC
   mfd: intel_soc_pmic_core: ADD PWM lookup table for CRC PMIC based PWM
   pwm: crc: Add Crystalcove (CRC) PWM driver
   drm/i915: Use the CRC gpio for panel enable/disable
   drm/i915: Backlight control using CRC PMIC based PWM driver
   mfd: Add GPIOLIB dependency if INTEL_SOC_PMIC is to be enabled

  drivers/gpio/gpiolib.c |  13 
  drivers/gpu/drm/i915/intel_bios.h  |   7 ++
  drivers/gpu/drm/i915/intel_drv.h   |   4 ++
  drivers/gpu/drm/i915/intel_dsi.c   |  37 +-
  drivers/gpu/drm/i915/intel_dsi.h   |   3 +
  drivers/gpu/drm/i915/intel_panel.c |  94 ++--
  drivers/mfd/Kconfig|   1 +
  drivers/mfd/intel_soc_pmic_core.c  |  29 
  drivers/mfd/intel_soc_pmic_crc.c   |   3 +
  drivers/pwm/Kconfig|   7 ++
  drivers/pwm/Makefile   |   1 +
  drivers/pwm/pwm-crc.c  | 143 
 +
  include/linux/gpio/machine.h   |   1 +
  13 files changed, 336 insertions(+), 7 deletions(-)
  create mode 100644 drivers/pwm/pwm-crc.c

 --
 Daniel Vetter
 Software Engineer, Intel Corporation
 http://blog.ffwll.ch



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PULL] topic/drm-fixes

2015-07-23 Thread Daniel Vetter
Hi Dave,

Regression fix for systemd getting confused about unknown connector state
after resume. Just stop setting the state to unknown, turned out to be a
silly idea anyway. What drivers imo really should do (and i915 still does
that) is forcing a full reprobe on resume to make sure connector changes
while suspended are caught. Most drivers seem to get this wrong. Otoh it
took us years to get fixes merged where some probe races resulted in
eating uevents, I guess userspace expectations for reliable hpd are just
really low :(

Cheers, Daniel


The following changes since commit 52721d9d3334c1cb1f76219a161084094ec634dc:

  Linux 4.2-rc3 (2015-07-19 14:45:02 -0700)

are available in the git repository at:

  git://anongit.freedesktop.org/drm-intel tags/topic/drm-fixes-2015-07-23

for you to fetch changes up to 5677d67ae3949f09f57357241b88222d49b8c782:

  drm: Stop resetting connector state to unknown (2015-07-22 14:52:26 +0200)


Daniel Vetter (1):
  drm: Stop resetting connector state to unknown

 drivers/gpu/drm/drm_crtc.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PULL] topic/connector-locking

2015-07-23 Thread Daniel Vetter
Hi Dave,

connector hotplug locking cleanup and fixes to make it save against
atomic. Note that because of depencies this is based on top of the
drm-intel-next pull, so that one needs to go in before this one.

I've also thrown in the mode_group removal on top since it's defunct,
never worked really, no one seems to care and the code can be resurrected
easily.

Cheers, Daniel


The following changes since commit e0548f1979bfee900fb0671a5dd3a2f217dce5df:

  drm/i915: Update DRIVER_DATE to 20150717 (2015-07-17 22:24:32 +0200)

are available in the git repository at:

  git://anongit.freedesktop.org/drm-intel 
tags/topic/connector-locking-2015-07-23

for you to fetch changes up to 3fdefa399e4644399ce3e74e65a75122d52dba6a:

  drm: gc now dead mode_group code (2015-07-22 17:29:38 +0200)


Daniel Vetter (15):
  drm: Simplify drm_for_each_legacy_plane arguments
  drm: Add modeset object iterators
  drm/probe-helper: Grab mode_config.mutex in poll_init/enable
  drm/fbdev-helper: Grab mode_config.mutex in 
drm_fb_helper_single_add_all_connectors
  drm: Check locking in drm_for_each_connector
  drm/i915: Use drm_for_each_fb in i915_debugfs.c
  drm: Check locking in drm_for_each_fb
  drm/i915: Take all modeset locks for DP MST hotplug
  drm/radeon: Take all modeset locks for DP MST hotplug
  drm: Amend connector list locking rules
  drm: Roll out drm_for_each_connector more
  drm/cma-helper: Fix locking in drm_fb_cma_debugfs_show
  drm: Roll out drm_for_each_{plane,crtc,encoder}
  drm: Stop filtering according to mode_group in getresources
  drm: gc now dead mode_group code

 drivers/gpu/drm/drm_atomic.c  |   2 +-
 drivers/gpu/drm/drm_atomic_helper.c   |   4 +-
 drivers/gpu/drm/drm_crtc.c| 206 +++---
 drivers/gpu/drm/drm_crtc_helper.c |  42 +++---
 drivers/gpu/drm/drm_drv.c |  12 --
 drivers/gpu/drm/drm_edid.c|   2 +-
 drivers/gpu/drm/drm_fb_cma_helper.c   |  18 +--
 drivers/gpu/drm/drm_fb_helper.c   |  19 ++-
 drivers/gpu/drm/drm_gem_cma_helper.c  |   3 -
 drivers/gpu/drm/drm_modeset_lock.c|   7 +-
 drivers/gpu/drm/drm_of.c  |   2 +-
 drivers/gpu/drm/drm_plane_helper.c|   3 +-
 drivers/gpu/drm/drm_probe_helper.c|  45 ---
 drivers/gpu/drm/i915/i915_debugfs.c   |   4 +-
 drivers/gpu/drm/i915/intel_dp_mst.c   |  15 +--
 drivers/gpu/drm/i915/intel_pm.c   |   2 +-
 drivers/gpu/drm/radeon/radeon_dp_mst.c|  11 +-
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c |   2 +-
 include/drm/drmP.h|   1 -
 include/drm/drm_crtc.h|  67 ++
 20 files changed, 172 insertions(+), 295 deletions(-)

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH igt] lib: add igt_debugfs_read()

2015-07-23 Thread Daniel Vetter
On Wed, Jul 22, 2015 at 9:11 PM, Paulo Zanoni przan...@gmail.com wrote:
 +#define igt_debugfs_read(filename, buf) \
 +   __igt_debugfs_read((filename), (buf), sizeof(buf))


gtkdoc for this one would be nice too, along the lines of Convenience
wrapper macro for __igt_debugfs_read ... lgtm otherwise.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] mfd: Add GPIOLIB dependency if INTEL_SOC_PMIC is to be enabled

2015-07-23 Thread Lee Jones
On Wed, 22 Jul 2015, Daniel Vetter wrote:

 On Wed, Jul 22, 2015 at 02:01:44PM +0530, Shobhit Kumar wrote:
  This is needed as the CRC PMIC has support for Panel
  enable/diable as gpio which needs 'gpiod_add_lookup_table'
  and 'gpiod_remove_lookup_table' from gpiolib. This patch
  can be squashed with below commit in topic/crc-pmic branch
  
  commit 61dd2ca2d44e493b050adbbb75bc50db11c367dd
  Author: Shobhit Kumar shobhit.ku...@intel.com
  Date:   Fri Jun 26 14:32:05 2015 +0530
  
  mfd: intel_soc_pmic_core: Add lookup table for Panel Control as GPIO
  signal
  
  On some Intel SoC platforms, the panel enable/disable signals
  are controlled by CRC PMIC. Add those control as a new GPIO in a
  lookup table for gpio-crystalcove chip during CRC driver load
  
  Cc: Lee Jones lee.jo...@linaro.org
  Cc: Linus Walleij linus.wall...@linaro.org
  Signed-off-by: Shobhit Kumar shobhit.ku...@intel.com
 
 Applied, thanks.

You can't just apply changes made to other subsystems willy-nilly.

You should wait for an Ack, despite the triviality of the patch, even
if it's just out of courtesy.

  ---
   drivers/mfd/Kconfig | 1 +
   1 file changed, 1 insertion(+)
  
  diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
  index 6538159..379a420 100644
  --- a/drivers/mfd/Kconfig
  +++ b/drivers/mfd/Kconfig
  @@ -318,6 +318,7 @@ config LPC_SCH
   
   config INTEL_SOC_PMIC
  bool Support for Intel Atom SoC PMIC
  +   depends on GPIOLIB
  depends on I2C=y
  select MFD_CORE
  select REGMAP_I2C
 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] mfd: Add GPIOLIB dependency if INTEL_SOC_PMIC is to be enabled

2015-07-23 Thread Daniel Vetter
On Thu, Jul 23, 2015 at 9:38 AM, Lee Jones lee.jo...@linaro.org wrote:
 On Wed, 22 Jul 2015, Daniel Vetter wrote:
 On Wed, Jul 22, 2015 at 02:01:44PM +0530, Shobhit Kumar wrote:
  This is needed as the CRC PMIC has support for Panel
  enable/diable as gpio which needs 'gpiod_add_lookup_table'
  and 'gpiod_remove_lookup_table' from gpiolib. This patch
  can be squashed with below commit in topic/crc-pmic branch
 
  commit 61dd2ca2d44e493b050adbbb75bc50db11c367dd
  Author: Shobhit Kumar shobhit.ku...@intel.com
  Date:   Fri Jun 26 14:32:05 2015 +0530
 
  mfd: intel_soc_pmic_core: Add lookup table for Panel Control as GPIO
  signal
 
  On some Intel SoC platforms, the panel enable/disable signals
  are controlled by CRC PMIC. Add those control as a new GPIO in a
  lookup table for gpio-crystalcove chip during CRC driver load
 
  Cc: Lee Jones lee.jo...@linaro.org
  Cc: Linus Walleij linus.wall...@linaro.org
  Signed-off-by: Shobhit Kumar shobhit.ku...@intel.com

 Applied, thanks.

 You can't just apply changes made to other subsystems willy-nilly.

 You should wait for an Ack, despite the triviality of the patch, even
 if it's just out of courtesy.

Sorry about that, figured getting rid of the compile fail asap is
better. Should I revert it again and update the pull request?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/4] drm/i915: Add audio hotplug info struct

2015-07-23 Thread Takashi Iwai
On Thu, 23 Jul 2015 08:25:21 +0200,
David Henningsson wrote:
 
 
 
 On 2015-07-23 08:17, David Henningsson wrote:
  I'm about to go on vacation so it would be good to get some closure
  here. If you both prefer this setup, how about I remove struct
  i915_audio_hotplug_info for now? We will then have:
 
   const struct i915_audio_component_audio_ops {
   void (*hotplug_notify)(struct hdac_bus *);
   }
 
 Sorry, it would look like this:
 
const struct i915_audio_component_audio_ops {
void (*hotplug_notify)(struct hdac_bus *, int port, int 
 port_mst_index);
}
 
 ...to indicate what port needs updating.

Yes, I think this is simpler.

A remaining question is whether it should be notified to bus or
codec.  In the latter case, we need to allow registering the audio
codec after binding the component.

I find the codec can be a bit better, as this is directly targeted
(while for bus you need to look through the codec list).  But it's
just a minor difference, and I don't mind so much about this, if there
is any other difficulty by that move.


thanks,

Takashi
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] mfd: Add GPIOLIB dependency if INTEL_SOC_PMIC is to be enabled

2015-07-23 Thread Lee Jones
On Thu, 23 Jul 2015, Daniel Vetter wrote:

 On Thu, Jul 23, 2015 at 9:38 AM, Lee Jones lee.jo...@linaro.org wrote:
  On Wed, 22 Jul 2015, Daniel Vetter wrote:
  On Wed, Jul 22, 2015 at 02:01:44PM +0530, Shobhit Kumar wrote:
   This is needed as the CRC PMIC has support for Panel
   enable/diable as gpio which needs 'gpiod_add_lookup_table'
   and 'gpiod_remove_lookup_table' from gpiolib. This patch
   can be squashed with below commit in topic/crc-pmic branch
  
   commit 61dd2ca2d44e493b050adbbb75bc50db11c367dd
   Author: Shobhit Kumar shobhit.ku...@intel.com
   Date:   Fri Jun 26 14:32:05 2015 +0530
  
   mfd: intel_soc_pmic_core: Add lookup table for Panel Control as GPIO
   signal
  
   On some Intel SoC platforms, the panel enable/disable signals
   are controlled by CRC PMIC. Add those control as a new GPIO in a
   lookup table for gpio-crystalcove chip during CRC driver load
  
   Cc: Lee Jones lee.jo...@linaro.org
   Cc: Linus Walleij linus.wall...@linaro.org
   Signed-off-by: Shobhit Kumar shobhit.ku...@intel.com
 
  Applied, thanks.
 
  You can't just apply changes made to other subsystems willy-nilly.
 
  You should wait for an Ack, despite the triviality of the patch, even
  if it's just out of courtesy.
 
 Sorry about that, figured getting rid of the compile fail asap is
 better. Should I revert it again and update the pull request?

It's fine.  Just please bear it in mind for the future.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/3] igt/gem_create: Test to validate parameters for GEM_CREATE ioctl

2015-07-23 Thread Tvrtko Ursulin


Hi,

On 07/22/2015 02:45 PM, ankitprasad.r.sha...@intel.com wrote:

From: Ankitprasad Sharma ankitprasad.r.sha...@intel.com

This test validates the two parameters (size and flags) GEM_CREATE ioctl.

v2: Added IGT_TEST_DESCRIPTION (Thomas Wood)

v3: Removed use of hard coded values, updated comments (Tvrtko)

Signed-off-by: Ankitprasad Sharma ankitprasad.r.sharma at intel.com
---
  tests/Makefile.sources |   1 +
  tests/gem_create.c | 170 +
  2 files changed, 171 insertions(+)
  create mode 100644 tests/gem_create.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 324cbb5..f5790df 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -15,6 +15,7 @@ TESTS_progs_M = \
gem_close_race \
gem_concurrent_blit \
gem_concurrent_all \
+   gem_create \
gem_cs_tlb \
gem_ctx_param_basic \
gem_ctx_bad_exec \
diff --git a/tests/gem_create.c b/tests/gem_create.c
new file mode 100644
index 000..d2c1189
--- /dev/null
+++ b/tests/gem_create.c
@@ -0,0 +1,170 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * 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, sublicense,
+ * 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 NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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:
+ *Ankitprasad Sharma ankitprasad.r.sharma at intel.com
+ *
+ */
+
+/** @file gem_create.c
+ *
+ * This is a test for the extended and old gem_create ioctl, that
+ * includes allocation of object from stolen memory and shmem.
+ *
+ * The goal is to simply ensure that basics work and invalid input
+ * combinations are rejected.
+ */
+
+#include stdlib.h
+#include sys/ioctl.h
+#include stdio.h
+#include string.h
+#include fcntl.h
+#include inttypes.h
+#include errno.h
+#include sys/stat.h
+#include sys/time.h
+#include getopt.h
+
+#include drm.h
+
+#include ioctl_wrappers.h
+#include intel_bufmgr.h
+#include intel_batchbuffer.h
+#include intel_io.h
+#include intel_chipset.h
+#include igt_aux.h
+#include drmtest.h
+#include drm.h
+#include i915_drm.h
+
+IGT_TEST_DESCRIPTION(This is a test for the extended  old gem_create ioctl,
+ that includes allocation of object from stolen memory
+ and shmem);
+
+#define CLEAR(s) memset(s, 0, sizeof(s))
+#define UNALIGNED_SIZE (PAGE_SIZE - (2*1024))
+#define VALID_OFFSET (PAGE_SIZE - 1024)
+#define INVALID_OFFSET (PAGE_SIZE + 1024)
+#define LENGTH 256
+#define DWORD_SIZE 4
+
+struct local_i915_gem_create_v2 {
+   uint64_t size;
+   uint32_t handle;
+   uint32_t pad;
+#define I915_CREATE_PLACEMENT_STOLEN (10)
+   uint32_t flags;
+} create;
+
+#define LOCAL_IOCTL_I915_GEM_CREATE   DRM_IOWR(DRM_COMMAND_BASE + 
DRM_I915_GEM_CREATE, struct local_i915_gem_create_v2)
+
+static void invalid_flag_test(int fd)
+{
+   int ret;
+
+   gem_require_stolen_support(fd);
+
+   create.handle = 0;
+   create.size = PAGE_SIZE;
+   create.flags = ~I915_CREATE_PLACEMENT_STOLEN;
+   ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_CREATE, create);
+
+   igt_assert(ret = 0);
+
+   create.flags = ~0;
+   ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_CREATE, create);
+
+   igt_assert(ret = 0);
+}
+
+static void invalid_size_test(int fd)
+{
+   int handle;
+
+   handle = __gem_create(fd, 0);
+   igt_assert(handle == 0);
+}
+
+/*
+ * Creating an object with non-aligned size and trying to access it with an
+ * offset, which is greater than the requested size but smaller than the
+ * object's last page boundary. pwrite here must be successful.
+ */
+static void valid_nonaligned_size(int fd)
+{
+   int handle, i;
+   uint32_t buf[PAGE_SIZE/DWORD_SIZE];


char buf[PAGE_SIZE] and then don't need DWORD_SIZE?


+
+   handle = gem_create(fd, UNALIGNED_SIZE);
+   igt_assert(handle != 0);

+   gem_write(fd, handle, VALID_OFFSET, buf, LENGTH);


In general this is a bit unreadable since you a lot of macros and reader 
must jump up and down to figure out 

Re: [Intel-gfx] [BISECTED][BUG] Bug 91133 : GPU hang on G45

2015-07-23 Thread Daniel Vetter
On Wed, Jul 22, 2015 at 09:53:48PM +0200, Vincent Legoll wrote:
  But unfortunately the culprit commit does not revert properly from
  current linus tree.
 
 In fact the patch does revert with a bit of fuzz on current linus's tree,
 and I tested the bug disappear with the revert.
 
 Should I ask on LKML for a revert, during the bug fixing process ?

Would be great if you can submit the revert (with bugzilla link and
signed-off-by and everything to intel-gfx here). I need to double-check
that there's nothing else we need to revert. Also please cc all the
original authors/reviewers of the offending patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] mfd: Add GPIOLIB dependency if INTEL_SOC_PMIC is to be enabled

2015-07-23 Thread Daniel Vetter
On Thu, Jul 23, 2015 at 10:15:03AM +0100, Lee Jones wrote:
 On Thu, 23 Jul 2015, Daniel Vetter wrote:
 
  On Thu, Jul 23, 2015 at 9:38 AM, Lee Jones lee.jo...@linaro.org wrote:
   On Wed, 22 Jul 2015, Daniel Vetter wrote:
   On Wed, Jul 22, 2015 at 02:01:44PM +0530, Shobhit Kumar wrote:
This is needed as the CRC PMIC has support for Panel
enable/diable as gpio which needs 'gpiod_add_lookup_table'
and 'gpiod_remove_lookup_table' from gpiolib. This patch
can be squashed with below commit in topic/crc-pmic branch
   
commit 61dd2ca2d44e493b050adbbb75bc50db11c367dd
Author: Shobhit Kumar shobhit.ku...@intel.com
Date:   Fri Jun 26 14:32:05 2015 +0530
   
mfd: intel_soc_pmic_core: Add lookup table for Panel Control as 
GPIO
signal
   
On some Intel SoC platforms, the panel enable/disable signals
are controlled by CRC PMIC. Add those control as a new GPIO in a
lookup table for gpio-crystalcove chip during CRC driver load
   
Cc: Lee Jones lee.jo...@linaro.org
Cc: Linus Walleij linus.wall...@linaro.org
Signed-off-by: Shobhit Kumar shobhit.ku...@intel.com
  
   Applied, thanks.
  
   You can't just apply changes made to other subsystems willy-nilly.
  
   You should wait for an Ack, despite the triviality of the patch, even
   if it's just out of courtesy.
  
  Sorry about that, figured getting rid of the compile fail asap is
  better. Should I revert it again and update the pull request?
 
 It's fine.  Just please bear it in mind for the future.

Sure will wait for ack the next time around.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v3 1/5] drm: Add config for detecting libdrm

2015-07-23 Thread Dmitry V. Levin
On Thu, Jul 23, 2015 at 05:48:21AM -0400, Mike Frysinger wrote:
 On 01 Jul 2015 14:52, Patrik Jakobsson wrote:
  Use pkg-config to try to find libdrm. If that fails use the standard
  include directory for kernel drm headers in /usr/include/drm.
  
  * configure.ac: Use pkg-config to find libdrm
  
  Signed-off-by: Patrik Jakobsson patrik.jakobs...@linux.intel.com
  ---
   configure.ac | 4 
   1 file changed, 4 insertions(+)
  
  diff --git a/configure.ac b/configure.ac
  index bb8bf46..aa63af7 100644
  --- a/configure.ac
  +++ b/configure.ac
  @@ -844,6 +844,10 @@ fi
   AM_CONDITIONAL([USE_LIBUNWIND], [test x$use_libunwind = xyes])
   AC_MSG_RESULT([$use_libunwind])
   
  +PKG_CHECK_MODULES([libdrm], [libdrm],
  +   [CPPFLAGS=$CPPFLAGS $libdrm_CFLAGS],
  +   [CPPFLAGS=$CPPFLAGS -I/usr/include/drm])
 
 yikes, no, this is a really really bad idea.  it should read:
 PKG_CHECK_MODULES([LIBDRM], [libdrm],
   [CPPFLAGS=$CPPFLAGS $LIBDRM_CFLAGS], [:])

Why [:] ?  Wouldn't [] suffice?


-- 
ldv


pgpR2DMrJSFVq.pgp
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx