[Bug 50135] Unigine Heaven black stripes and weird shaders

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=50135

--- Comment #16 from Alicia  ---
First off, please bear with me if I make some noobish mistakes. I just recently
switched to Linux, and this is my first actual report I've made on a bug. This
is also my first venture into the depths of the actual GPU hardware.

I have a Radeon HD3650 (RV635, non-mobility) card, and I can verify that the
shadow stripes are still present. I don't play HoN, but I am playing the new S2
game, Strife, which uses the same engine. Setting shadows to lowest possible
does accomplish the same as Off in HoN as mentioned above.

I'd like to point out that the stripes actually change in size depending on the
variability of the setting. Medium shadows have about a 50/50 split of the dark
stripe compared to the light stripe. High has mostly full shadows with a very
little bit on the lighter stripe.

One last thing, and probably unrelated, but my card also seems to have problems
with some transparent shaders, as well. In Strife, it's visible in the launcher
quite easily.
http://i.imgur.com/17vq5In.jpg
This is with Shaders on Low. Higher settings result in worse corruption for
this. The blue and green boxes seem to change depending on which part they're
in. Green for the lightshaft/fog that runs across the center, as well as the
gem glow in the top-left. Cyan/blue for the background lighting.

For the record, both of these problems render fine in software mode.

I'm using Xubuntu 14.04, with the obiaf ppa, if it helps, though I can say this
issue is present in every version I've tried, including the default drivers on
the original 14.04 disc, as well as some of the stuff I managed to get working
from 13.10. Therefore, I can assume they're both not regressions, but just
missing or otherwise not-fully-working implementations.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/ffce7b69/attachment.html>


[Bug 84944] tearing on radeonsi vdpau deinterlacer

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=84944

--- Comment #9 from Christian K?nig  ---
(In reply to warpme from comment #7)
> (In reply to Christian K?nig from comment #5)
> > The deinterlacer is hardware independent and so it's rather unlikely that it
> > is the source of the problem.
> > 
> > Can you grab a trace of MythTV with VDPAU_TRACE=1 in the environment once
> > with and once without deinterlacing enabled? This way we can see what MythTV
> > is actually doing.
> 
> Adding VDPAU_TRACE=1 causes stop working VDPAU (MythTV switches to ffmpeg).
> I can try to investigate this - if You believe it is worth 

Yes, we should definitely investigate what MythTV is doing here.

> For me results from tests Michel suggested shows issue is within GLAMOR as
> Brazos without GLAMOR works OK while Brazos with GLAMOR NOK. As Kabini by
> default requires GLAMOR - by default I have issue on Kabini. 

EXA on Brazos is tear free most of the time because we sync operations to the
vblank using a hack. That hack isn't supported on GLAMOR and so GLAMOR
operations are not synced to vblank at all (Michel knows more about this).

But the root cause is something completely different, cause GLAMOR shouldn't be
used in the first place in this situation.

GLAMOR is made to accelerate things like window movements and text drawing. For
fullscreen video playback there should be a page flip operation used.

Please try to investigate what MythTV is actually doing different here to cause
the page flipping to not work correctly.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/98c8b6e9/attachment.html>


[Bug 79980] Random radeonsi crashes

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #167 from agapito  ---
3.18 rc1 still affected.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/71d826d1/attachment.html>


[PATCH] drm/radeon: Use drm_malloc_ab instead of kmalloc_array

2014-10-20 Thread Dave Airlie
> Should avoid kmalloc failures due to large number of array entries.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81991
> Signed-off-by: Michel D?nzer 

Looks good to me, also my reporter tested it and said it was good.

Reviewed-by: Dave Airlie 
> ---
>  drivers/gpu/drm/radeon/radeon_cs.c   | 2 +-
>  drivers/gpu/drm/radeon/radeon_ring.c | 4 ++--
>  drivers/gpu/drm/radeon/radeon_vm.c   | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c 
> b/drivers/gpu/drm/radeon/radeon_cs.c
> index 1c89344..a3e7aed 100644
> --- a/drivers/gpu/drm/radeon/radeon_cs.c
> +++ b/drivers/gpu/drm/radeon/radeon_cs.c
> @@ -450,7 +450,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser 
> *parser, int error, bo
> kfree(parser->track);
> kfree(parser->relocs);
> kfree(parser->relocs_ptr);
> -   kfree(parser->vm_bos);
> +   drm_free_large(parser->vm_bos);
> for (i = 0; i < parser->nchunks; i++)
> drm_free_large(parser->chunks[i].kdata);
> kfree(parser->chunks);
> diff --git a/drivers/gpu/drm/radeon/radeon_ring.c 
> b/drivers/gpu/drm/radeon/radeon_ring.c
> index 596e591..51dcf40 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -314,7 +314,7 @@ unsigned radeon_ring_backup(struct radeon_device *rdev, 
> struct radeon_ring *ring
> }
>
> /* and then save the content of the ring */
> -   *data = kmalloc_array(size, sizeof(uint32_t), GFP_KERNEL);
> +   *data = drm_malloc_ab(size, sizeof(uint32_t));
> if (!*data) {
> mutex_unlock(>ring_lock);
> return 0;
> @@ -356,7 +356,7 @@ int radeon_ring_restore(struct radeon_device *rdev, 
> struct radeon_ring *ring,
> }
>
> radeon_ring_unlock_commit(rdev, ring, false);
> -   kfree(data);
> +   drm_free_large(data);
> return 0;
>  }
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c 
> b/drivers/gpu/drm/radeon/radeon_vm.c
> index 4532cc7..dfde266 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -132,8 +132,8 @@ struct radeon_cs_reloc *radeon_vm_get_bos(struct 
> radeon_device *rdev,
> struct radeon_cs_reloc *list;
> unsigned i, idx;
>
> -   list = kmalloc_array(vm->max_pde_used + 2,
> -sizeof(struct radeon_cs_reloc), GFP_KERNEL);
> +   list = drm_malloc_ab(vm->max_pde_used + 2,
> +sizeof(struct radeon_cs_reloc));
> if (!list)
> return NULL;
>
> --
> 2.1.1
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 84944] tearing on radeonsi vdpau deinterlacer

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=84944

--- Comment #8 from smoki  ---

 Guessing this bug is about "tearing without composition", so i can confirm
that on Kabini HD8400 using other players too, mplayer, mpv, etc... basically i
can't get rid of tearing complitely without using composition + vblank_mode=3

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/123a2ba3/attachment.html>


[Intel-gfx] [PATCH 1/6] drm/displayid: add displayid defines and edid extension

2014-10-20 Thread Jani Nikula
On Mon, 20 Oct 2014, Dave Airlie  wrote:
> From: Dave Airlie 
>
> These are just taken from the DisplayID v1.3 spec, and the
> DDC spec.
>
> Signed-off-by: Dave Airlie 
> ---
>  include/drm/drm_displayid.h | 76 
> +
>  include/drm/drm_edid.h  |  2 ++
>  2 files changed, 78 insertions(+)
>  create mode 100644 include/drm/drm_displayid.h
>
> diff --git a/include/drm/drm_displayid.h b/include/drm/drm_displayid.h
> new file mode 100644
> index 000..1901003
> --- /dev/null
> +++ b/include/drm/drm_displayid.h
> @@ -0,0 +1,76 @@
> +/*
> + * Copyright ? 2014 Red Hat Inc.
> + *
> + * 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
> + */
> +#ifndef DRM_DISPLAYID_H
> +#define DRM_DISPLAYID_H
> +
> +#define DATA_BLOCK_PRODUCT_ID 0x00
> +#define DATA_BLOCK_DISPLAY_PARAMETERS 0x01
> +#define DATA_BLOCK_COLOR_CHARACTERISTICS 0x02
> +#define DATA_BLOCK_TYPE_1_DETAILED_TIMING 0x03
> +#define DATA_BLOCK_TYPE_2_DETAILED_TIMING 0x04
> +#define DATA_BLOCK_TYPE_3_SHORT_TIMING 0x05
> +#define DATA_BLOCK_TYPE_4_DMT_TIMING 0x06
> +#define DATA_BLOCK_VESA_TIMING 0x07
> +#define DATA_BLOCK_CEA_TIMING 0x08
> +#define DATA_BLOCK_VIDEO_TIMING_RANGE 0x09
> +#define DATA_BLOCK_PRODUCT_SERIAL_NUMBER 0x0a
> +#define DATA_BLOCK_GP_ASCII_STRING 0x0b
> +#define DATA_BLOCK_DISPLAY_DEVICE_DATA 0x0c
> +#define DATA_BLOCK_INTERFACE_POWER_SEQUENCING 0x0d
> +#define DATA_BLOCK_TRANSFER_CHARACTERISTICS 0x0e
> +#define DATA_BLOCK_DISPLAY_INTERFACE 0x0f
> +#define DATA_BLOCK_STEREO_DISPLAY_INTERFACE 0x10
> +#define DATA_BLOCK_TILED_DISPLAY 0x12
> +
> +#define DATA_BLOCK_VENDOR_SPECIFIC 0x7f
> +
> +#define PRODUCT_TYPE_EXTENSION 0
> +#define PRODUCT_TYPE_TEST 1
> +#define PRODUCT_TYPE_PANEL 2
> +#define PRODUCT_TYPE_MONITOR 3
> +#define PRODUCT_TYPE_TV 4
> +#define PRODUCT_TYPE_REPEATER 5
> +#define PRODUCT_TYPE_DIRECT_DRIVE 6
> +
> +struct displayid_hdr {
> + u8 rev;
> + u8 bytes;
> + u8 prod_id;
> + u8 ext_count;
> +} __attribute__((packed));

__packed is preferred now I think.

BR,
Jani.


> +
> +struct displayid_block {
> + u8 tag;
> + u8 rev;
> + u8 num_bytes;
> +};
> +
> +struct displayid_tiled_block {
> + struct displayid_block base;
> + u8 tile_cap;
> + u8 topo[3];
> + u8 tile_size[4];
> + u8 tile_pixel_bezel[5];
> + u8 topology_id[8];
> +} __attribute__((packed));
> +
> +#endif
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index b96031d..3e87f5a 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -27,12 +27,14 @@
>  
>  #define EDID_LENGTH 128
>  #define DDC_ADDR 0x50
> +#define DDC_ADDR2 0x52 /* E-DDC 1.2 - where DisplayID can hide */
>  
>  #define CEA_EXT  0x02
>  #define VTB_EXT  0x10
>  #define DI_EXT   0x40
>  #define LS_EXT   0x50
>  #define MI_EXT   0x60
> +#define DISPLAYID_EXT 0x70
>  
>  struct est_timings {
>   u8 t1;
> -- 
> 2.1.0
>
> ___
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center


[PATCH] drm/radeon: Use drm_malloc_ab instead of kmalloc_array

2014-10-20 Thread Michel Dänzer
From: Michel D?nzer 

Should avoid kmalloc failures due to large number of array entries.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81991
Signed-off-by: Michel D?nzer 
---
 drivers/gpu/drm/radeon/radeon_cs.c   | 2 +-
 drivers/gpu/drm/radeon/radeon_ring.c | 4 ++--
 drivers/gpu/drm/radeon/radeon_vm.c   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_cs.c 
b/drivers/gpu/drm/radeon/radeon_cs.c
index 1c89344..a3e7aed 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -450,7 +450,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser 
*parser, int error, bo
kfree(parser->track);
kfree(parser->relocs);
kfree(parser->relocs_ptr);
-   kfree(parser->vm_bos);
+   drm_free_large(parser->vm_bos);
for (i = 0; i < parser->nchunks; i++)
drm_free_large(parser->chunks[i].kdata);
kfree(parser->chunks);
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c 
b/drivers/gpu/drm/radeon/radeon_ring.c
index 596e591..51dcf40 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -314,7 +314,7 @@ unsigned radeon_ring_backup(struct radeon_device *rdev, 
struct radeon_ring *ring
}

/* and then save the content of the ring */
-   *data = kmalloc_array(size, sizeof(uint32_t), GFP_KERNEL);
+   *data = drm_malloc_ab(size, sizeof(uint32_t));
if (!*data) {
mutex_unlock(>ring_lock);
return 0;
@@ -356,7 +356,7 @@ int radeon_ring_restore(struct radeon_device *rdev, struct 
radeon_ring *ring,
}

radeon_ring_unlock_commit(rdev, ring, false);
-   kfree(data);
+   drm_free_large(data);
return 0;
 }

diff --git a/drivers/gpu/drm/radeon/radeon_vm.c 
b/drivers/gpu/drm/radeon/radeon_vm.c
index 4532cc7..dfde266 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -132,8 +132,8 @@ struct radeon_cs_reloc *radeon_vm_get_bos(struct 
radeon_device *rdev,
struct radeon_cs_reloc *list;
unsigned i, idx;

-   list = kmalloc_array(vm->max_pde_used + 2,
-sizeof(struct radeon_cs_reloc), GFP_KERNEL);
+   list = drm_malloc_ab(vm->max_pde_used + 2,
+sizeof(struct radeon_cs_reloc));
if (!list)
return NULL;

-- 
2.1.1



[RESEND] [PATCH] radeon: clean up coding style differences in radeon_get_bios()

2014-10-20 Thread Alex Deucher
On Thu, Oct 16, 2014 at 5:37 AM, Wilfried Klaebe
 wrote:
> radeon: clean up coding style differences in radeon_get_bios()
>
> Signed-off-by: Wilfried Klaebe 

Applied.  thanks!

Alex

>
> diff --git a/drivers/gpu/drm/radeon/radeon_bios.c 
> b/drivers/gpu/drm/radeon/radeon_bios.c
> index 6a03624..63ccb8f 100644
> --- a/drivers/gpu/drm/radeon/radeon_bios.c
> +++ b/drivers/gpu/drm/radeon/radeon_bios.c
> @@ -658,12 +658,10 @@ bool radeon_get_bios(struct radeon_device *rdev)
> r = igp_read_bios_from_vram(rdev);
> if (r == false)
> r = radeon_read_bios(rdev);
> -   if (r == false) {
> +   if (r == false)
> r = radeon_read_disabled_bios(rdev);
> -   }
> -   if (r == false) {
> +   if (r == false)
> r = radeon_read_platform_bios(rdev);
> -   }
> if (r == false || rdev->bios == NULL) {
> DRM_ERROR("Unable to locate a BIOS ROM\n");
> rdev->bios = NULL;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
>
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 15/15] drm/panel: Add Sharp LQ101R1SX01 support

2014-10-20 Thread Andrzej Hajda
On 10/13/2014 12:16 PM, Thierry Reding wrote:
> From: Thierry Reding 
>
> This panel requires dual-channel mode. The device accepts command-mode
> data on 8 lanes and will therefore need a dual-channel DSI controller.
> The two interfaces that make up this device need to be instantiated in
> the controllers that gang up to provide the dual-channel DSI host.
>
> Signed-off-by: Thierry Reding 
> ---
>  .../bindings/panel/sharp,lq101r1sx01.txt   |  46 +++
>  drivers/gpu/drm/panel/Kconfig  |  13 +
>  drivers/gpu/drm/panel/Makefile |   1 +
>  drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c| 426 
> +
>  4 files changed, 486 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/panel/sharp,lq101r1sx01.txt
>  create mode 100644 drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
>
> diff --git a/Documentation/devicetree/bindings/panel/sharp,lq101r1sx01.txt 
> b/Documentation/devicetree/bindings/panel/sharp,lq101r1sx01.txt
> new file mode 100644
> index ..4ab4380ddac8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/panel/sharp,lq101r1sx01.txt
> @@ -0,0 +1,46 @@
> +Sharp Microelectronics 10.1" WQXGA TFT LCD panel
> +
> +This panel requires a dual-channel DSI host to operate. It supports two 
> modes:
> +- left-right: each channel drives the left or right half of the screen
> +- even-odd: each channel drives the even or odd lines of the screen
> +
> +Each of the DSI channels controls a separate DSI peripheral. The peripheral
> +driven by the first link (DSI-LINK1), left or even, is considered the primary
> +peripheral and controls the device. The 'link2' property contains a phandle
> +to the peripheral driven by the second link (DSI-LINK2, right or odd).
> +
> +Note that in video mode the DSI-LINK1 interface always provides the left/even
> +pixels and DSI-LINK2 always provides the right/odd pixels. In command mode it
> +is possible to program either link to drive the left/even or right/odd pixels
> +but for the sake of consistency this binding assumes that the same assignment
> +is chosen as for video mode.
> +
> +Required properties:
> +- compatible: should be "sharp,lq101r1sx01"
> +- link2: phandle to the DSI peripheral on the secondary link. Note that the
> +  presence of this property marks the containing node as DSI-LINK1.
> +- power-supply: phandle of the regulator that provides the supply voltage
> +
> +Optional properties:
> +- backlight: phandle of the backlight device attached to the panel
> +
> +Example:
> +
> + dsi at 5430 {
> + panel: panel at 0 {
> + compatible = "sharp,lq101r1sx01";
> + reg = <0>;
> +
> + link2 = <>;
> +
> + power-supply = <...>;
> + backlight = <...>;
> + };
> + };
> +
> + dsi at 5440 {
> + secondary: panel at 0 {
> + compatible = "sharp,lq101r1sx01";
> + reg = <0>;
> + };
> + };

The example does not follow rules above, 2nd node does not contain
required properties.
Maybe it should be clearly stated that power-supply, link2 and backlight
properties can
be present only in LINK1 node; LINK2 node should contain nothing more
than compatible and reg.

I guess if it wouldn't be better if different compatibles could be used
to distinguish LINK1 and LINK2 nodes,
this way you can provide different sets of required/optional properties
for both nodes. As a bonus you can
have different probe/remove/shutdown callback per link.

> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index bee9f72b3a93..024e98ef8e4d 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -27,4 +27,17 @@ config DRM_PANEL_S6E8AA0
>   select DRM_MIPI_DSI
>   select VIDEOMODE_HELPERS
>  
> +config DRM_PANEL_SHARP_LQ101R1SX01
> + tristate "Sharp LQ101R1SX01 panel"
> + depends on OF
> + depends on DRM_MIPI_DSI
> + help
> +   Say Y here if you want to enable support for Sharp LQ101R1SX01
> +   TFT-LCD modules. The panel has a 2560x1600 resolution and uses
> +   24 bit RGB per pixel. It provides a dual MIPI DSI interface to
> +   the host and has a built-in LED backlight.
> +
> +   To compile this driver as a module, choose M here: the module
> +   will be called panel-sharp-lq101r1sx01.
> +
>  endmenu
> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index 8b929212fad7..4b2a0430804b 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -1,3 +1,4 @@
>  obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
>  obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o
>  obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o
> +obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
> diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c 

[Intel-gfx] [PATCH 5/6] drm/tile: expose the tile property to userspace

2014-10-20 Thread Daniel Vetter
On Mon, Oct 20, 2014 at 05:34:11PM +0200, Daniel Vetter wrote:
> On Mon, Oct 20, 2014 at 05:31:51PM +0200, Daniel Vetter wrote:
> > On Mon, Oct 20, 2014 at 04:37:15PM +1000, Dave Airlie wrote:
> > > From: Dave Airlie 
> > > 
> > > This takes the tiling info from the connector and
> > > exposes it to userspace, as a blob object in a
> > > connector property.
> > > 
> > > The contents of the blob is ABI.
> > > 
> > > Signed-off-by: Dave Airlie 
> > > ---
> > >  drivers/gpu/drm/drm_crtc.c  | 36 
> > > 
> > >  drivers/gpu/drm/i915/intel_dp_mst.c |  2 ++
> > >  include/drm/drm_crtc.h  |  4 
> > >  3 files changed, 42 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > > index 93135d4..81e867a 100644
> > > --- a/drivers/gpu/drm/drm_crtc.c
> > > +++ b/drivers/gpu/drm/drm_crtc.c
> > > @@ -1319,6 +1319,11 @@ static int 
> > > drm_mode_create_standard_connector_properties(struct drm_device *dev)
> > >  "PATH", 0);
> > >   dev->mode_config.path_property = dev_path;
> > >  
> > > + dev->mode_config.tile_property = drm_property_create(dev,
> > > +  DRM_MODE_PROP_BLOB 
> > > |
> > > +  
> > > DRM_MODE_PROP_IMMUTABLE,
> > > +  "TILE", 0);
> > > +
> > >   return 0;
> > >  }
> > >  
> > > @@ -4004,6 +4009,37 @@ int drm_mode_connector_set_path_property(struct 
> > > drm_connector *connector,
> > >  }
> > >  EXPORT_SYMBOL(drm_mode_connector_set_path_property);
> > >  
> > > +int drm_mode_connector_set_tile_property(struct drm_connector *connector)
> > 
> > Same again, please add some kerneldoc for this function here.
> 
> While at it, please also add the missing kerneldoc for the functions
> you've already added for dp mst support.

And the docbook xml table with all the properties we have should also be
updated for both of them.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


[Intel-gfx] [PATCH 5/6] drm/tile: expose the tile property to userspace

2014-10-20 Thread Daniel Vetter
On Mon, Oct 20, 2014 at 05:31:51PM +0200, Daniel Vetter wrote:
> On Mon, Oct 20, 2014 at 04:37:15PM +1000, Dave Airlie wrote:
> > From: Dave Airlie 
> > 
> > This takes the tiling info from the connector and
> > exposes it to userspace, as a blob object in a
> > connector property.
> > 
> > The contents of the blob is ABI.
> > 
> > Signed-off-by: Dave Airlie 
> > ---
> >  drivers/gpu/drm/drm_crtc.c  | 36 
> > 
> >  drivers/gpu/drm/i915/intel_dp_mst.c |  2 ++
> >  include/drm/drm_crtc.h  |  4 
> >  3 files changed, 42 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > index 93135d4..81e867a 100644
> > --- a/drivers/gpu/drm/drm_crtc.c
> > +++ b/drivers/gpu/drm/drm_crtc.c
> > @@ -1319,6 +1319,11 @@ static int 
> > drm_mode_create_standard_connector_properties(struct drm_device *dev)
> >"PATH", 0);
> > dev->mode_config.path_property = dev_path;
> >  
> > +   dev->mode_config.tile_property = drm_property_create(dev,
> > +DRM_MODE_PROP_BLOB 
> > |
> > +
> > DRM_MODE_PROP_IMMUTABLE,
> > +"TILE", 0);
> > +
> > return 0;
> >  }
> >  
> > @@ -4004,6 +4009,37 @@ int drm_mode_connector_set_path_property(struct 
> > drm_connector *connector,
> >  }
> >  EXPORT_SYMBOL(drm_mode_connector_set_path_property);
> >  
> > +int drm_mode_connector_set_tile_property(struct drm_connector *connector)
> 
> Same again, please add some kerneldoc for this function here.

While at it, please also add the missing kerneldoc for the functions
you've already added for dp mst support.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


[Bug 82889] [drm:si_dpm_set_power_state] *ERROR* si_disable_ulv failed

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82889

--- Comment #22 from Lorenzo Bona  ---
Created attachment 108125
  --> https://bugs.freedesktop.org/attachment.cgi?id=108125=edit
dmesg | grep drm

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/6a7bd59f/attachment.html>


[Bug 82889] [drm:si_dpm_set_power_state] *ERROR* si_disable_ulv failed

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82889

--- Comment #21 from Lorenzo Bona  ---
I've rebuilded today the whole stack (mesa, ddx, drm, xorg, and kernel) with
latest commit. 

Looks like the problem is now solved. Dmesg attached.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/11d7dd0c/attachment.html>


[PATCH 2/6] drm: add tile_group support.

2014-10-20 Thread Daniel Vetter
On Mon, Oct 20, 2014 at 04:37:12PM +1000, Dave Airlie wrote:
> From: Dave Airlie 
> 
> A tile group is an identifier shared by a single monitor,
> DisplayID topology has 8 bytes we can use for this, just
> use those for now until something else comes up in the
> future. We assign these to an idr and use the idr to
> tell userspace what connectors are in the same tile group.
> 
> DisplayID v1.3 says the serial number must be unique for
> displays from the same manufacturer.
> 
> Signed-off-by: Dave Airlie 
> ---
>  drivers/gpu/drm/drm_crtc.c | 61 
> ++
>  include/drm/drm_crtc.h | 16 
>  2 files changed, 77 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 90e7730..dfccc34 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -5037,6 +5037,7 @@ void drm_mode_config_init(struct drm_device *dev)
>   INIT_LIST_HEAD(>mode_config.property_blob_list);
>   INIT_LIST_HEAD(>mode_config.plane_list);
>   idr_init(>mode_config.crtc_idr);
> + idr_init(>mode_config.tile_idr);
>  
>   drm_modeset_lock_all(dev);
>   drm_mode_create_standard_connector_properties(dev);
> @@ -5146,3 +5147,63 @@ struct drm_property 
> *drm_mode_create_rotation_property(struct drm_device *dev,
>  supported_rotations);
>  }
>  EXPORT_SYMBOL(drm_mode_create_rotation_property);
> +
> +static void drm_tile_group_free(struct kref *kref)
> +{
> + struct drm_tile_group *tg = container_of(kref, struct drm_tile_group, 
> refcount);
> + struct drm_device *dev = tg->dev;
> + mutex_lock(>mode_config.idr_mutex);
> + idr_remove(>mode_config.tile_idr, tg->id);
> + mutex_lock(>mode_config.idr_mutex);
> + kfree(tg);
> +}
> +
> +void drm_mode_put_tile_group(struct drm_device *dev,
> +  struct drm_tile_group *tg)
> +{
> + kref_put(>refcount, drm_tile_group_free);
> +}
> +
> +struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
> +char topology[8])
> +{
> + struct drm_tile_group *tg;
> + int id;
> + mutex_lock(>mode_config.idr_mutex);
> + idr_for_each_entry(>mode_config.tile_idr, tg, id) {
> + if (!memcmp(tg->group_data, topology, 8)) {
> + kref_get(>refcount);

Don't you need a kref_get_unless_zero here since we only destroy the idr
entry after the refcount dropped to zero? Or is there some magic thing
that prevents this like another mutex (in which case some mutex assert in
get/put would be good)?

And kerneldoc for the non-exported functions please, preferrably with some
overview DOC: section to pull it all together.
-Daniel

> + mutex_unlock(>mode_config.idr_mutex);
> + return tg;
> + }
> + }
> + mutex_unlock(>mode_config.idr_mutex);
> + return NULL;
> +}
> +
> +struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
> +   char topology[8])
> +{
> + struct drm_tile_group *tg;
> + int ret;
> +
> + tg = kzalloc(sizeof(*tg), GFP_KERNEL);
> + if (!tg)
> + return ERR_PTR(-ENOMEM);
> +
> + kref_init(>refcount);
> + memcpy(tg->group_data, topology, 8);
> + tg->dev = dev;
> +
> + mutex_lock(>mode_config.idr_mutex);
> + ret = idr_alloc(>mode_config.tile_idr, tg, 1, 0, GFP_KERNEL);
> + if (ret >= 0) {
> + tg->id = ret;
> + } else {
> + kfree(tg);
> + tg = NULL;
> + }
> +
> + mutex_unlock(>mode_config.idr_mutex);
> + return tg;
> +}
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index f1105d0..afaec4b 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -136,6 +136,14 @@ struct drm_display_info {
>   u8 cea_rev;
>  };
>  
> +/* data corresponds to displayid vend/prod/serial */
> +struct drm_tile_group {
> + struct kref refcount;
> + struct drm_device *dev;
> + int id;
> + u8 group_data[8];
> +};
> +
>  struct drm_framebuffer_funcs {
>   /* note: use drm_framebuffer_remove() */
>   void (*destroy)(struct drm_framebuffer *framebuffer);
> @@ -770,6 +778,7 @@ struct drm_mode_config {
>   struct drm_modeset_acquire_ctx *acquire_ctx; /* for legacy _lock_all() 
> / _unlock_all() */
>   struct mutex idr_mutex; /* for IDR management */
>   struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, 
> modes - just makes life easier */
> + struct idr tile_idr; /* use this idr for all IDs, fb, crtc, connector, 
> modes - just makes life easier */
>   /* this is limited to one for now */
>  
>  
> @@ -1106,6 +1115,13 @@ extern void drm_set_preferred_mode(struct 
> drm_connector *connector,
>  extern int drm_edid_header_is_valid(const u8 *raw_edid);
>  extern bool drm_edid_block_valid(u8 *raw_edid, int block, 

[Intel-gfx] [PATCH 5/6] drm/tile: expose the tile property to userspace

2014-10-20 Thread Daniel Vetter
On Mon, Oct 20, 2014 at 04:37:15PM +1000, Dave Airlie wrote:
> From: Dave Airlie 
> 
> This takes the tiling info from the connector and
> exposes it to userspace, as a blob object in a
> connector property.
> 
> The contents of the blob is ABI.
> 
> Signed-off-by: Dave Airlie 
> ---
>  drivers/gpu/drm/drm_crtc.c  | 36 
>  drivers/gpu/drm/i915/intel_dp_mst.c |  2 ++
>  include/drm/drm_crtc.h  |  4 
>  3 files changed, 42 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 93135d4..81e867a 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -1319,6 +1319,11 @@ static int 
> drm_mode_create_standard_connector_properties(struct drm_device *dev)
>  "PATH", 0);
>   dev->mode_config.path_property = dev_path;
>  
> + dev->mode_config.tile_property = drm_property_create(dev,
> +  DRM_MODE_PROP_BLOB 
> |
> +  
> DRM_MODE_PROP_IMMUTABLE,
> +  "TILE", 0);
> +
>   return 0;
>  }
>  
> @@ -4004,6 +4009,37 @@ int drm_mode_connector_set_path_property(struct 
> drm_connector *connector,
>  }
>  EXPORT_SYMBOL(drm_mode_connector_set_path_property);
>  
> +int drm_mode_connector_set_tile_property(struct drm_connector *connector)

Same again, please add some kerneldoc for this function here.
-Daniel

> +{
> + struct drm_device *dev = connector->dev;
> + int ret, size;
> + char tile[256];
> +
> + if (connector->tile_blob_ptr)
> + drm_property_destroy_blob(dev, connector->tile_blob_ptr);
> +
> + if (!connector->has_tile) {
> + connector->tile_blob_ptr = NULL;
> + ret = drm_object_property_set_value(>base,
> + 
> dev->mode_config.tile_property, 0);
> + return ret;
> + }
> +
> + snprintf(tile, 256, "%d:%d:%d:%d:%d:%d:%d:%d", 
> connector->tile_group->id, connector->tile_is_single_monitor, 
> connector->num_h_tile, connector->num_v_tile, connector->tile_h_loc, 
> connector->tile_v_loc, connector->tile_h_size, connector->tile_v_size);
> + size = strlen(tile) + 1;
> +
> + connector->tile_blob_ptr = drm_property_create_blob(connector->dev,
> + size, tile);
> + if (!connector->tile_blob_ptr)
> + return -EINVAL;
> +
> + ret = drm_object_property_set_value(>base,
> + dev->mode_config.tile_property,
> + connector->tile_blob_ptr->base.id);
> + return ret;
> +}
> +EXPORT_SYMBOL(drm_mode_connector_set_tile_property);
> +
>  /**
>   * drm_mode_connector_update_edid_property - update the edid property of a 
> connector
>   * @connector: drm connector
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c 
> b/drivers/gpu/drm/i915/intel_dp_mst.c
> index c66e73a..c5529ff 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -422,6 +422,8 @@ static struct drm_connector 
> *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
>   intel_dp_add_properties(intel_dp, connector);
>  
>   drm_object_attach_property(>base, 
> dev->mode_config.path_property, 0);
> + drm_object_attach_property(>base, 
> dev->mode_config.tile_property, 0);
> +
>   drm_mode_connector_set_path_property(connector, pathprop);
>   drm_reinit_primary_mode_group(dev);
>   mutex_lock(>mode_config.mutex);
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index d71b6d7..39d744b 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -548,6 +548,8 @@ struct drm_connector {
>  
>   struct drm_property_blob *path_blob_ptr;
>  
> + struct drm_property_blob *tile_blob_ptr;
> +
>   uint8_t polled; /* DRM_CONNECTOR_POLL_* */
>  
>   /* requested DPMS state */
> @@ -838,6 +840,7 @@ struct drm_mode_config {
>   struct drm_property *edid_property;
>   struct drm_property *dpms_property;
>   struct drm_property *path_property;
> + struct drm_property *tile_property;
>   struct drm_property *plane_type_property;
>  
>   /* DVI-I properties */
> @@ -990,6 +993,7 @@ extern void drm_mode_config_cleanup(struct drm_device 
> *dev);
>  
>  extern int drm_mode_connector_set_path_property(struct drm_connector 
> *connector,
>   char *path);
> +int drm_mode_connector_set_tile_property(struct drm_connector *connector);
>  extern int drm_mode_connector_update_edid_property(struct drm_connector 
> *connector,
>   struct edid *edid);
>  
> -- 
> 2.1.0
> 
> ___
> Intel-gfx mailing list
> Intel-gfx at 

[Bug 84944] tearing on radeonsi vdpau deinterlacer

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=84944

--- Comment #7 from warpme at o2.pl ---
(In reply to Christian K?nig from comment #5)
> The deinterlacer is hardware independent and so it's rather unlikely that it
> is the source of the problem.
> 
> Can you grab a trace of MythTV with VDPAU_TRACE=1 in the environment once
> with and once without deinterlacing enabled? This way we can see what MythTV
> is actually doing.

Adding VDPAU_TRACE=1 causes stop working VDPAU (MythTV switches to ffmpeg).
I can try to investigate this - if You believe it is worth 

For me results from tests Michel suggested shows issue is within GLAMOR as
Brazos without GLAMOR works OK while Brazos with GLAMOR NOK. As Kabini by
default requires GLAMOR - by default I have issue on Kabini. 

Both Brazos and Kabini are tested from exactly the same PXE booted image so if
Myth has working DI on Brazos - it is asking exactly the same way (and I
believe correctly) for DI on Kabini.

On the other hand - only on AMD I have in MythTV logs something like this:

"W OpenGL: Could not determine whether Sync to VBlank is enabled."

On Intel OSS and Nvidia proprietary drivers MythTV reports sync-to-blank works
OK. But as - despite this warning - Brazos DI work nicely - I think this
probably isn't root cause...


br

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/3569a41f/attachment-0001.html>


[Bug 85207] agd5f drm-next-3.19-wip + Unreal Elemental sometimes = list_add corruption/hung task

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=85207

--- Comment #3 from Andy Furniss  ---
(In reply to Michel D?nzer from comment #2)
> (In reply to Andy Furniss from comment #0)
> > Haven't seen on drm-next-3.18-wip
> 
> Can you bisect the kernel?

May be a bit early, but I will sit on the one before for a while to confirm.

Looks like the head commit -

commit bb9a49819ed30f3f5782b2504066547a8507a591
Author: Christian K?nig 
Date:   Mon Oct 13 12:41:47 2014 +0200

drm/radeon: update the VM after setting BO address

This way the necessary VM update is kicked off immediately
if all BOs involved are in GPU accessible memory.

I haven't managed to lock or get Valley to GPU fault on the one before so far.

FWIW I noticed even on head the valley fault doesn't always happen - it seems
that I need to have set my CPUs to perf (which I nearly always do when testing
things like this). With cpufreq ondemand I didn't see the fault.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/4327fa3c/attachment.html>


[Bug 84944] tearing on radeonsi vdpau deinterlacer

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=84944

--- Comment #6 from warpme at o2.pl ---
(In reply to Michel D?nzer from comment #4)
> Can you get the same or at least similar tearing on Brazos with
> 
>  Option "SwapbuffersWait" "off"

With this option I started to have tearing on Brazos. A bit different than
reported on Kabini: it is present randomly on whole screen.
> 
> or
> 
>  Option "AccelMethod" "glamor"

With this option I started to have tearing on Brazos almost exactly the same
like on Kabini.

> 
> in xorg.conf? If yes, the problem is that page flipping cannot be used for
> the MythTV window, most likely because its dimensions do not match the X11
> screen dimensions.

MythTV works here in full-screen. DI (also 2xHW) works OK on Brazos but not on
Kabini. As enabling GLAMOR on Brazos causes exactly the same DI issue on Brazos
- isn't issue within GLAMOR?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/8376ed83/attachment.html>


[PATCH 6/6] drm/fb: add support for tiled monitor configurations.

2014-10-20 Thread Dave Airlie
From: Dave Airlie 

This adds fbdev/con support for tiled monitors, so that we
only set a mode on the correct half of the monitor, or
span the two halves if needed.

Signed-off-by: Dave Airlie 
---
 drivers/gpu/drm/drm_fb_helper.c| 122 +++--
 drivers/gpu/drm/i915/intel_fbdev.c |  25 +++-
 include/drm/drm_fb_helper.h|   6 ++
 3 files changed, 130 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 3144db9..095f9d5 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1042,19 +1042,21 @@ static int drm_fb_helper_single_fb_probe(struct 
drm_fb_helper *fb_helper,
crtc_count = 0;
for (i = 0; i < fb_helper->crtc_count; i++) {
struct drm_display_mode *desired_mode;
+   int x, y;
desired_mode = fb_helper->crtc_info[i].desired_mode;
-
+   x = fb_helper->crtc_info[i].x;
+   y = fb_helper->crtc_info[i].y;
if (desired_mode) {
if (gamma_size == 0)
gamma_size = 
fb_helper->crtc_info[i].mode_set.crtc->gamma_size;
-   if (desired_mode->hdisplay < sizes.fb_width)
-   sizes.fb_width = desired_mode->hdisplay;
-   if (desired_mode->vdisplay < sizes.fb_height)
-   sizes.fb_height = desired_mode->vdisplay;
-   if (desired_mode->hdisplay > sizes.surface_width)
-   sizes.surface_width = desired_mode->hdisplay;
-   if (desired_mode->vdisplay > sizes.surface_height)
-   sizes.surface_height = desired_mode->vdisplay;
+   if (desired_mode->hdisplay + x < sizes.fb_width)
+   sizes.fb_width = desired_mode->hdisplay + x;
+   if (desired_mode->vdisplay + y < sizes.fb_height)
+   sizes.fb_height = desired_mode->vdisplay + y;
+   if (desired_mode->hdisplay + x > sizes.surface_width)
+   sizes.surface_width = desired_mode->hdisplay + 
x;
+   if (desired_mode->vdisplay + y > sizes.surface_height)
+   sizes.surface_height = desired_mode->vdisplay + 
y;
crtc_count++;
}
}
@@ -1356,6 +1358,7 @@ static void drm_enable_connectors(struct drm_fb_helper 
*fb_helper,

 static bool drm_target_cloned(struct drm_fb_helper *fb_helper,
  struct drm_display_mode **modes,
+ struct drm_fb_offset *offsets,
  bool *enabled, int width, int height)
 {
int count, i, j;
@@ -1427,27 +1430,88 @@ static bool drm_target_cloned(struct drm_fb_helper 
*fb_helper,
return false;
 }

+static int drm_get_tile_offsets(struct drm_fb_helper *fb_helper,
+   struct drm_display_mode **modes,
+   struct drm_fb_offset *offsets,
+   int idx,
+   int h_idx, int v_idx)
+{
+   struct drm_fb_helper_connector *fb_helper_conn;
+   int i;
+   int hoffset = 0, voffset = 0;
+
+   for (i = 0; i < fb_helper->connector_count; i++) {
+   fb_helper_conn = fb_helper->connector_info[i];
+   if (!fb_helper_conn->connector->has_tile)
+   continue;
+
+   if (!modes[i] && (h_idx || v_idx)) {
+   DRM_DEBUG_KMS("no modes for connector tiled %d %d\n", i,
+ fb_helper_conn->connector->base.id);
+   continue;
+   }
+   if (fb_helper_conn->connector->tile_h_loc < h_idx)
+   hoffset += modes[i]->hdisplay;
+
+   if (fb_helper_conn->connector->tile_v_loc < v_idx)
+   voffset += modes[i]->vdisplay;
+   }
+   offsets[idx].x = hoffset;
+   offsets[idx].y = voffset;
+   DRM_DEBUG_KMS("returned %d %d for %d %d\n", hoffset, voffset, h_idx, 
v_idx);
+   return 0;
+}
+
 static bool drm_target_preferred(struct drm_fb_helper *fb_helper,
 struct drm_display_mode **modes,
+struct drm_fb_offset *offsets,
 bool *enabled, int width, int height)
 {
struct drm_fb_helper_connector *fb_helper_conn;
int i;
-
+   uint64_t conn_configured = 0, mask;
+   int tile_pass = 0;
+   mask = (1 << fb_helper->connector_count) - 1;
+retry:
for (i = 0; i < fb_helper->connector_count; i++) {
fb_helper_conn = fb_helper->connector_info[i];

-   if (enabled[i] == false)
+   if (conn_configured & 

[PATCH 5/6] drm/tile: expose the tile property to userspace

2014-10-20 Thread Dave Airlie
From: Dave Airlie 

This takes the tiling info from the connector and
exposes it to userspace, as a blob object in a
connector property.

The contents of the blob is ABI.

Signed-off-by: Dave Airlie 
---
 drivers/gpu/drm/drm_crtc.c  | 36 
 drivers/gpu/drm/i915/intel_dp_mst.c |  2 ++
 include/drm/drm_crtc.h  |  4 
 3 files changed, 42 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 93135d4..81e867a 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1319,6 +1319,11 @@ static int 
drm_mode_create_standard_connector_properties(struct drm_device *dev)
   "PATH", 0);
dev->mode_config.path_property = dev_path;

+   dev->mode_config.tile_property = drm_property_create(dev,
+DRM_MODE_PROP_BLOB 
|
+
DRM_MODE_PROP_IMMUTABLE,
+"TILE", 0);
+
return 0;
 }

@@ -4004,6 +4009,37 @@ int drm_mode_connector_set_path_property(struct 
drm_connector *connector,
 }
 EXPORT_SYMBOL(drm_mode_connector_set_path_property);

+int drm_mode_connector_set_tile_property(struct drm_connector *connector)
+{
+   struct drm_device *dev = connector->dev;
+   int ret, size;
+   char tile[256];
+
+   if (connector->tile_blob_ptr)
+   drm_property_destroy_blob(dev, connector->tile_blob_ptr);
+
+   if (!connector->has_tile) {
+   connector->tile_blob_ptr = NULL;
+   ret = drm_object_property_set_value(>base,
+   
dev->mode_config.tile_property, 0);
+   return ret;
+   }
+
+   snprintf(tile, 256, "%d:%d:%d:%d:%d:%d:%d:%d", 
connector->tile_group->id, connector->tile_is_single_monitor, 
connector->num_h_tile, connector->num_v_tile, connector->tile_h_loc, 
connector->tile_v_loc, connector->tile_h_size, connector->tile_v_size);
+   size = strlen(tile) + 1;
+
+   connector->tile_blob_ptr = drm_property_create_blob(connector->dev,
+   size, tile);
+   if (!connector->tile_blob_ptr)
+   return -EINVAL;
+
+   ret = drm_object_property_set_value(>base,
+   dev->mode_config.tile_property,
+   connector->tile_blob_ptr->base.id);
+   return ret;
+}
+EXPORT_SYMBOL(drm_mode_connector_set_tile_property);
+
 /**
  * drm_mode_connector_update_edid_property - update the edid property of a 
connector
  * @connector: drm connector
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c 
b/drivers/gpu/drm/i915/intel_dp_mst.c
index c66e73a..c5529ff 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -422,6 +422,8 @@ static struct drm_connector 
*intel_dp_add_mst_connector(struct drm_dp_mst_topolo
intel_dp_add_properties(intel_dp, connector);

drm_object_attach_property(>base, 
dev->mode_config.path_property, 0);
+   drm_object_attach_property(>base, 
dev->mode_config.tile_property, 0);
+
drm_mode_connector_set_path_property(connector, pathprop);
drm_reinit_primary_mode_group(dev);
mutex_lock(>mode_config.mutex);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index d71b6d7..39d744b 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -548,6 +548,8 @@ struct drm_connector {

struct drm_property_blob *path_blob_ptr;

+   struct drm_property_blob *tile_blob_ptr;
+
uint8_t polled; /* DRM_CONNECTOR_POLL_* */

/* requested DPMS state */
@@ -838,6 +840,7 @@ struct drm_mode_config {
struct drm_property *edid_property;
struct drm_property *dpms_property;
struct drm_property *path_property;
+   struct drm_property *tile_property;
struct drm_property *plane_type_property;

/* DVI-I properties */
@@ -990,6 +993,7 @@ extern void drm_mode_config_cleanup(struct drm_device *dev);

 extern int drm_mode_connector_set_path_property(struct drm_connector 
*connector,
char *path);
+int drm_mode_connector_set_tile_property(struct drm_connector *connector);
 extern int drm_mode_connector_update_edid_property(struct drm_connector 
*connector,
struct edid *edid);

-- 
2.1.0



[PATCH 4/6] drm/connector: store tile information from displayid

2014-10-20 Thread Dave Airlie
From: Dave Airlie 

This creates a tile group from DisplayID block, and
stores the pieces of parsed info from the DisplayID block
into the connector.
---
 drivers/gpu/drm/drm_crtc.c |   5 ++
 drivers/gpu/drm/drm_edid.c | 139 -
 include/drm/drm_crtc.h |   9 +++
 3 files changed, 151 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index dfccc34..93135d4 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -939,6 +939,11 @@ void drm_connector_cleanup(struct drm_connector *connector)
struct drm_device *dev = connector->dev;
struct drm_display_mode *mode, *t;

+   if (connector->tile_group) {
+   drm_mode_put_tile_group(dev, connector->tile_group);
+   connector->tile_group = NULL;
+   }
+
list_for_each_entry_safe(mode, t, >probed_modes, head)
drm_mode_remove(connector, mode);

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 1dbf3bc..7cbdbe5 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 

 #define version_greater(edid, maj, min) \
(((edid)->version > (maj)) || \
@@ -1014,6 +1015,8 @@ module_param_named(edid_fixup, edid_fixup, int, 0400);
 MODULE_PARM_DESC(edid_fixup,
 "Minimum number of valid EDID header bytes (0-8, default 6)");

+static void drm_get_displayid(struct drm_connector *connector,
+ struct edid *edid);
 /**
  * drm_edid_block_valid - Sanity check the EDID block (base or extension)
  * @raw_edid: pointer to raw EDID block
@@ -1294,6 +1297,8 @@ struct edid *drm_get_edid(struct drm_connector *connector,
if (drm_probe_ddc(adapter))
edid = (struct edid *)drm_do_get_edid(connector, adapter);

+   if (edid)
+   drm_get_displayid(connector, edid);
return edid;
 }
 EXPORT_SYMBOL(drm_get_edid);
@@ -2386,7 +2391,7 @@ add_detailed_modes(struct drm_connector *connector, 
struct edid *edid,
 /*
  * Search EDID for CEA extension block.
  */
-static u8 *drm_find_cea_extension(struct edid *edid)
+static u8 *drm_find_edid_extension(struct edid *edid, int ext_id)
 {
u8 *edid_ext = NULL;
int i;
@@ -2398,7 +2403,7 @@ static u8 *drm_find_cea_extension(struct edid *edid)
/* Find CEA extension */
for (i = 0; i < edid->extensions; i++) {
edid_ext = (u8 *)edid + EDID_LENGTH * (i + 1);
-   if (edid_ext[0] == CEA_EXT)
+   if (edid_ext[0] == ext_id)
break;
}

@@ -2408,6 +2413,16 @@ static u8 *drm_find_cea_extension(struct edid *edid)
return edid_ext;
 }

+static u8 *drm_find_cea_extension(struct edid *edid)
+{
+   return drm_find_edid_extension(edid, CEA_EXT);
+}
+
+static u8 *drm_find_displayid_extension(struct edid *edid)
+{
+   return drm_find_edid_extension(edid, DISPLAYID_EXT);
+}
+
 /*
  * Calculate the alternate clock for the CEA mode
  * (60Hz vs. 59.94Hz etc.)
@@ -3865,3 +3880,123 @@ drm_hdmi_vendor_infoframe_from_display_mode(struct 
hdmi_vendor_infoframe *frame,
return 0;
 }
 EXPORT_SYMBOL(drm_hdmi_vendor_infoframe_from_display_mode);
+
+static int drm_parse_display_id(struct drm_connector *connector,
+   u8 *displayid, int length,
+   bool is_edid_extension)
+{
+   /* if this is an EDID extension the first byte will be 0x70 */
+   int idx = 0;
+   struct displayid_hdr *base;
+   struct displayid_block *block;
+   u8 csum = 0;
+   int i;
+
+   if (is_edid_extension)
+   idx = 1;
+
+   base = (struct displayid_hdr *)[idx];
+
+   printk("base revision 0x%x, length %d, %d %d\n",
+  base->rev, base->bytes, base->prod_id, base->ext_count);
+
+   if (base->bytes + 5 > length - idx)
+   return -EINVAL;
+
+   for (i = idx; i <= base->bytes + 5; i++) {
+   csum += displayid[i];
+   }
+   if (csum) {
+   DRM_ERROR("DisplayID checksum invalid, remainder is %d\n", 
csum);
+   return -EINVAL;
+   }
+
+   block = (struct displayid_block *)[idx + 4];
+   printk("block id %d, rev %d, len %d\n",
+  block->tag, block->rev, block->num_bytes);
+
+   switch (block->tag) {
+   case DATA_BLOCK_TILED_DISPLAY: {
+   struct displayid_tiled_block *tile = (struct 
displayid_tiled_block *)block;
+
+   u16 w, h;
+   u8 tile_v_loc, tile_h_loc;
+   u8 num_v_tile, num_h_tile;
+   struct drm_tile_group *tg;
+
+   w = tile->tile_size[0] | tile->tile_size[1] << 8;
+   h = tile->tile_size[2] | tile->tile_size[3] << 8;
+
+   num_v_tile = (tile->topo[0] & 0xf) | (tile->topo[2] & 0x30);
+   

[PATCH 3/6] drm/mst: cached EDID for logical ports

2014-10-20 Thread Dave Airlie
From: Dave Airlie 

Logical ports are never going to have EDID changes,
they are used for the internal ports on MST monitors.

We cache the EDIDs from these to save time at MST probe.

Signed-off-by: Dave Airlie 
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 20 ++--
 drivers/gpu/drm/i915/intel_dp_mst.c   |  2 +-
 include/drm/drm_dp_mst_helper.h   |  4 +++-
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
b/drivers/gpu/drm/drm_dp_mst_topology.c
index 50926db..ce1113c 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -858,6 +858,8 @@ static void drm_dp_destroy_port(struct kref *kref)
struct drm_dp_mst_topology_mgr *mgr = port->mgr;
if (!port->input) {
port->vcpi.num_slots = 0;
+
+   kfree(port->cached_edid);
if (port->connector)
(*port->mgr->cbs->destroy_connector)(mgr, 
port->connector);
drm_dp_port_teardown_pdt(port, port->pdt);
@@ -1096,6 +1098,10 @@ static void drm_dp_add_port(struct drm_dp_mst_branch 
*mstb,
char proppath[255];
build_mst_prop_path(port, mstb, proppath);
port->connector = (*mstb->mgr->cbs->add_connector)(mstb->mgr, 
port, proppath);
+
+   if (port->port_num >= 8) {
+   port->cached_edid = drm_get_edid(port->connector, 
>aux.ddc);
+   }
}

/* put reference to this port */
@@ -2149,7 +2155,8 @@ EXPORT_SYMBOL(drm_dp_mst_hpd_irq);
  * This returns the current connection state for a port. It validates the
  * port pointer still exists so the caller doesn't require a reference
  */
-enum drm_connector_status drm_dp_mst_detect_port(struct 
drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port)
+enum drm_connector_status drm_dp_mst_detect_port(struct drm_connector 
*connector,
+struct drm_dp_mst_topology_mgr 
*mgr, struct drm_dp_mst_port *port)
 {
enum drm_connector_status status = connector_status_disconnected;

@@ -2168,6 +2175,10 @@ enum drm_connector_status drm_dp_mst_detect_port(struct 
drm_dp_mst_topology_mgr

case DP_PEER_DEVICE_SST_SINK:
status = connector_status_connected;
+   /* for logical ports - cache the EDID */
+   if (port->port_num >= 8 && !port->cached_edid) {
+   port->cached_edid = drm_get_edid(connector, 
>aux.ddc);
+   }
break;
case DP_PEER_DEVICE_DP_LEGACY_CONV:
if (port->ldps)
@@ -2199,7 +2210,12 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector 
*connector, struct drm_dp_
if (!port)
return NULL;

-   edid = drm_get_edid(connector, >aux.ddc);
+   if (port->cached_edid)
+   edid = drm_edid_duplicate(port->cached_edid);
+   else
+   edid = drm_get_edid(connector, >aux.ddc);
+
+   drm_mode_connector_set_tile_property(connector);
drm_dp_put_port(port);
return edid;
 }
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c 
b/drivers/gpu/drm/i915/intel_dp_mst.c
index d9a7a78..c66e73a 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -283,7 +283,7 @@ intel_mst_port_dp_detect(struct drm_connector *connector)
struct intel_connector *intel_connector = to_intel_connector(connector);
struct intel_dp *intel_dp = intel_connector->mst_port;

-   return drm_dp_mst_detect_port(_dp->mst_mgr, 
intel_connector->port);
+   return drm_dp_mst_detect_port(connector, _dp->mst_mgr, 
intel_connector->port);
 }

 static enum drm_connector_status
diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
index 338fc10..ee6fbad 100644
--- a/include/drm/drm_dp_mst_helper.h
+++ b/include/drm/drm_dp_mst_helper.h
@@ -92,6 +92,8 @@ struct drm_dp_mst_port {
struct drm_dp_vcpi vcpi;
struct drm_connector *connector;
struct drm_dp_mst_topology_mgr *mgr;
+
+   struct edid *cached_edid; /* for DP logical ports - make tiling work */
 };

 /**
@@ -474,7 +476,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct 
drm_dp_mst_topology_mgr *mgr, bool ms
 int drm_dp_mst_hpd_irq(struct drm_dp_mst_topology_mgr *mgr, u8 *esi, bool 
*handled);


-enum drm_connector_status drm_dp_mst_detect_port(struct 
drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
+enum drm_connector_status drm_dp_mst_detect_port(struct drm_connector 
*connector, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);

 struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct 
drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);

-- 
2.1.0



[PATCH 2/6] drm: add tile_group support.

2014-10-20 Thread Dave Airlie
From: Dave Airlie 

A tile group is an identifier shared by a single monitor,
DisplayID topology has 8 bytes we can use for this, just
use those for now until something else comes up in the
future. We assign these to an idr and use the idr to
tell userspace what connectors are in the same tile group.

DisplayID v1.3 says the serial number must be unique for
displays from the same manufacturer.

Signed-off-by: Dave Airlie 
---
 drivers/gpu/drm/drm_crtc.c | 61 ++
 include/drm/drm_crtc.h | 16 
 2 files changed, 77 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 90e7730..dfccc34 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -5037,6 +5037,7 @@ void drm_mode_config_init(struct drm_device *dev)
INIT_LIST_HEAD(>mode_config.property_blob_list);
INIT_LIST_HEAD(>mode_config.plane_list);
idr_init(>mode_config.crtc_idr);
+   idr_init(>mode_config.tile_idr);

drm_modeset_lock_all(dev);
drm_mode_create_standard_connector_properties(dev);
@@ -5146,3 +5147,63 @@ struct drm_property 
*drm_mode_create_rotation_property(struct drm_device *dev,
   supported_rotations);
 }
 EXPORT_SYMBOL(drm_mode_create_rotation_property);
+
+static void drm_tile_group_free(struct kref *kref)
+{
+   struct drm_tile_group *tg = container_of(kref, struct drm_tile_group, 
refcount);
+   struct drm_device *dev = tg->dev;
+   mutex_lock(>mode_config.idr_mutex);
+   idr_remove(>mode_config.tile_idr, tg->id);
+   mutex_lock(>mode_config.idr_mutex);
+   kfree(tg);
+}
+
+void drm_mode_put_tile_group(struct drm_device *dev,
+struct drm_tile_group *tg)
+{
+   kref_put(>refcount, drm_tile_group_free);
+}
+
+struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
+  char topology[8])
+{
+   struct drm_tile_group *tg;
+   int id;
+   mutex_lock(>mode_config.idr_mutex);
+   idr_for_each_entry(>mode_config.tile_idr, tg, id) {
+   if (!memcmp(tg->group_data, topology, 8)) {
+   kref_get(>refcount);
+   mutex_unlock(>mode_config.idr_mutex);
+   return tg;
+   }
+   }
+   mutex_unlock(>mode_config.idr_mutex);
+   return NULL;
+}
+
+struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
+ char topology[8])
+{
+   struct drm_tile_group *tg;
+   int ret;
+
+   tg = kzalloc(sizeof(*tg), GFP_KERNEL);
+   if (!tg)
+   return ERR_PTR(-ENOMEM);
+
+   kref_init(>refcount);
+   memcpy(tg->group_data, topology, 8);
+   tg->dev = dev;
+
+   mutex_lock(>mode_config.idr_mutex);
+   ret = idr_alloc(>mode_config.tile_idr, tg, 1, 0, GFP_KERNEL);
+   if (ret >= 0) {
+   tg->id = ret;
+   } else {
+   kfree(tg);
+   tg = NULL;
+   }
+
+   mutex_unlock(>mode_config.idr_mutex);
+   return tg;
+}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index f1105d0..afaec4b 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -136,6 +136,14 @@ struct drm_display_info {
u8 cea_rev;
 };

+/* data corresponds to displayid vend/prod/serial */
+struct drm_tile_group {
+   struct kref refcount;
+   struct drm_device *dev;
+   int id;
+   u8 group_data[8];
+};
+
 struct drm_framebuffer_funcs {
/* note: use drm_framebuffer_remove() */
void (*destroy)(struct drm_framebuffer *framebuffer);
@@ -770,6 +778,7 @@ struct drm_mode_config {
struct drm_modeset_acquire_ctx *acquire_ctx; /* for legacy _lock_all() 
/ _unlock_all() */
struct mutex idr_mutex; /* for IDR management */
struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, 
modes - just makes life easier */
+   struct idr tile_idr; /* use this idr for all IDs, fb, crtc, connector, 
modes - just makes life easier */
/* this is limited to one for now */


@@ -1106,6 +1115,13 @@ extern void drm_set_preferred_mode(struct drm_connector 
*connector,
 extern int drm_edid_header_is_valid(const u8 *raw_edid);
 extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
 extern bool drm_edid_is_valid(struct edid *edid);
+
+extern struct drm_tile_group *drm_mode_create_tile_group(struct drm_device 
*dev,
+char topology[8]);
+extern struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
+  char topology[8]);
+extern void drm_mode_put_tile_group(struct drm_device *dev,
+  struct drm_tile_group *tg);
 struct drm_display_mode *drm_mode_find_dmt(struct 

[PATCH 1/6] drm/displayid: add displayid defines and edid extension

2014-10-20 Thread Dave Airlie
From: Dave Airlie 

These are just taken from the DisplayID v1.3 spec, and the
DDC spec.

Signed-off-by: Dave Airlie 
---
 include/drm/drm_displayid.h | 76 +
 include/drm/drm_edid.h  |  2 ++
 2 files changed, 78 insertions(+)
 create mode 100644 include/drm/drm_displayid.h

diff --git a/include/drm/drm_displayid.h b/include/drm/drm_displayid.h
new file mode 100644
index 000..1901003
--- /dev/null
+++ b/include/drm/drm_displayid.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright ? 2014 Red Hat Inc.
+ *
+ * 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
+ */
+#ifndef DRM_DISPLAYID_H
+#define DRM_DISPLAYID_H
+
+#define DATA_BLOCK_PRODUCT_ID 0x00
+#define DATA_BLOCK_DISPLAY_PARAMETERS 0x01
+#define DATA_BLOCK_COLOR_CHARACTERISTICS 0x02
+#define DATA_BLOCK_TYPE_1_DETAILED_TIMING 0x03
+#define DATA_BLOCK_TYPE_2_DETAILED_TIMING 0x04
+#define DATA_BLOCK_TYPE_3_SHORT_TIMING 0x05
+#define DATA_BLOCK_TYPE_4_DMT_TIMING 0x06
+#define DATA_BLOCK_VESA_TIMING 0x07
+#define DATA_BLOCK_CEA_TIMING 0x08
+#define DATA_BLOCK_VIDEO_TIMING_RANGE 0x09
+#define DATA_BLOCK_PRODUCT_SERIAL_NUMBER 0x0a
+#define DATA_BLOCK_GP_ASCII_STRING 0x0b
+#define DATA_BLOCK_DISPLAY_DEVICE_DATA 0x0c
+#define DATA_BLOCK_INTERFACE_POWER_SEQUENCING 0x0d
+#define DATA_BLOCK_TRANSFER_CHARACTERISTICS 0x0e
+#define DATA_BLOCK_DISPLAY_INTERFACE 0x0f
+#define DATA_BLOCK_STEREO_DISPLAY_INTERFACE 0x10
+#define DATA_BLOCK_TILED_DISPLAY 0x12
+
+#define DATA_BLOCK_VENDOR_SPECIFIC 0x7f
+
+#define PRODUCT_TYPE_EXTENSION 0
+#define PRODUCT_TYPE_TEST 1
+#define PRODUCT_TYPE_PANEL 2
+#define PRODUCT_TYPE_MONITOR 3
+#define PRODUCT_TYPE_TV 4
+#define PRODUCT_TYPE_REPEATER 5
+#define PRODUCT_TYPE_DIRECT_DRIVE 6
+
+struct displayid_hdr {
+   u8 rev;
+   u8 bytes;
+   u8 prod_id;
+   u8 ext_count;
+} __attribute__((packed));
+
+struct displayid_block {
+   u8 tag;
+   u8 rev;
+   u8 num_bytes;
+};
+
+struct displayid_tiled_block {
+   struct displayid_block base;
+   u8 tile_cap;
+   u8 topo[3];
+   u8 tile_size[4];
+   u8 tile_pixel_bezel[5];
+   u8 topology_id[8];
+} __attribute__((packed));
+
+#endif
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index b96031d..3e87f5a 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -27,12 +27,14 @@

 #define EDID_LENGTH 128
 #define DDC_ADDR 0x50
+#define DDC_ADDR2 0x52 /* E-DDC 1.2 - where DisplayID can hide */

 #define CEA_EXT0x02
 #define VTB_EXT0x10
 #define DI_EXT 0x40
 #define LS_EXT 0x50
 #define MI_EXT 0x60
+#define DISPLAYID_EXT 0x70

 struct est_timings {
u8 t1;
-- 
2.1.0



drm tiled monitor support (not hiding in kernel)

2014-10-20 Thread Dave Airlie
So I believe attempts to hide the DP MST tiled monitors in the kernel,
are a path to failure, so I've resurrected my previous code to just
create a tile property on the connectors for userspace to key off.

The contents of the tile blob are ABI, and I expect it to be
parsed by a fair few userspace projects.

So far I've ported a few pieces of GNOME to using it and posted
patches for that to their lists,

The X server should use this for make better XINERAMA info,
but otherwise drivers should pass the TILE property through
to the clients, as it contains nothing kernel specific.

Dave.



[Bug 83461] hdmi screen flicker/unusable

2014-10-20 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=83461

--- Comment #9 from Christian K?nig  ---
Please provide the output of "xrandr --verbose" and of dmesg when booted with
"drm.debug=0xe" on the kernel command line.

Thanks,
Christian.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


[Bug 85204] [Radeon HD 5650] return from sleep state failed

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=85204

--- Comment #3 from Alex Deucher  ---
What do you mean by sleep state?  DPMS (turing the monitors off) or suspend? 
Is this a regression?  If so, when was it last working and can you bisect?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/0acd2706/attachment.html>


[PATCH] drm/radeon: Use drm_malloc_ab instead of kmalloc_array

2014-10-20 Thread Christian König
Am 20.10.2014 um 11:40 schrieb Michel D?nzer:
> From: Michel D?nzer 
>
> Should avoid kmalloc failures due to large number of array entries.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81991
> Signed-off-by: Michel D?nzer 

Reviewed-by: Christian K?nig 

> ---
>   drivers/gpu/drm/radeon/radeon_cs.c   | 2 +-
>   drivers/gpu/drm/radeon/radeon_ring.c | 4 ++--
>   drivers/gpu/drm/radeon/radeon_vm.c   | 4 ++--
>   3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c 
> b/drivers/gpu/drm/radeon/radeon_cs.c
> index 1c89344..a3e7aed 100644
> --- a/drivers/gpu/drm/radeon/radeon_cs.c
> +++ b/drivers/gpu/drm/radeon/radeon_cs.c
> @@ -450,7 +450,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser 
> *parser, int error, bo
>   kfree(parser->track);
>   kfree(parser->relocs);
>   kfree(parser->relocs_ptr);
> - kfree(parser->vm_bos);
> + drm_free_large(parser->vm_bos);
>   for (i = 0; i < parser->nchunks; i++)
>   drm_free_large(parser->chunks[i].kdata);
>   kfree(parser->chunks);
> diff --git a/drivers/gpu/drm/radeon/radeon_ring.c 
> b/drivers/gpu/drm/radeon/radeon_ring.c
> index 596e591..51dcf40 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -314,7 +314,7 @@ unsigned radeon_ring_backup(struct radeon_device *rdev, 
> struct radeon_ring *ring
>   }
>   
>   /* and then save the content of the ring */
> - *data = kmalloc_array(size, sizeof(uint32_t), GFP_KERNEL);
> + *data = drm_malloc_ab(size, sizeof(uint32_t));
>   if (!*data) {
>   mutex_unlock(>ring_lock);
>   return 0;
> @@ -356,7 +356,7 @@ int radeon_ring_restore(struct radeon_device *rdev, 
> struct radeon_ring *ring,
>   }
>   
>   radeon_ring_unlock_commit(rdev, ring, false);
> - kfree(data);
> + drm_free_large(data);
>   return 0;
>   }
>   
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c 
> b/drivers/gpu/drm/radeon/radeon_vm.c
> index 4532cc7..dfde266 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -132,8 +132,8 @@ struct radeon_cs_reloc *radeon_vm_get_bos(struct 
> radeon_device *rdev,
>   struct radeon_cs_reloc *list;
>   unsigned i, idx;
>   
> - list = kmalloc_array(vm->max_pde_used + 2,
> -  sizeof(struct radeon_cs_reloc), GFP_KERNEL);
> + list = drm_malloc_ab(vm->max_pde_used + 2,
> +  sizeof(struct radeon_cs_reloc));
>   if (!list)
>   return NULL;
>   



[PATCH v11 0/3] Add drm driver for Rockchip Socs

2014-10-20 Thread Heiko Stübner
Hi Mark,

Am Freitag, 17. Oktober 2014, 16:42:54 schrieb Mark yao:
> On 2014?10?17? 16:25, Heiko St?bner wrote:
> > Am Freitag, 17. Oktober 2014, 16:16:01 schrieb Mark yao:
> >> On 2014?10?17? 14:24, Heiko St?bner wrote:
> >>> Hi Mark,
> >>> 
> >>> Am Freitag, 17. Oktober 2014, 12:22:53 schrieb Mark yao:
>  On 2014?10?17? 08:46, Dave Airlie wrote:
> > On 17 October 2014 10:40, Mark yao  wrote:
> >> Hi
> >> I think Rockchip drm driver is ready now, can it land?
> > 
> > I probably want to wait until -rc1 though I suppose since its a new
> > driver and self contained we might be able to see if Linus is
> > interested in squeezing it in.
> > 
> > Can you send me a git pull request for it against drm-next or even
> > 3.17.
> > 
> > Dave.
>  
>  Hi, Dave
>  
> the git pull request:
>  The following changes since commit
> > 
> > 4db36870b92cdf5a79615aeabc68efc97df13918:
> >>> I think this needs a fix. Your commit 4db36870b is the pending iommu
> >>> driver. Which isn't part of neither the mainline kernel nor the drm tree
> >>> Dave meant.
> >>> 
> >>> What Dave meant was to base your patches on top of his "drm-next" branch
> >>> or
> >>> the raw 3.17 release.
> >>> 
> >>> So either base the branch on drm-next from
> >>> 
> >>>   http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-next
> >>> 
> >>> or the 3.17 release tag from Linus Torvalds. Apply your patches on top
> >>> and
> >>> create pull from there.
> >>> 
> >>> I've just checked ... your drm patches apply cleanly against 3.17, so
> >>> your
> >>> branch to be pulled should probably look something like
> >>> 
> >>>   https://github.com/mmind/linux-rockchip/commits/tmp/drmtest
> >>> 
> >>> Heiko
> >> 
> >> Hi Heiko
> >> 
> >>   thanks for you check.
> >> 
> >> Hi Dave
> >> 
> >>   I have reupload a branch cleanly against 3.17:
> > sorry, but I think this might need another round.
> > 
> > Your current base commit 0429fbc0bdc2 is already part of the current 3.18
> > merge window - which Dave won't have in his tree I guess. The commit you
> > should base your patches on is bfe01a5ba249 - the 3.17 release.
> > 
> > Simply do a
> > 
> > git checkout v3.17
> > git checkout -b drmupstream
> > 
> > apply your patches and send the pull request with v3.17 as base.
> > 
> > 
> > Heiko
> 
> I think that would be ok:

yes the pull request itself looks ok, but you may have to be more explicit.
Normally a pull request mail should have its own subject and body and not
be embedded somewhere into the response thread. This enables the
maintainers to see what they're asked to do easily.

So I guess it would be better to compose a separate mail, with a correct
subject, somewhat similar to [0] for example.


Heiko


[0] http://www.spinics.net/lists/arm-kernel/msg366129.html

- 8< 
Subject: [GIT PULL] core drm support for Rockchip SoCs

The following changes since commit bfe01a5ba2490f299e1d2d5508cbbbadd897bbe9:

   Linux 3.17 (2014-10-05 12:23:04 -0700)

are available in the git repository at:

   https://github.com/markyzq/kernel-drm-rockchip.git drmrockchip

for you to fetch changes up to 45bb5f4e7e82b30e9e7069c73441413680c9a59f:

   dt-bindings: video: Add documentation for rockchip vop (2014-10-17 
16:39:31 +0800)


Mark yao (3):
   drm: rockchip: Add basic drm driver
   dt-bindings: video: Add for rockchip display subsytem
   dt-bindings: video: Add documentation for rockchip vop

  .../devicetree/bindings/video/rockchip-drm.txt |   19 +
  .../devicetree/bindings/video/rockchip-vop.txt |   58 +
  drivers/gpu/drm/Kconfig|2 +
  drivers/gpu/drm/Makefile   |1 +
  drivers/gpu/drm/rockchip/Kconfig   |   17 +
  drivers/gpu/drm/rockchip/Makefile  |8 +
  drivers/gpu/drm/rockchip/rockchip_drm_drv.c|  449 ++
  drivers/gpu/drm/rockchip/rockchip_drm_drv.h|   54 +
  drivers/gpu/drm/rockchip/rockchip_drm_fb.c |  200 +++
  drivers/gpu/drm/rockchip/rockchip_drm_fb.h |   28 +
  drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c  |  210 +++
  drivers/gpu/drm/rockchip/rockchip_drm_fbdev.h  |   20 +
  drivers/gpu/drm/rockchip/rockchip_drm_gem.c|  293 
  drivers/gpu/drm/rockchip/rockchip_drm_gem.h|   54 +
  drivers/gpu/drm/rockchip/rockchip_drm_vop.c| 1427 
  drivers/gpu/drm/rockchip/rockchip_drm_vop.h|  196 +++
  16 files changed, 3036 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/video/rockchip-drm.txt
  create mode 100644 Documentation/devicetree/bindings/video/rockchip-vop.txt
  create mode 100644 drivers/gpu/drm/rockchip/Kconfig
  create mode 100644 drivers/gpu/drm/rockchip/Makefile
  create mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_drv.c
  create mode 100644 

[PATCH] drm/radeon: Use drm_malloc_ab instead of kmalloc_array

2014-10-20 Thread Alex Deucher
On Mon, Oct 20, 2014 at 5:40 AM, Michel D?nzer  wrote:
> From: Michel D?nzer 
>
> Should avoid kmalloc failures due to large number of array entries.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81991
> Signed-off-by: Michel D?nzer 

Applied to my -fixes tree. thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_cs.c   | 2 +-
>  drivers/gpu/drm/radeon/radeon_ring.c | 4 ++--
>  drivers/gpu/drm/radeon/radeon_vm.c   | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c 
> b/drivers/gpu/drm/radeon/radeon_cs.c
> index 1c89344..a3e7aed 100644
> --- a/drivers/gpu/drm/radeon/radeon_cs.c
> +++ b/drivers/gpu/drm/radeon/radeon_cs.c
> @@ -450,7 +450,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser 
> *parser, int error, bo
> kfree(parser->track);
> kfree(parser->relocs);
> kfree(parser->relocs_ptr);
> -   kfree(parser->vm_bos);
> +   drm_free_large(parser->vm_bos);
> for (i = 0; i < parser->nchunks; i++)
> drm_free_large(parser->chunks[i].kdata);
> kfree(parser->chunks);
> diff --git a/drivers/gpu/drm/radeon/radeon_ring.c 
> b/drivers/gpu/drm/radeon/radeon_ring.c
> index 596e591..51dcf40 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -314,7 +314,7 @@ unsigned radeon_ring_backup(struct radeon_device *rdev, 
> struct radeon_ring *ring
> }
>
> /* and then save the content of the ring */
> -   *data = kmalloc_array(size, sizeof(uint32_t), GFP_KERNEL);
> +   *data = drm_malloc_ab(size, sizeof(uint32_t));
> if (!*data) {
> mutex_unlock(>ring_lock);
> return 0;
> @@ -356,7 +356,7 @@ int radeon_ring_restore(struct radeon_device *rdev, 
> struct radeon_ring *ring,
> }
>
> radeon_ring_unlock_commit(rdev, ring, false);
> -   kfree(data);
> +   drm_free_large(data);
> return 0;
>  }
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c 
> b/drivers/gpu/drm/radeon/radeon_vm.c
> index 4532cc7..dfde266 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -132,8 +132,8 @@ struct radeon_cs_reloc *radeon_vm_get_bos(struct 
> radeon_device *rdev,
> struct radeon_cs_reloc *list;
> unsigned i, idx;
>
> -   list = kmalloc_array(vm->max_pde_used + 2,
> -sizeof(struct radeon_cs_reloc), GFP_KERNEL);
> +   list = drm_malloc_ab(vm->max_pde_used + 2,
> +sizeof(struct radeon_cs_reloc));
> if (!list)
> return NULL;
>
> --
> 2.1.1
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 5/6] drm/tile: expose the tile property to userspace

2014-10-20 Thread David Herrmann
Hi

On Mon, Oct 20, 2014 at 8:37 AM, Dave Airlie  wrote:
> From: Dave Airlie 
>
> This takes the tiling info from the connector and
> exposes it to userspace, as a blob object in a
> connector property.
>
> The contents of the blob is ABI.
>
> Signed-off-by: Dave Airlie 
> ---
>  drivers/gpu/drm/drm_crtc.c  | 36 
>  drivers/gpu/drm/i915/intel_dp_mst.c |  2 ++
>  include/drm/drm_crtc.h  |  4 
>  3 files changed, 42 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 93135d4..81e867a 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -1319,6 +1319,11 @@ static int 
> drm_mode_create_standard_connector_properties(struct drm_device *dev)
>"PATH", 0);
> dev->mode_config.path_property = dev_path;
>
> +   dev->mode_config.tile_property = drm_property_create(dev,
> +
> DRM_MODE_PROP_BLOB |
> +
> DRM_MODE_PROP_IMMUTABLE,
> +"TILE", 0);
> +
> return 0;
>  }
>
> @@ -4004,6 +4009,37 @@ int drm_mode_connector_set_path_property(struct 
> drm_connector *connector,
>  }
>  EXPORT_SYMBOL(drm_mode_connector_set_path_property);
>
> +int drm_mode_connector_set_tile_property(struct drm_connector *connector)
> +{
> +   struct drm_device *dev = connector->dev;
> +   int ret, size;
> +   char tile[256];
> +
> +   if (connector->tile_blob_ptr)
> +   drm_property_destroy_blob(dev, connector->tile_blob_ptr);
> +
> +   if (!connector->has_tile) {
> +   connector->tile_blob_ptr = NULL;
> +   ret = drm_object_property_set_value(>base,
> +   
> dev->mode_config.tile_property, 0);
> +   return ret;
> +   }
> +
> +   snprintf(tile, 256, "%d:%d:%d:%d:%d:%d:%d:%d", 
> connector->tile_group->id, connector->tile_is_single_monitor, 
> connector->num_h_tile, connector->num_v_tile, connector->tile_h_loc, 
> connector->tile_v_loc, connector->tile_h_size, connector->tile_v_size);
> +   size = strlen(tile) + 1;
> +
> +   connector->tile_blob_ptr = drm_property_create_blob(connector->dev,
> +   size, tile);
> +   if (!connector->tile_blob_ptr)
> +   return -EINVAL;
> +
> +   ret = drm_object_property_set_value(>base,
> +   dev->mode_config.tile_property,
> +   
> connector->tile_blob_ptr->base.id);

I recently looked at property hotplugging and I think it needs the
same fix you pushed for connectors (drm_mode_object_get_reg() and
friends). I wanted to look at the same thing for brightness
properties, but didn't have time for that so far.
The race is mostly theoretical, but I think we should still try to fix it.

Thanks
David

> +   return ret;
> +}
> +EXPORT_SYMBOL(drm_mode_connector_set_tile_property);
> +
>  /**
>   * drm_mode_connector_update_edid_property - update the edid property of a 
> connector
>   * @connector: drm connector
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c 
> b/drivers/gpu/drm/i915/intel_dp_mst.c
> index c66e73a..c5529ff 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -422,6 +422,8 @@ static struct drm_connector 
> *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
> intel_dp_add_properties(intel_dp, connector);
>
> drm_object_attach_property(>base, 
> dev->mode_config.path_property, 0);
> +   drm_object_attach_property(>base, 
> dev->mode_config.tile_property, 0);
> +
> drm_mode_connector_set_path_property(connector, pathprop);
> drm_reinit_primary_mode_group(dev);
> mutex_lock(>mode_config.mutex);
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index d71b6d7..39d744b 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -548,6 +548,8 @@ struct drm_connector {
>
> struct drm_property_blob *path_blob_ptr;
>
> +   struct drm_property_blob *tile_blob_ptr;
> +
> uint8_t polled; /* DRM_CONNECTOR_POLL_* */
>
> /* requested DPMS state */
> @@ -838,6 +840,7 @@ struct drm_mode_config {
> struct drm_property *edid_property;
> struct drm_property *dpms_property;
> struct drm_property *path_property;
> +   struct drm_property *tile_property;
> struct drm_property *plane_type_property;
>
> /* DVI-I properties */
> @@ -990,6 +993,7 @@ extern void drm_mode_config_cleanup(struct drm_device 
> *dev);
>
>  extern int drm_mode_connector_set_path_property(struct drm_connector 
> *connector,
> char *path);
> +int 

[PATCH 2/6] drm: add tile_group support.

2014-10-20 Thread David Herrmann
Hi

On Mon, Oct 20, 2014 at 8:37 AM, Dave Airlie  wrote:
> From: Dave Airlie 
>
> A tile group is an identifier shared by a single monitor,
> DisplayID topology has 8 bytes we can use for this, just
> use those for now until something else comes up in the
> future. We assign these to an idr and use the idr to
> tell userspace what connectors are in the same tile group.
>
> DisplayID v1.3 says the serial number must be unique for
> displays from the same manufacturer.
>
> Signed-off-by: Dave Airlie 
> ---
>  drivers/gpu/drm/drm_crtc.c | 61 
> ++
>  include/drm/drm_crtc.h | 16 
>  2 files changed, 77 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 90e7730..dfccc34 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -5037,6 +5037,7 @@ void drm_mode_config_init(struct drm_device *dev)
> INIT_LIST_HEAD(>mode_config.property_blob_list);
> INIT_LIST_HEAD(>mode_config.plane_list);
> idr_init(>mode_config.crtc_idr);
> +   idr_init(>mode_config.tile_idr);

You are missing a call to idr_destroy() in drm_mode_config_cleanup().
The IDR caches are not cleaned up automatically when it drops to size
0...

Thanks
David

>
> drm_modeset_lock_all(dev);
> drm_mode_create_standard_connector_properties(dev);
> @@ -5146,3 +5147,63 @@ struct drm_property 
> *drm_mode_create_rotation_property(struct drm_device *dev,
>supported_rotations);
>  }
>  EXPORT_SYMBOL(drm_mode_create_rotation_property);
> +
> +static void drm_tile_group_free(struct kref *kref)
> +{
> +   struct drm_tile_group *tg = container_of(kref, struct drm_tile_group, 
> refcount);
> +   struct drm_device *dev = tg->dev;
> +   mutex_lock(>mode_config.idr_mutex);
> +   idr_remove(>mode_config.tile_idr, tg->id);
> +   mutex_lock(>mode_config.idr_mutex);
> +   kfree(tg);
> +}
> +
> +void drm_mode_put_tile_group(struct drm_device *dev,
> +struct drm_tile_group *tg)
> +{
> +   kref_put(>refcount, drm_tile_group_free);
> +}
> +
> +struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
> +  char topology[8])
> +{
> +   struct drm_tile_group *tg;
> +   int id;
> +   mutex_lock(>mode_config.idr_mutex);
> +   idr_for_each_entry(>mode_config.tile_idr, tg, id) {
> +   if (!memcmp(tg->group_data, topology, 8)) {
> +   kref_get(>refcount);
> +   mutex_unlock(>mode_config.idr_mutex);
> +   return tg;
> +   }
> +   }
> +   mutex_unlock(>mode_config.idr_mutex);
> +   return NULL;
> +}
> +
> +struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
> + char topology[8])
> +{
> +   struct drm_tile_group *tg;
> +   int ret;
> +
> +   tg = kzalloc(sizeof(*tg), GFP_KERNEL);
> +   if (!tg)
> +   return ERR_PTR(-ENOMEM);
> +
> +   kref_init(>refcount);
> +   memcpy(tg->group_data, topology, 8);
> +   tg->dev = dev;
> +
> +   mutex_lock(>mode_config.idr_mutex);
> +   ret = idr_alloc(>mode_config.tile_idr, tg, 1, 0, GFP_KERNEL);
> +   if (ret >= 0) {
> +   tg->id = ret;
> +   } else {
> +   kfree(tg);
> +   tg = NULL;
> +   }
> +
> +   mutex_unlock(>mode_config.idr_mutex);
> +   return tg;
> +}
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index f1105d0..afaec4b 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -136,6 +136,14 @@ struct drm_display_info {
> u8 cea_rev;
>  };
>
> +/* data corresponds to displayid vend/prod/serial */
> +struct drm_tile_group {
> +   struct kref refcount;
> +   struct drm_device *dev;
> +   int id;
> +   u8 group_data[8];
> +};
> +
>  struct drm_framebuffer_funcs {
> /* note: use drm_framebuffer_remove() */
> void (*destroy)(struct drm_framebuffer *framebuffer);
> @@ -770,6 +778,7 @@ struct drm_mode_config {
> struct drm_modeset_acquire_ctx *acquire_ctx; /* for legacy 
> _lock_all() / _unlock_all() */
> struct mutex idr_mutex; /* for IDR management */
> struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, 
> connector, modes - just makes life easier */
> +   struct idr tile_idr; /* use this idr for all IDs, fb, crtc, 
> connector, modes - just makes life easier */
> /* this is limited to one for now */
>
>
> @@ -1106,6 +1115,13 @@ extern void drm_set_preferred_mode(struct 
> drm_connector *connector,
>  extern int drm_edid_header_is_valid(const u8 *raw_edid);
>  extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool 
> print_bad_edid);
>  extern bool drm_edid_is_valid(struct edid *edid);
> +
> +extern struct 

[PATCH] gpu:drm: Fix typo in Documentation/DocBook/drm.xml

2014-10-20 Thread Randy Dunlap
On 10/20/14 07:53, Masanari Iida wrote:
> This patch fix spelling typos found in drm.xml.
> It is because the file is generated from comments in
> source codes, I have to fix the typos within source files.
> 
> Signed-off-by: Masanari Iida 

Acked-by: Randy Dunlap 

Thanks.

> ---
>  drivers/gpu/drm/drm_crtc.c | 2 +-
>  drivers/gpu/drm/drm_irq.c  | 4 ++--
>  drivers/gpu/drm/drm_modes.c| 2 +-
>  drivers/gpu/drm/drm_prime.c| 4 ++--
>  drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++--
>  drivers/gpu/drm/i915/i915_reg.h| 2 +-
>  drivers/gpu/drm/i915/intel_lrc.c   | 2 +-
>  include/drm/drm_dp_mst_helper.h| 2 +-
>  8 files changed, 11 insertions(+), 11 deletions(-)


-- 
~Randy


[Bug 86401] radeon: fatal exception in interrupt

2014-10-20 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=86401

--- Comment #1 from Michel D?nzer  ---
Can you attach a photo of the panic screen?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


[Bug 85207] agd5f drm-next-3.19-wip + Unreal Elemental sometimes = list_add corruption/hung task

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=85207

--- Comment #2 from Michel D?nzer  ---
(In reply to Andy Furniss from comment #0)
> Haven't seen on drm-next-3.18-wip

Can you bisect the kernel?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/deed4663/attachment.html>


[Bug 84944] tearing on radeonsi vdpau deinterlacer

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=84944

--- Comment #5 from Christian K?nig  ---
The deinterlacer is hardware independent and so it's rather unlikely that it is
the source of the problem.

Can you grab a trace of MythTV with VDPAU_TRACE=1 in the environment once with
and once without deinterlacing enabled? This way we can see what MythTV is
actually doing.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/9fbed673/attachment.html>


[Bug 85204] [Radeon HD 5650] return from sleep state failed

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=85204

Michel D?nzer  changed:

   What|Removed |Added

 Attachment #108069|text/x-log  |text/plain
  mime type||

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/758c930e/attachment.html>


[Bug 84944] tearing on radeonsi vdpau deinterlacer

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=84944

--- Comment #4 from Michel D?nzer  ---
Can you get the same or at least similar tearing on Brazos with

 Option "SwapbuffersWait" "off"

or

 Option "AccelMethod" "glamor"

in xorg.conf? If yes, the problem is that page flipping cannot be used for the
MythTV window, most likely because its dimensions do not match the X11 screen
dimensions.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/8941cf71/attachment.html>


[Bug 84500] [radeonsi] radeon 0000:01:00.0: Packet0 not allowed!

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=84500

--- Comment #29 from Michel D?nzer  ---
(In reply to Alexandre Demers from comment #27)
> I'm trying to figure out a way to distinguish one from the other because from
> where I am in the bisection, I was unable to reproduce the bug with a 3.16
> kernel, but it does appear before 3.17-rc1...

That's fine. Once you've finished bisecting the kernel, we'll decide where to
go from there based on the result.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/8b2e0524/attachment.html>


[Bug 84662] Long pauses with Unreal demo Elemental on R9270X since : Always flush the HDP cache before submitting a CS to the GPU

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=84662

--- Comment #46 from Michel D?nzer  ---
(In reply to Andy Furniss from comment #44)
> If I stop it after a while I can get the first bit cached (ie. I
> can run it without vmstat 1 showing anything), but it's still stuttery in
> the places where it would be loading from disk were it first run.

Sounds like it's loading new content in those places. Doesn't that cause
stutter with other drivers?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/02a78c79/attachment-0001.html>


[Bug 85180] [drm:r100_ring_test] *ERROR* radeon: ring test failed (scratch(0x15E4)=0xCAFEDEAD)

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=85180

--- Comment #2 from Michel D?nzer  ---
Is this a regression? If yes, what was the last kernel version where it worked
for you? Can you bisect?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/255db988/attachment.html>


[Bug 79980] Random radeonsi crashes

2014-10-20 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #166 from Michel D?nzer  ---
(In reply to Jacob from comment #164)
> I ran a bisection between the two releases, and the result was the following:
> Bisecting: 120 revisions left to test after this (roughly 7 steps)

That's not the result but just an early step of the bisection. :) As the above
says, Git estimates that you'll need to test around 7 more kernels before there
is a result. BTW, make sure to only run 'bisect good' after you've tested a
kernel long enough to be sure it's not affected by the problem. If you mark a
commit as good which is actually bad, the bisection will fail.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141020/19347e84/attachment.html>