Re: [Intel-gfx] [PATCH 1/3] drm/i915: add SNB and IVB video sprite support v6

2012-02-14 Thread Lan, Hai
Hi Jesse,
I have tested the video sprite with intel-gpu-tools on SNB and found a bug.
When setting overlay position with x0, it will divide 0 and make drm driver 
crash. 
I have fixed it. Please see my patch. Thanks.

Hai Lan

 -Original Message-
 From: intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org
 [mailto:intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org] On
 Behalf Of Jesse Barnes
 Sent: Wednesday, December 14, 2011 5:20 AM
 To: intel-gfx@lists.freedesktop.org
 Subject: [Intel-gfx] [PATCH 1/3] drm/i915: add SNB and IVB video sprite
 support v6
 
 The video sprites support various video surface formats natively and can
 handle scaling as well.  So add support for them using the new DRM core
 sprite support functions.


 +static bool
 +sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane,
 + uint32_t sprite_width, int pixel_size,
 + const struct intel_watermark_params *display,
 + int latency_ns, int *sprite_wm)
 +{
 + struct drm_crtc *crtc;
 + unsigned long line_time_us;
 + int clock;
 + int line_count, line_size;
 + int small, large;
 + int entries;
 +
 + if (!latency_ns) {
 + *sprite_wm = 0;
 + return false;
 + }
 +
 + crtc = intel_get_crtc_for_plane(dev, plane);
 + clock = crtc-mode.clock;
 +
 + line_time_us = (sprite_width * 1000) / clock;
 + line_count = (latency_ns / line_time_us + 1000) / 1000;
 + line_size = sprite_width * pixel_size;
 +



0001-drm-i915-fix-a-bug-for-setting-overlay.patch
Description: 0001-drm-i915-fix-a-bug-for-setting-overlay.patch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/3] drm/i915: add SNB and IVB video sprite support v2

2011-11-17 Thread Lan, Hai
 + /*
 +  * We can take a larger source and scale it down, but
 +  * only so much...  16x is the max on SNB.
 +  */
 + if (((src_w * src_h) / (crtc_w * crtc_h))  intel_plane-max_downscale)
 + return -EINVAL;
 +
[Lan, Hai] if crtc_w or crtc_h = 0, the drm driver will crash. 


From 778327daa3451f3c5f41c5db8bdccdcbf484267b Mon Sep 17 00:00:00 2001
From: Hai Lan hai@intel.com
Date: Fri, 4 Nov 2011 18:08:11 +0800
Subject: [PATCH] drm/i915:fix the overflow for overlay when crtc_w or crtc_h =0

When the crtc_w = 0 or crtc_h = 0, it should not be divided.
Besides, when (crtc_x+crtc_w)0 or (crtc_y+crtc_h)0, it should be handled.

Signed-off-by: Hai Lan hai@intel.com
---
 drivers/gpu/drm/i915/intel_sprite.c |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c 
b/drivers/gpu/drm/i915/intel_sprite.c
index 0891bda..d62e8ca 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -268,17 +268,23 @@ intel_update_plane(struct drm_plane *plane, struct 
drm_crtc *crtc,
 * try to scale the source if part of the visible region is offscreen.
 * The caller must handle that by adjusting source offset and size.
 */
-   if (crtc_x  0) {
+   if ((crtc_x  0)  ((crtc_x + crtc_w)0)) {
crtc_w += crtc_x;
crtc_x = 0;
}
+   if ((crtc_x + crtc_w)0) {
+   return -EINVAL;
+   }
if (crtc_x + crtc_w  primary_w)
crtc_w = primary_w - crtc_x;
 
-   if (crtc_y  0) {
+   if ((crtc_y  0)  ((crtc_y+crtc_h)0)) {
crtc_h += crtc_y;
crtc_y = 0;
}
+   if ((crtc_y+crtc_h)0) {
+   return -EINVAL;
+   }
if (crtc_y + crtc_h  primary_h)
crtc_h = primary_h - crtc_y;
 
@@ -286,7 +292,9 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc 
*crtc,
 * We can take a larger source and scale it down, but
 * only so much...  16x is the max on SNB.
 */
-   if (((src_w * src_h) / (crtc_w * crtc_h))  intel_plane-max_downscale)
+   if (crtc_w == 0 || crtc_h == 0)
+   return -EINVAL;
+   else if (((src_w * src_h) / (crtc_w * crtc_h))  
intel_plane-max_downscale)
return -EINVAL;
 
/*
-- 
1.7.4.1

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


Re: [Intel-gfx] Playing multiple mpg files simultaneously

2011-11-03 Thread Lan, Hai
I was also using mpg container file(mpeg2 ps file). What files are you using?

Hai Lan

 -Original Message-
 From: Jyotsana [mailto:jyotsanasi...@tataelxsi.co.in]
 Sent: Thursday, November 03, 2011 2:55 PM
 To: Lan, Hai
 Cc: intel-gfx@lists.freedesktop.org
 Subject: Re: [Intel-gfx] Playing multiple mpg files simultaneously
 
 I tried with 2 streams and have this problem only with mpg container.
 There is no problem with mpegts containing mpeg2 video codec.
 
 Lan, Hai wrote:
  I have tried it with 6 streams MPEG2 1080P files but don't find this issue.
 How many streams are you playing?
 
  Hai Lan
 
 
  -Original Message-
  From: intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org
  [mailto:intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org] On
  Behalf Of Jyotsana
  Sent: Wednesday, November 02, 2011 12:38 PM
  To: intel-gfx@lists.freedesktop.org
  Subject: [Intel-gfx] Playing multiple mpg files simultaneously
 
  Hi,
 
  I am trying to run multiple mpg files simultaneously from the command
 line
  using mplayer and libva.
 
  The videos run fine for a few seconds or so but then the display
  flickers and
  becomes black and ultimately the system hangs.
  This is the log given by mplayer on commad line:
 
  Too many video packets in the buffer: (4096 in 1180675 bytes).
  Maybe you are playing a non-interleaved stream/file or the codec failed?
  For AVI files, try to force non-interleaved mode with the -ni option.
  A:  25.8 V:  25.4 A-V:  0.399 ct:  2.006 756/756 35% 43%  3.9% 1 0
 
  Multiple mp4/mov files work fine.
 
  I have tested this with gstreamer-vaapi and it gives the same result.
 
  PS :
  1. Platform  :  SandyBridge
  2. OS:  64 bit FC 15
  3. Packages  :  2011Q3 Packages
  4. Mplayer   :  Downloaded from
 
 http://www.splitted-desktop.com/static/libva/mplayer-vaapi/mplayer-vaap
  i-latest-FULL.tar.bz2
  Also tested with 32-bit FC 13 and 2011Q1 Packages but it gives the same
  result.
 
  What could be the problem?
  I have tried with different mpg files but all give the same result.
 
  Thanks and Regards,
  Jyotsana.
 
 
 
 
 
  ___
  Intel-gfx mailing list
  Intel-gfx@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/intel-gfx
 
 
 
 

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


Re: [Intel-gfx] [PATCH 4/5] drm/i915: add SNB and IVB video sprite support

2011-11-03 Thread Lan, Hai
Hi Jesse,
It sees that there might be an overflow when crtc_w or crtc_h =0. 
Following is my patch.
Thanks and best regards.

Hai Lan


From 778327daa3451f3c5f41c5db8bdccdcbf484267b Mon Sep 17 00:00:00 2001
From: Hai Lan hai@intel.com
Date: Fri, 4 Nov 2011 18:08:11 +0800
Subject: [PATCH] drm/i915:fix the overflow for overlay when crtc_w or crtc_h =0

When the crtc_w = 0 or crtc_h = 0, it should not be divided.
Besides, when (crtc_x+crtc_w)0 or (crtc_y+crtc_h)0, it should be handled.

Signed-off-by: Hai Lan hai@intel.com
---
 drivers/gpu/drm/i915/intel_sprite.c |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c 
b/drivers/gpu/drm/i915/intel_sprite.c
index 0891bda..d62e8ca 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -268,17 +268,23 @@ intel_update_plane(struct drm_plane *plane, struct 
drm_crtc *crtc,
 * try to scale the source if part of the visible region is offscreen.
 * The caller must handle that by adjusting source offset and size.
 */
-   if (crtc_x  0) {
+   if ((crtc_x  0)  ((crtc_x + crtc_w)0)) {
crtc_w += crtc_x;
crtc_x = 0;
}
+   if ((crtc_x + crtc_w)0) {
+   return -EINVAL;
+   }
if (crtc_x + crtc_w  primary_w)
crtc_w = primary_w - crtc_x;
 
-   if (crtc_y  0) {
+   if ((crtc_y  0)  ((crtc_y+crtc_h)0)) {
crtc_h += crtc_y;
crtc_y = 0;
}
+   if ((crtc_y+crtc_h)0) {
+   return -EINVAL;
+   }
if (crtc_y + crtc_h  primary_h)
crtc_h = primary_h - crtc_y;
 
@@ -286,7 +292,9 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc 
*crtc,
 * We can take a larger source and scale it down, but
 * only so much...  16x is the max on SNB.
 */
-   if (((src_w * src_h) / (crtc_w * crtc_h))  intel_plane-max_downscale)
+   if (crtc_w == 0 || crtc_h == 0)
+   return -EINVAL;
+   else if (((src_w * src_h) / (crtc_w * crtc_h))  
intel_plane-max_downscale)
return -EINVAL;
 
/*
-- 
1.7.4.1

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


Re: [Intel-gfx] [PATCH] test/testdisplay:add cursor test

2011-10-22 Thread Lan, Hai
 what does this test do? For the unknowledgeable user what is supposed to
 happen, that means, when is the test successful and when not?
 
I wrote this patch to test whether the cursor can work OK. It needs the tester 
to watch the screen.
If the tester can see the white cursor move from left to right, it can prove 
that the cursor works OK.
If not, the cursor driver is wrong.
Thanks

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


Re: [Intel-gfx] [PATCH] drm/i915:fix the bug that testdisplay can't work with 32 bits depth (bug # 40011)

2011-08-13 Thread Lan, Hai
Hi Keith
Thanks for your explanation. So bug 40011 can be treated as not-a-bug.

Hai Lan

 -Original Message-
 From: Keith Packard [mailto:kei...@keithp.com]
 Sent: Sunday, August 14, 2011 1:47 AM
 To: Lan, Hai; intel-gfx@lists.freedesktop.org
 Cc: Lan, Hai
 Subject: Re: [PATCH] drm/i915:fix the bug that testdisplay can't work with 32
 bits depth (bug # 40011)
 
 On Sat, 13 Aug 2011 23:22:14 -0400, Hai Lan hai@intel.com wrote:
 
  case 32:
  if (fb-depth == 24)
  dspcntr |= DISPPLANE_32BPP_NO_ALPHA;
  +   else if (fb-depth == 32)
  +   dspcntr |= DISPPLANE_32BPP_NO_ALPHA;
  else if (fb-depth == 30)
  dspcntr |= DISPPLANE_32BPP_30BIT_NO_ALPHA;
  else
 
 There is no hardware support for depth 32 output -- the hardware can only
 do 24-bits (8-8-8-8) XRGB or 30-bits (2-10-10-10) XRGB. Passing depth 32 to
 this function is in fact an error which the kernel now correctly reports.
 
 This patch simply assumes that the application programmer created a depth
 24 frame buffer and then mistakenly told the kernel that it was depth 32.
 
 --
 keith.pack...@intel.com
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] H.264/AVC encode, Intel(r) HD Graphics 2000/3000, linux

2011-07-19 Thread Lan, Hai
Currently there is a sample application named avcenc in libva to do the h.264 
encoding.
For the vaapi question, there is a mailing list named 
li...@lists.freedesktop.org.
You can raise your question to it.

Hai Lan

 -Original Message-
 From: intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org
 [mailto:intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org] On
 Behalf Of Brian Brown
 Sent: Wednesday, July 20, 2011 6:51 AM
 To: intel-gfx@lists.freedesktop.org
 Subject: [Intel-gfx] H.264/AVC encode, Intel(r) HD Graphics 2000/3000, linux
 
 Is anyone aware of any linux projects (preferably ffmpeg) that can encode
 H.264/AVC using the iGPU of the sandy bridge Intel(r) HD Graphics 2000/3000?
 I see that there is a libva snb-encoder branch in vaapi. Has anyone developed
 a ffmpeg library that supports this? Sorry if this has been covered, I tried 
 to
 search the archives, but apparently search isn't working. Is there a better
 mailing list to ask this question?
 ___
 Intel-gfx mailing list
 Intel-gfx@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/intel-gfx
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] Test the first mode if there is no preferred mode.

2011-06-10 Thread Lan, Hai
This patch can make the testdisplay work if there is no preferred mode found. 
For example, 
if we use a 30 inch monitor(preferred mode is 2560x1600) with a single channel 
DVI cable, the driver will drop
the mode of 2560x1600. In this case testdisplay won't work because it can't 
find the preferred
Could anybody help to push this patch? Thanks.

Hai Lan

 -Original Message-
 From: intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org
 [mailto:intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org] On
 Behalf Of Lan, Hai
 Sent: Tuesday, May 31, 2011 5:47 PM
 To: Paul Menzel; intel-gfx@lists.freedesktop.org
 Subject: Re: [Intel-gfx] [PATCH] Test the first mode if there is no preferred
 mode.
 
 Dear Paul
 Thanks for your advice. I am afraid there might be a i915 driver bug. We use
 the testdisplay to check the SDVO-TV and
 find the TV has no preferred mode. This will cause the testdisplay to quit. 
 So I
 write this patch to make the testdisplay to go on.
 
 Hai Lan
 
  -Original Message-
  From: intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org
  [mailto:intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org] On
  Behalf Of Paul Menzel
  Sent: Tuesday, May 31, 2011 5:05 PM
  To: intel-gfx@lists.freedesktop.org
  Subject: Re: [Intel-gfx] [PATCH] Test the first mode if there is no 
  preferred
  mode.
 
  Dear Hai,
 
 
  Am Dienstag, den 31.05.2011, 17:24 -0400 schrieb Hai Lan:
   For a TV device, there  might be no preferred mode.
 
  is that an error of the device or is this a driver “feature”?
 
   In this case, we can test the first mode.
 
  Is a Signed-off-by line needed to get your patch accepted? You can add it
  automatically passing `-s` to `git commit` or `git format-patch`.
 
   ---
tests/testdisplay.c |   13 ++---
1 files changed, 10 insertions(+), 3 deletions(-)
  
   diff --git a/tests/testdisplay.c b/tests/testdisplay.c index
   41a5753..ef194fe 100644
   --- a/tests/testdisplay.c
   +++ b/tests/testdisplay.c
   @@ -280,9 +280,16 @@ static void
  connector_find_preferred_mode(struct connector *c)
 }
  
 if (!c-mode_valid) {
   - fprintf(stderr, failed to find any modes on connector %d\n,
   - c-id);
   - return;
   + if (connector-count_modes  0) {
   + /* use the first mode as test mode */
   + c-mode = connector-modes[0];
   + c-mode_valid = 1;
   + }
   + else {
   + fprintf(stderr, failed to find any modes on
 connector %d\n,
   + c-id);
   + return;
   + }
 }
  
 /* Now get the encoder */
 
  Reviewed-by: Paul Menzel paulepan...@users.sourceforge.net
 
 
  Thanks,
 
  Paul
 ___
 Intel-gfx mailing list
 Intel-gfx@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/intel-gfx
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] Need help in installing libva-1.0.12 package as part of Graphics driver installation

2011-06-02 Thread Lan, Hai
Hi Thirunavukkarasu
You can use ./autogen.sh ./configure --enable-i965-drivermakemake 
install to install libva. After you install libva, you can use vainfo to see 
the libva information.
You can refer to http://intellinuxgraphics.org/vaapi.html

Hai Lan


From: intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org 
[mailto:intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org] On Behalf Of 
Thirunavukkarasu S
Sent: Thursday, June 02, 2011 7:07 PM
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] Need help in installing libva-1.0.12 package as part of 
Graphics driver installation

Hi Team,

I am trying to install the below package[libva] as part of my Graphics driver 
installation on my latest notebook, Mostly with tar balls i use '#./configure, 
#make, #make install' to install any software. But with this package this 
doesn't work. Can you guys guide me or give a hint on how to do it or install 
it.

http://cgit.freedesktop.org/libva/snapshot/libva-1.0.12.tar.bz2

Also, i have a query on how to exactly know that whether Graphics driver is 
actually installed after installing those packages, tell me from where i can 
look for the info.

Sorry if i have mailed a wrong list :(

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


Re: [Intel-gfx] [PATCH] Test the first mode if there is no preferred mode.

2011-05-31 Thread Lan, Hai
Dear Paul
Thanks for your advice. I am afraid there might be a i915 driver bug. We use 
the testdisplay to check the SDVO-TV and 
find the TV has no preferred mode. This will cause the testdisplay to quit. So 
I write this patch to make the testdisplay to go on.

Hai Lan

 -Original Message-
 From: intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org
 [mailto:intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org] On
 Behalf Of Paul Menzel
 Sent: Tuesday, May 31, 2011 5:05 PM
 To: intel-gfx@lists.freedesktop.org
 Subject: Re: [Intel-gfx] [PATCH] Test the first mode if there is no preferred
 mode.
 
 Dear Hai,
 
 
 Am Dienstag, den 31.05.2011, 17:24 -0400 schrieb Hai Lan:
  For a TV device, there  might be no preferred mode.
 
 is that an error of the device or is this a driver “feature”?
 
  In this case, we can test the first mode.
 
 Is a Signed-off-by line needed to get your patch accepted? You can add it
 automatically passing `-s` to `git commit` or `git format-patch`.
 
  ---
   tests/testdisplay.c |   13 ++---
   1 files changed, 10 insertions(+), 3 deletions(-)
 
  diff --git a/tests/testdisplay.c b/tests/testdisplay.c index
  41a5753..ef194fe 100644
  --- a/tests/testdisplay.c
  +++ b/tests/testdisplay.c
  @@ -280,9 +280,16 @@ static void
 connector_find_preferred_mode(struct connector *c)
  }
 
  if (!c-mode_valid) {
  -   fprintf(stderr, failed to find any modes on connector %d\n,
  -   c-id);
  -   return;
  +   if (connector-count_modes  0) {
  +   /* use the first mode as test mode */
  +   c-mode = connector-modes[0];
  +   c-mode_valid = 1;
  +   }
  +   else {
  +   fprintf(stderr, failed to find any modes on connector 
  %d\n,
  +   c-id);
  +   return;
  +   }
  }
 
  /* Now get the encoder */
 
 Reviewed-by: Paul Menzel paulepan...@users.sourceforge.net
 
 
 Thanks,
 
 Paul
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] suggestions for Web site (was: Intel 2011Q1 release)

2011-04-18 Thread Lan, Hai
Dear Paul,
Thanks for your suggestion. http://intellinuxgraphics.org/vaapi.html has been 
updated.

Hai Lan

 -Original Message-
 From: intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org
 [mailto:intel-gfx-bounces+hai.lan=intel@lists.freedesktop.org] On
 Behalf Of Paul Menzel
 Sent: Friday, April 15, 2011 6:40 PM
 To: intel-gfx@lists.freedesktop.org
 Subject: [Intel-gfx] suggestions for Web site (was: Intel 2011Q1 release)
 
 Dear Gordon,
 
 
 Am Freitag, den 15.04.2011, 08:25 +0800 schrieb Jin, Gordon:
 
  We'd like to announce Intel 2011Q1 graphics package, with bug fixes as
 usual, and improved support for Sandy Bridge.
 
 […]
 
  Please also let us know your suggestions for how the website could be
 improved.
 
 1. http://intellinuxgraphics.org/2011Q1.html
 a) Under »components« I found it confusing that clicking on the link a
 download is started especially because of the word release. Maybe put there
 two links. The first one could link to the announcement and the second, for
 example named »download«, to the tarball.
 b) Under »support discontinued« I find it confusing that it still says »XvMC 
 is
 disabled on 915G/GM for KMS: bug#23012.«, since that has been the way
 since over a year?. I suggest to either drop it or add »since
 2010Q1(?) release«.
 
 2. http://intellinuxgraphics.org/vaapi.html
 a) Use full stops at the end of sentences.
 b) In the table it is not clear for me, if the hardware does not support that
 feature or it has just not been yet implemented in the software stack/driver.
 It would be great to clarify this by for example »not supported by hardware«
 and »not implemented«.
 
 
 
 Thanks,
 
 Paul
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] Recall: Q1 RC2 test report for SNB H264 encoding driver

2011-04-09 Thread Lan, Hai
Lan, Hai would like to recall the message, Q1 RC2 test report for SNB H264 
encoding driver.
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx