Re: MACH64: Caught signal 11 (Segmentation fault)

2023-04-18 Thread Alex Deucher
 Make sure the PCI register BAR is properly mapped in the ddx.  Those old ddxes 
required direct access to the hardware in the X server.  

Alex

On Monday, April 17, 2023 at 04:18:16 PM EDT, Morgan Wesström 
 wrote:  
 
 Dear list,

This is a small hobby project of mine so it's no big deal if it can't be 
resolved but I don't mind digging a little deeper into it myself if I can only 
get a few pointers.

I've been a Gentoo Linux user for 15+ years so I'm fairly confident in 
compiling things in various ways but I'm no C programmer and definitely don't 
have the deep technical knowledge needed to create device drivers.

With that said, I needed a challenge and went on to install Gentoo on the 
oldest machine still in my possession - a 22 year old laptop with a 32-bit 
Pentium III Celeron. It's quite restricted hardware wise (maxed out RAM is 
196MB) but I got it running. I even made Xorg run with the generic fbdev driver 
but was hoping to unlock at least some 2D acceleration.

The video card is an ATI Rage Mobility AGP 2x Series (1002:4c4d) and after some 
digging I understood that this was a mach64 card. Driver is included and 
activated in my kernel (atyfb, Linux 6.1.19) but I also needed 
xf86-video-mach64 for Xorg. Unfortunately that driver seems to have been ripped 
out of the main tree around 2010 or so but apparently it's still maintained and 
version 6.9.7 was released last year.

I downloaded it from 
https://gitlab.freedesktop.org/xorg/driver/xf86-video-mach64.git, compiled and 
installed it but X segfaults with a signal 11 when I try to use it. I've 
compiled it with debug symbols so I can get a proper backtrace but after that 
I'm stuck. I don't know what the driver is doing or what it's supposed to do at 
this point.

Here's some info from the debugger:

Program received signal SIGSEGV, Segmentation fault.
ATIMach64Detect (Chip=77, ChipType=19533, pATI=0x1c74110) at atiprobe.c:143
143        bus_cntl = inr(BUS_CNTL);
(gdb) bt
#0  ATIMach64Detect (Chip=77, ChipType=19533, pATI=0x1c74110) at atiprobe.c:143
#1  ATIMach64Probe (Chip=77, pVideo=0x1c7dbe0, pATI=0x1c74110) at atiprobe.c:278
#2  ATIMach64ProbeIO (pVideo=0x1c7dbe0, pATI=0x1c74110) at atiprobe.c:454
#3  0xb75639c7 in ATIPreInit (pScreenInfo=0x1c83940, flags=0) at 
atipreinit.c:644
#4  0x00607ab7 in InitOutput (pScreenInfo=pScreenInfo@entry=0x707300 
, argc=argc@entry=1, argv=argv@entry=0xbfa90e44) at 
../xorg-server-21.1.8/hw/xfree86/common/xf86Init.c:478
#5  0x004fd765 in dix_main (argc=, argc@entry=1, argv=, argv@entry=0xbfa90e44, envp=, envp@entry=0xbfa90e4c) at 
../xorg-server-21.1.8/dix/main.c:190
#6  0x004ba84e in main (argc=1, argv=0xbfa90e44, envp=0xbfa90e4c) at 
../xorg-server-21.1.8/dix/stubmain.c:34
(gdb) list
138        }
139    
140    #endif /* AVOID_CPIO */
141    
142        /* Make sure any Mach64 is not in some weird state */
143        bus_cntl = inr(BUS_CNTL);
144        if (Chip < ATI_CHIP_264VTB)
145            outr(BUS_CNTL,
146                (bus_cntl & ~(BUS_HOST_ERR_INT_EN | BUS_FIFO_ERR_INT_EN)) |
147                (BUS_HOST_ERR_INT | BUS_FIFO_ERR_INT));

Can anything be deduced from this? What other information is of interest? Any 
suggestions are welcome.

Regards
Morgan Wesström
  

Re: Fwd: Random display freeze AMD TURKS (DRM 2.50.0 / 5.4.0-77-generic, LLVM 11.0.0)

2021-10-05 Thread Alex Deucher
Is it possible that your motherboard or power supply is going bad?  There
look to be a lot of errors here beyond the GPU hang.

Alex


On Mon, Oct 4, 2021 at 5:25 AM Guus Ellenkamp 
wrote:

> I replaced the video card with a similar, but different GPU: AMD JUNIPER.
>
> Same issue occurred just now, after I presumed the issue was solved.
>
> I was able to go to a terminal screen and reboot the system. Mouse was
> moving, but remainder of screen frozen.
>
> Some of the system log:
>
> [44512.708485] CIFS VFS: \\laptopguus.megaheights.net has not responded
> in 180 seconds. Reconnecting...
> [57093.595216] ata8.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
> [57093.595222] ata8.00: irq_stat 0x4001
> [57093.595227] ata8.00: failed command: READ DMA EXT
> [57093.595236] ata8.00: cmd 25/00:20:20:7c:b9/00:00:b3:01:00/e0 tag 20 dma
> 16384 in
> [57093.595236]  res 51/40:0f:26:7c:b9/00:00:b3:01:00/e0 Emask 0x9
> (media error)
> [57093.595239] ata8.00: status: { DRDY ERR }
> [57093.595242] ata8.00: error: { UNC }
> [57093.621841] ata8.00: configured for UDMA/133
> [57093.621866] sd 7:0:0:0: [sdf] tag#20 FAILED Result: hostbyte=DID_OK
> driverbyte=DRIVER_SENSE
> [57093.621872] sd 7:0:0:0: [sdf] tag#20 Sense Key : Medium Error [current]
> [57093.621876] sd 7:0:0:0: [sdf] tag#20 Add. Sense: Unrecovered read error
> - auto reallocate failed
> [57093.621882] sd 7:0:0:0: [sdf] tag#20 CDB: Read(16) 88 00 00 00 00 01 b3
> b9 7c 20 00 00 00 20 00 00
> [57093.621888] blk_update_request: I/O error, dev sdf, sector 7310244896
> op 0x0:(READ) flags 0x1000 phys_seg 2 prio class 0
> [57093.621899] BTRFS error (device sdf3): bdev /dev/sdf3 errs: wr 0, rd 1,
> flush 0, corrupt 5, gen 0
> [57093.621946] ata8: EH complete
> [57093.704448] BTRFS info (device sdf3): read error corrected: ino 0 off
> 10072584896512 (dev /dev/sdf3 sector 3809520672)
> [57093.722193] BTRFS info (device sdf3): read error corrected: ino 0 off
> 10072584900608 (dev /dev/sdf3 sector 3809520680)
> [57093.722324] BTRFS info (device sdf3): read error corrected: ino 0 off
> 10072584904704 (dev /dev/sdf3 sector 3809520688)
> [57093.722434] BTRFS info (device sdf3): read error corrected: ino 0 off
> 10072584908800 (dev /dev/sdf3 sector 3809520696)
> [63723.394435] systemd-resolve[80364]: segfault at ed5eda1ba ip
> 7fcf9bfb130d sp 7ffe9ab99c90 error 4 in
> libsystemd-shared-245.so[7fcf9bf89000+174000]
> [63723.394454] Code: 8d 15 a2 68 15 00 31 ff 48 8d 35 fa c0 14 00 e8 b9 a2
> 08 00 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 85 ff 74 7f 48 83 ec 18
> <8b> 47 04 85 c0 74 4c 83 e8 01 89 47 04 75 11 f6 47 29 02 74 16 f6
> [71460.546805] systemd-resolve[84672]: segfault at 6 ip
> 0006 sp 7fffdfd83c48 error 14 in
> systemd-resolved[562e7fe8b000+a000]
> [71460.546822] Code: Bad RIP value.
> [72353.671080] ata8.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
> [72353.671084] ata8.00: irq_stat 0x4001
> [72353.671086] ata8.00: failed command: READ DMA EXT
> [72353.671091] ata8.00: cmd 25/00:20:80:68:b9/00:00:b3:01:00/e0 tag 12 dma
> 16384 in
> [72353.671091]  res 51/40:00:99:68:b9/00:00:b3:01:00/e0 Emask 0x9
> (media error)
> [72353.671093] ata8.00: status: { DRDY ERR }
> [72353.671094] ata8.00: error: { UNC }
> [72353.694979] ata8.00: configured for UDMA/133
> [72353.694990] sd 7:0:0:0: [sdf] tag#12 FAILED Result: hostbyte=DID_OK
> driverbyte=DRIVER_SENSE
> [72353.694992] sd 7:0:0:0: [sdf] tag#12 Sense Key : Medium Error [current]
> [72353.694993] sd 7:0:0:0: [sdf] tag#12 Add. Sense: Unrecovered read error
> - auto reallocate failed
> [72353.694995] sd 7:0:0:0: [sdf] tag#12 CDB: Read(16) 88 00 00 00 00 01 b3
> b9 68 80 00 00 00 20 00 00
> [72353.694997] blk_update_request: I/O error, dev sdf, sector 7310239872
> op 0x0:(READ) flags 0x1000 phys_seg 4 prio class 0
> [72353.695002] BTRFS error (device sdf3): bdev /dev/sdf3 errs: wr 0, rd 2,
> flush 0, corrupt 5, gen 0
> [72353.695016] ata8: EH complete
> [72353.714389] BTRFS info (device sdf3): read error corrected: ino 0 off
> 10072582324224 (dev /dev/sdf3 sector 3809515648)
> [72353.714533] BTRFS info (device sdf3): read error corrected: ino 0 off
> 10072582328320 (dev /dev/sdf3 sector 3809515656)
> [72353.714817] BTRFS info (device sdf3): read error corrected: ino 0 off
> 10072582332416 (dev /dev/sdf3 sector 3809515664)
> [72353.783786] BTRFS info (device sdf3): read error corrected: ino 0 off
> 10072582336512 (dev /dev/sdf3 sector 3809515672)
> [81101.923913] systemd-resolve[90514]: segfault at 708784e ip
> 7f25381cb30d sp 7ffd5a4f4580 error 4 in
> libsystemd-shared-245.so[7f25381a3000+174000]
> [81101.923920] Code: 8d 15 a2 68 15 00 31 ff 48 8d 35 fa c0 14 00 e8 b9 a2
> 08 00 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 85 ff 74 7f 48 83 ec 18
> <8b> 47 04 85 c0 74 4c 83 e8 01 89 47 04 75 11 f6 47 29 02 74 16 f6
> [88659.280083] systemd-resolve[99760]: segfault at 2642fa92 ip
> 7f0b975db30d sp 7ffdaed18a40 error 4 in
> 

Re: Random display freeze AMD TURKS (DRM 2.50.0 / 5.4.0-77-generic, LLVM 11.0.0)

2021-08-03 Thread Alex Deucher
On Mon, Aug 2, 2021 at 1:21 PM Guus Ellenkamp  wrote:
>
> My display freezes randomly on an Ubuntu 20.04 system with a Radeon AMD
> Turks graphics card.
>
> Before the final freeze I often get warnings by the display suddenly
> turning black and then turning on again.
>
> Not sure if it's the driver or the (cheap) graphics card. How can I find
> out and is there any solution?
>
> Restarting the display manager does not have any effect.
>

Anything in the kernel log?  Sounds like a GPU hang.  You might try a
newer or older version of mesa.

Alex


Re: [PATCH 07/20] drm/radeon/radeon_display: Remove unused variable 'mod'

2020-11-11 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_display.c: In function ‘radeon_div’:
>  drivers/gpu/drm/radeon/radeon_display.c:1094:11: warning: variable ‘mod’ set 
> but not used [-Wunused-but-set-variable]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: report to 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_display.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
> b/drivers/gpu/drm/radeon/radeon_display.c
> index bd60f16fd0d78..78fceedfd9255 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -1091,11 +1091,9 @@ void radeon_compute_pll_avivo(struct radeon_pll *pll,
>  /* pre-avivo */
>  static inline uint32_t radeon_div(uint64_t n, uint32_t d)
>  {
> -   uint64_t mod;
> -
> n += d / 2;
>
> -   mod = do_div(n, d);
> +   do_div(n, d);
> return n;
>  }
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 18/20] drm/radeon/radeon_display: Fix function doc formatting and missing param issues

2020-11-11 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/radeon_display.c:264: warning: Function parameter or 
> member '__work' not described in 'radeon_unpin_work_func'
>  drivers/gpu/drm/radeon/radeon_display.c:406: warning: Function parameter or 
> member '__work' not described in 'radeon_flip_work_func'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'freq' not described in 'radeon_compute_pll_avivo'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'fb_div_p' not described in 'radeon_compute_pll_avivo'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'frac_fb_div_p' not described in 'radeon_compute_pll_avivo'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'ref_div_p' not described in 'radeon_compute_pll_avivo'
>  drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or 
> member 'post_div_p' not described in 'radeon_compute_pll_avivo'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: report to 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks,

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_display.c | 13 +++--
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
> b/drivers/gpu/drm/radeon/radeon_display.c
> index 78fceedfd9255..eb0d4cb95f0a6 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -256,7 +256,7 @@ static void radeon_crtc_destroy(struct drm_crtc *crtc)
>  /**
>   * radeon_unpin_work_func - unpin old buffer object
>   *
> - * @__work - kernel work item
> + * @__work: kernel work item
>   *
>   * Unpin the old frame buffer object outside of the interrupt handler
>   */
> @@ -398,7 +398,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, 
> int crtc_id)
>  /**
>   * radeon_flip_work_func - page flip framebuffer
>   *
> - * @work - kernel work item
> + * @__work: kernel work item
>   *
>   * Wait for the buffer object to become idle and do the actual page flip
>   */
> @@ -937,11 +937,12 @@ static void avivo_get_fb_ref_div(unsigned nom, unsigned 
> den, unsigned post_div,
>   * radeon_compute_pll_avivo - compute PLL paramaters
>   *
>   * @pll: information about the PLL
> + * @freq: target frequency
>   * @dot_clock_p: resulting pixel clock
> - * fb_div_p: resulting feedback divider
> - * frac_fb_div_p: fractional part of the feedback divider
> - * ref_div_p: resulting reference divider
> - * post_div_p: resulting reference divider
> + * @fb_div_p: resulting feedback divider
> + * @frac_fb_div_p: fractional part of the feedback divider
> + * @ref_div_p: resulting reference divider
> + * @post_div_p: resulting reference divider
>   *
>   * Try to calculate the PLL parameters to generate the given frequency:
>   * dot_clock = (ref_freq * feedback_div) / (ref_div * post_div)
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 00/20] [Set 3] Rid W=1 warnings from GPU

2020-11-10 Thread Alex Deucher
On Mon, Nov 9, 2020 at 4:19 PM Lee Jones  wrote:
>
> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.
>
> This set takes the running (decreasing) total from 5000 before
> [Set 1] down to 2300.
>
> Lee Jones (20):
>   drm/radeon/radeon_ttm: Place declaration of 'rdev' in same clause as
> its use
>   drm/radeon: Move radeon_ttm{init,fini} to shared location
>   drm/radeon/radeon_fence: Demote some non-conformant kernel-doc headers
> and fix another
>   drm/radeon: Move 'radeon_add_legacy_encoder' prototype to shared
> header
>   drm/radeon: Move 'radeon_add_legacy_encoder's prototype to shared
> location
>   drm/radeon/radeon_connectors: Strip out set but unused variable 'ret'
>   drm/radeon/radeon_display: Remove unused variable 'mod'
>   drm/radeon/radeon_i2c: Remove pointless function header
>   drm/radeon/radeon_irq_kms: Demote non-conformant kernel-doc fix
> another
>   drm/radeon/radeon_ring: Add missing function parameters 'rdev' and
> 'data'
>   drm/radeon/r600: Strip out set but unused 'tmp' variables
>   drm/radeon/radeon_cs: Fix a bunch of doc-rot issues
>   drm/radeon/evergreen: Move 'rv770_set_clk_bypass_mode' prototype to
> shared location
>   drm/radeon: Move 'radeon_pm_acpi_event_handler' prototype into shared
> header
>   drm/radeon/r600d: Move 'rc600_*' prototypes into shared header
>   drm/radeon/radeon_audio: Move 'dce3_2_*' prototypes to shared location
>   drm/radeon/evergreend: Move 'evergreen_*' and 'sumo_*' prototypes out
> to shared location
>   drm/radeon/radeon_display: Fix function doc formatting and missing
> param issues
>   drm/radeon/r600: Fix a misnamed parameter description and a formatting
> issue
>   drm/radeon/cik: Fix a bunch of function parameter descriptions
>
>  drivers/gpu/drm/radeon/cik.c   | 10 +++
>  drivers/gpu/drm/radeon/evergreen.c |  1 -
>  drivers/gpu/drm/radeon/ni.c| 16 --
>  drivers/gpu/drm/radeon/r600.c  | 11 +++
>  drivers/gpu/drm/radeon/r600d.h | 14 +
>  drivers/gpu/drm/radeon/radeon.h| 34 ++
>  drivers/gpu/drm/radeon/radeon_acpi.c   |  2 --
>  drivers/gpu/drm/radeon/radeon_atombios.c   |  5 
>  drivers/gpu/drm/radeon/radeon_audio.c  | 23 +--
>  drivers/gpu/drm/radeon/radeon_audio.h  | 12 
>  drivers/gpu/drm/radeon/radeon_combios.c|  5 
>  drivers/gpu/drm/radeon/radeon_connectors.c |  4 +--
>  drivers/gpu/drm/radeon/radeon_cs.c | 12 
>  drivers/gpu/drm/radeon/radeon_display.c| 17 +--
>  drivers/gpu/drm/radeon/radeon_encoders.c   |  3 --
>  drivers/gpu/drm/radeon/radeon_fence.c  |  6 ++--
>  drivers/gpu/drm/radeon/radeon_i2c.c|  4 ---
>  drivers/gpu/drm/radeon/radeon_irq_kms.c|  6 ++--
>  drivers/gpu/drm/radeon/radeon_object.c |  2 --
>  drivers/gpu/drm/radeon/radeon_ring.c   |  3 ++
>  drivers/gpu/drm/radeon/radeon_ttm.c|  8 ++---
>  drivers/gpu/drm/radeon/si.c|  6 
>  22 files changed, 96 insertions(+), 108 deletions(-)

Instead of just dumping everything in radeon.h, I think it would be
cleaner to add new headers that match the .c files that define them.
E.g., add evergreen.h and put all the stuff from evergreen.c in there.
Add rv770.h and add all the stuff defined in rv770.c, etc.

Alex

>
> Cc: Alex Deucher 
> Cc: amd-...@lists.freedesktop.org
> Cc: "Christian König" 
> Cc: Daniel Vetter 
> Cc: David Airlie 
> Cc: dri-de...@lists.freedesktop.org
> Cc: Jerome Glisse 
> Cc: linaro-mm-...@lists.linaro.org
> Cc: linux-me...@vger.kernel.org
> Cc: report to 
> Cc: Slava Grigorev 
> Cc: Sumit Semwal 
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: Ryzen Embedded V1605B with Radeon Vega

2019-09-24 Thread Alex Deucher
On Tue, Sep 24, 2019 at 9:23 AM James Cloos  wrote:
>
> For the V1605B, does anyone have the list of which firmware files need
> to be in CONFIG_EXTRA_FIRMWARE when amdgpu is compiled in?
>
> I take it that it is either raven or raven2, but not sure which.
>
> And does it need anything else?

It's a raven.  Use the raven firmware.

Alex

>
> Thanks.
>
> -JimC
> --
> James Cloos  OpenPGP: 0x997A9F17ED7DAEA6
>
>
>
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati

Bug#924540: [PATCH xf86-video-ati] Use radeon_finish in drmmode_crtc_scanout_update

2019-03-15 Thread Alex Deucher
On Fri, Mar 15, 2019 at 4:25 AM Michel Dänzer  wrote:
>
> From: Michel Dänzer 
>
> radeon_glamor_finish only works if we're using glamor, otherwise it'll
> crash.
>
> Fixes: ce7db51020d3 "Cancel pending scanout update in 
> drmmode_crtc_scanout_update"
> Bug: https://bugs.debian.org/924540
> Signed-off-by: Michel Dänzer 

Reviewed-by: Alex Deucher 

> ---
>  src/drmmode_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index c5fccd2aa..002513f1a 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -785,7 +785,7 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, 
> DisplayModePtr mode,
>  
> screen->GetWindowPixmap(screen->root),
>  extents)) {
> 
> RegionEmpty(DamageRegion(drmmode_crtc->scanout_damage));
> -   radeon_glamor_finish(scrn);
> +   radeon_finish(scrn, 
> drmmode_crtc->scanout[scanout_id].bo);
>
> if (!drmmode_crtc->flip_pending) {
> radeon_drm_abort_entry(drmmode_crtc->
> --
> 2.20.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati

Re: need some help ...

2018-01-09 Thread Alex Deucher
On Mon, Jan 8, 2018 at 7:58 PM, Hans Schneidhofer  wrote:
> hi list,
> have installed a new Ubuntu 16.04 lts with kernel 4.10.
> My Hardware :
> Mainboard : M5A78L-M PLUS/USB3
> CPU : AMD Phenom(tm) II X2 511 Processor
> RAM : DDR3 8 GB
> Graphic : RS780L [Radeon 3000]
> Display : LG 32LH301C (32")
>
> Now - my problem is, I had to change my old mainboard to the above new
> one. And there was an nvidia graphic-chip on the mainboard.
>
> I didn't reinstall the system but started the PC with the new
> Mainboard. Ubuntu installs automatically the new ATI-driver.
>
> Now, with the new ATI-3000 Graphicchip I have some trouble with the
> size of displaying the correct size. The screen is first too big or so
> called oversized. With the option "xrandr --output HDMI-0 --set
> underscan on I get a screen near the right size, but still I get a size
> 1 cm lower in both x- and y-axis AND I have to change the resolution of
> 1920 x 1080 by hand.
>
> Could anyone give me some light on how to reorganize the resolution and
> the size of the screen ?
>
> It seems, that xorg.conf has changed to a newer file-model and I can
> not handle the new structure.
> So - where do I have to make which entries ?
>
> Hope, anyone could give some hints ?

Take a look at your TV's setting and try and find the one that turns
off overscan.  Otherwise, you'll just end up with the content being
scaled twice, once by the TV and again by the GPU.  As for the mode
selection, please attach your xorg log and dmesg output.

Alex
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: triple head: xrandr commands ignored

2017-05-01 Thread Alex Deucher
On Fri, Apr 28, 2017 at 9:29 PM, Felix Miata <mrma...@earthlink.net> wrote:
> Alex Deucher composed on 2017-04-28 15:15 (UTC-0400):
>
>> Felix Miata wrote:
>
>> All evergreen cards only have 2 PLLs so that means they can only
>> support two independent clocks.  If you want to use more than two
>> displays, you'll need to use displayport or for non-displayport, at
>> least two of the displays need to be using the exact same display
>> timing.
>
> Thanks! Is PLL count information that is readily available in Xorg.0.log,
> gfxinfo, dmesg or elsewhere? Is this nv218/GT210 similarly limited?
> http://fm.no-ip.com/Tmp/Linux/Xorg/hwinfo-gfx-geforce710-gt218-fi965.txt

See the display section of this page for more info on the display
capabilities on various radeon chips:
https://www.x.org/wiki/RadeonFeature/
No idea about nvidia hw.

Alex

> --
> "The wise are known for their understanding, and pleasant
> words are persuasive." Proverbs 16:21 (New Living Translation)
>
>  Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!
>
> Felix Miata  ***  http://fm.no-ip.com/
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: triple head: xrandr commands ignored

2017-05-01 Thread Alex Deucher
On Fri, Apr 28, 2017 at 9:55 PM, Michel Dänzer <mic...@daenzer.net> wrote:
> On 29/04/17 04:15 AM, Alex Deucher wrote:
>> On Fri, Apr 28, 2017 at 5:46 AM, Felix Miata <mrma...@earthlink.net> wrote:
>>> Felix Miata composed on 2017-04-28 05:22 (UTC-0400):
>>>
>>>> Felix Miata composed on 2017-04-27 06:35 (UTC-0400):
>>>
>>>>> openSUSE Tumbleweed
>>>>> kernel 4.10.10
>>>>> server 1.19.3
>>>>> ATI HD5450 PCIe gfxcard (Cedar)
>>> ...
>>> When I use this startup script:
>>> xrandr --output DVI-0 --primary --mode 1920x1200 --left-of HDMI-0
>>> xrandr --output HDMI-0 --mode 1920x1080
>>> xrandr --output VGA-0 --mode 1680x1050 --above DVI-0
>>> xrandr --dpi 108
>>>
>>> things improve dramatically. 1920x1080 appears right of 1920x1200, and 
>>> mouse can
>>> reach them both, but 1680x1050 remains asleep.
>>> Xrandr and Xorg.0.log combined:
>>> http://fm.no-ip.com/Tmp/Linux/Xorg/ATI3/xorg.0.log-tw-fi965-hd5450-atiDrv-viz-e
>>>
>>> Is this low-budget Sapphire ATI Cedar gfxcard not supposed to be able to 
>>> produce
>>> on all three outputs at once?
>>
>> All evergreen cards only have 2 PLLs so that means they can only
>> support two independent clocks.  If you want to use more than two
>> displays, you'll need to use displayport or for non-displayport, at
>> least two of the displays need to be using the exact same display
>> timing.
>
> BTW, does only the pixel clock need to be identical, or do the
> vertical/horizontal blanking periods also need to happen at the same time?

Only the clock.  There are enough crtcs for the timing.

Alex
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: triple head: xrandr commands ignored

2017-04-28 Thread Alex Deucher
On Fri, Apr 28, 2017 at 5:46 AM, Felix Miata  wrote:
> Felix Miata composed on 2017-04-28 05:22 (UTC-0400):
>
>> Felix Miata composed on 2017-04-27 06:35 (UTC-0400):
>
>>> openSUSE Tumbleweed
>>> kernel 4.10.10
>>> server 1.19.3
>>> ATI HD5450 PCIe gfxcard (Cedar)
> ...
> When I use this startup script:
> xrandr --output DVI-0 --primary --mode 1920x1200 --left-of HDMI-0
> xrandr --output HDMI-0 --mode 1920x1080
> xrandr --output VGA-0 --mode 1680x1050 --above DVI-0
> xrandr --dpi 108
>
> things improve dramatically. 1920x1080 appears right of 1920x1200, and mouse 
> can
> reach them both, but 1680x1050 remains asleep.
> Xrandr and Xorg.0.log combined:
> http://fm.no-ip.com/Tmp/Linux/Xorg/ATI3/xorg.0.log-tw-fi965-hd5450-atiDrv-viz-e
>
> Is this low-budget Sapphire ATI Cedar gfxcard not supposed to be able to 
> produce
> on all three outputs at once?

All evergreen cards only have 2 PLLs so that means they can only
support two independent clocks.  If you want to use more than two
displays, you'll need to use displayport or for non-displayport, at
least two of the displays need to be using the exact same display
timing.

Alex
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [AGP] rv200 and rv250 unusable absent 'agp=off'

2017-03-27 Thread Alex Deucher
On Sun, Mar 26, 2017 at 5:21 AM, Felix Miata  wrote:
> AMD Sempron(tm) Processor 3000+
> Fresh installation on resurrected MSI K8MM-V MS-7142 motherboard.
> https://www.msi.com/Motherboard/support/K8MMV.html
> openSUSE Tumbleweed, kernel 4.10.4, server 1.19.3, ati driver 7.9.0
>
> Mouse cursor is about all that can be counted on. Sometimes an app like
> Xterm can be started, but text is smeared if it appears at all. As likely as
> not, the IceWM desktop mostly paints, and nothing more is possible,
> sometimes to the point even remote login cannot force reboot or kill X. The
> following is the tail of dmesg with drm.drm_debug=1 on cmdline (without it,
> no clues show up in dmesg or Xorg.0.log) using RV250/M9 GL [Mobility FireGL
> 9000/Radeon 9000 (similar results if I swap the RV200 for the RV250)(journal
> looks about the same):
>
> [   89.691515] Key type id_legacy registered
> [  319.776019] radeon :01:00.0: ring 0 stalled for more than 10240msec
> [  319.776024] radeon :01:00.0: GPU lockup (current fence id
> 0x0188 last fence id 0x0189 on ring 0)
> [  319.942304] radeon: wait for empty RBBM fifo failed ! Bad things might
> happen.
> [  320.104030] Failed to wait GUI idle while programming pipes. Bad things
> might happen.
> [  320.105042] radeon :01:00.0: Saved 31 dwords of commands on ring 0.
> [  320.105051] radeon :01:00.0: (r100_asic_reset:2568)
> RBBM_STATUS=0x8031C100
> [  320.607052] radeon :01:00.0: (r100_asic_reset:2589)
> RBBM_STATUS=0x80010140
> [  321.104586] radeon :01:00.0: (r100_asic_reset:2597)
> RBBM_STATUS=0x0140
> [  321.104607] radeon :01:00.0: GPU reset succeed
> [  321.104609] radeon :01:00.0: GPU reset succeeded, trying to resume
> [  321.126699] radeon :01:00.0: WB disabled
> [  321.126706] radeon :01:00.0: fence driver on ring 0 use gpu addr
> 0xd000 and cpu addr 0xbfe840381000
> [  321.126766] [drm] radeon: ring at 0xD0001000
> [  321.126787] [drm] ring test succeeded in 1 usecs
> [  322.208113] [drm:r100_ib_test [radeon]] *ERROR* radeon: fence wait timed
> out.
> [  322.208163] [drm:radeon_ib_ring_tests [radeon]] *ERROR* radeon: failed
> testing IB on GFX ring (-110).
>
> Log:
> http://fm.no-ip.com/Tmp/Linux/Xorg/xorg.0.log-k8mmv-201703260430
>
> Is there something, other than the illogical 'agp=off' cmdline option, that
> can be done to make these cards usable? Time to file a new bug? I don't see
> any that match in a Driver / ATI, Drivers/DRI/r200 search.

You can dry disabling AGP or forcing a specific AGP mode in the
driver.  Append radeon.agpmode=-1 to the kernel command line in grub
to disable it.  Set it to 1, 2, or 4 to force the AGP mode.

Alex

> --
> "The wise are known for their understanding, and pleasant
> words are persuasive." Proverbs 16:21 (New Living Translation)
>
>  Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!
>
> Felix Miata  ***  http://fm.no-ip.com/
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] drm/radeon/dp_auxch: Ratelimit aux transfer debug messages

2017-02-23 Thread Alex Deucher
On Wed, Feb 22, 2017 at 4:34 PM, Lyude  wrote:
> Aux transfers always fail with non-zero status flags when there's
> nothing connected on the port, so we don't usually need to see all of
> the debugging information from it. Also, we try reprobing a -lot-, so
> without ratelimiting most of the kernel log is filled up with messages
> from radeon_dp_aux_transfer_native.
>
> Signed-off-by: Lyude 

Applied.  thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_dp_auxch.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_dp_auxch.c 
> b/drivers/gpu/drm/radeon/radeon_dp_auxch.c
> index 474a8a18..12eac4e 100644
> --- a/drivers/gpu/drm/radeon/radeon_dp_auxch.c
> +++ b/drivers/gpu/drm/radeon/radeon_dp_auxch.c
> @@ -168,7 +168,8 @@ radeon_dp_aux_transfer_native(struct drm_dp_aux *aux, 
> struct drm_dp_aux_msg *msg
> goto done;
> }
> if (tmp & AUX_RX_ERROR_FLAGS) {
> -   DRM_DEBUG_KMS("dp_aux_ch flags not zero: %08x\n", tmp);
> +   DRM_DEBUG_KMS_RATELIMITED("dp_aux_ch flags not zero: %08x\n",
> + tmp);
> ret = -EIO;
> goto done;
> }
> --
> 2.9.3
>
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: Amdgpu and carrizo R6

2017-01-03 Thread Alex Deucher
On Tue, Jan 3, 2017 at 1:28 PM, Stuart Norman  wrote:
> I use pclinuxos. When X 1.18 was released the catalyst driver was removed and
> replaced by amdgpu which does not work with my chipset. AMD isn't supporting
> catalyst past X 1.17. The chipset is an integrated APU/GPU A10 8700p which is
> R6 Volcanic Islands Carrizo.  I can only make it work by using nomodeset in
> the kernel command line and without an Xorg.conf file. It's pretty lousy
> resolution of 800x600. The AMD site doesn't show any Linux support for Carrizo
> R6 graphics except for Windows. I saw a chart on X.org for amdgpu that shows
> support for carrizo. Will amdgpu soon support this chip?
>
> I assume the ati driver won't work. Should I try the vesa driver or is there
> another way to make fb offer a higher resolution?  Should vga=788 be removed
> from the kernel command line?

All carrizo chips are supported with the amdgpu driver stack and have
been for a while.  If you are having an issue please file a bug
(https://bugs.freedesktop.org) and attach your xorg log and dmesg
output.

Alex
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Merging Render code into r128_exa.c

2016-08-26 Thread Alex Deucher
On Fri, Aug 26, 2016 at 2:21 AM, Connor Behan  wrote:
> On 25/08/16 11:40 PM, Kevin Brace wrote:
>> Hi Connor,
>>
>> I do not mean to harass you regarding this patch or my response to your 
>> feedback, but it will be nice if you can reply to my response I sent to the 
>> mailing list regarding what to do with the Render code.
>> I did modify the original proposal, and maintains a separate 
>> r128_exa_render.c file, but will like to get rid of that #include in the 
>> middle of the code inside r128_exa.c. (I am happy with this second proposal 
>> if you wanted to adopt it.)
>> I will like to eventually work on fixing the EXA rendering bug that still 
>> exists, but prior to that, I was trying to test the waters before jumping 
>> into it.
>> I do have one AGP-based system (HP Pavilion a800n; AMD Athlon XP + VIA 
>> Technologies KM400A chipset) with RAGE 128 Pro AGP 32 MB with TV out I can 
>> use for r128 DDX development, and I have managed to compile drm-openchrome 
>> for Lubuntu 14.04 LTS. (It can boot RAGE 128 Pro fine, but not with 
>> OpenChrome for now due to its KMS bug in the drm-openchrome).
>> Of course, I still see the rendering bugs, and I will like to fix it for 
>> people who still care about it.
>>
>> Regards,
>>
>> Kevin Brace
>
> I don't feel strongly that the patch is needed or that it is not needed
> since both proposals are cosmetic. So if you go ahead and apply the one
> you like, I'm certainly not going to revert it. However, to fix the bugs
> you're talking about, I can almost guarantee that the functions you'll
> need to hack are in r128_exa_render.c and not r128_exa.c. So in that
> sense it helps to have separate files. Any contributions you have
> planned would be welcome. Especially since I had too many things come up
> over the last year that regrettably took me away from r128 development.
>

For some historical background, the render acceleration generally used
the 3D engine while the regular exa code used the 2D engine.
Additionally, some of the older chips implemented support for both
MMIO and DMA based acceleration so there were sets of macros to
support both and the code was compiled twice, once for MMIO and once
for DMA.  I don't remember off hand if r128 supported both MMIO and
DMA or not.

Alex
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Only use RandR APIs if RandR is enabled

2016-06-27 Thread Alex Deucher
On Sun, Jun 26, 2016 at 10:19 PM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes crash with Xinerama enabled, which disables RandR.
>
> Fixes: https://bugs.debian.org/827984
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c |  2 +-
>  src/radeon_kms.c  | 21 -
>  2 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index b5d3dc9..2555465 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -2613,7 +2613,7 @@ restart_destroy:
> changed = TRUE;
> }
>
> -   if (changed) {
> +   if (changed && dixPrivateKeyRegistered(rrPrivKey)) {
>  #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,2,0)
> RRSetChanged(xf86ScrnToScreen(scrn));
>  #else
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 940aad2..41ee597 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -241,7 +241,6 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr 
> pScreen)
>  {
>  ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
>  RADEONInfoPtr  info   = RADEONPTR(pScrn);
> -rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
>  PixmapPtr pixmap;
>  struct radeon_surface *surface;
>
> @@ -251,17 +250,21 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr 
> pScreen)
>  pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS;
>
>  /* Set the RandR primary output if Xorg hasn't */
> -if (
> +if (dixPrivateKeyRegistered(rrPrivKey)) {
> +   rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
> +
> +   if (
>  #ifdef RADEON_PIXMAP_SHARING
> -   !pScreen->isGPU &&
> +   !pScreen->isGPU &&
>  #endif
> -   !rrScrPriv->primaryOutput)
> -{
> -   xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
> +   !rrScrPriv->primaryOutput)
> +   {
> +   xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
>
> -   rrScrPriv->primaryOutput = xf86_config->output[0]->randr_output;
> -   RROutputChanged(rrScrPriv->primaryOutput, FALSE);
> -   rrScrPriv->layoutChanged = TRUE;
> +   rrScrPriv->primaryOutput = xf86_config->output[0]->randr_output;
> +   RROutputChanged(rrScrPriv->primaryOutput, FALSE);
> +   rrScrPriv->layoutChanged = TRUE;
> +   }
>  }
>
>  if (!drmmode_set_desired_modes(pScrn, >drmmode, FALSE))
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 5/5] Free priv in amdgpu_set_pixmap_bo also if priv->bo == NULL

2016-06-15 Thread Alex Deucher
On Wed, Jun 15, 2016 at 6:00 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes memory leak when destroying pixmaps with priv->bo == NULL.
>
> Reported-by: Qiang Yu <qiang...@amd.com>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_pixmap.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/amdgpu_pixmap.h b/src/amdgpu_pixmap.h
> index 9c51067..a8de26a 100644
> --- a/src/amdgpu_pixmap.h
> +++ b/src/amdgpu_pixmap.h
> @@ -63,10 +63,10 @@ static inline Bool amdgpu_set_pixmap_bo(PixmapPtr pPix, 
> struct amdgpu_buffer *bo
> return TRUE;
>
> if (priv) {
> -   if (priv->bo == bo)
> -   return TRUE;
> -
> if (priv->bo) {
> +   if (priv->bo == bo)
> +   return TRUE;
> +
> amdgpu_bo_unref(>bo);
> priv->handle_valid = FALSE;
> }
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 5/6] Move DRI2's local fixup_glamor helper to amdgpu_glamor_set_pixmap_bo v2

2016-06-13 Thread Alex Deucher
On Mon, Jun 13, 2016 at 6:01 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> So it can be used outside of the DRI2 code.
>
> v2: Keep pixmap refcnt increment in amdgpu_dri2_create_buffer2 (Qiang Yu)
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_dri2.c   | 54 
> -
>  src/amdgpu_glamor.c | 48 +++
>  src/amdgpu_glamor.h |  1 +
>  3 files changed, 53 insertions(+), 50 deletions(-)
>
> diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
> index 5f978c9..9cdcf28 100644
> --- a/src/amdgpu_dri2.c
> +++ b/src/amdgpu_dri2.c
> @@ -98,54 +98,6 @@ amdgpu_get_flink_name(AMDGPUEntPtr pAMDGPUEnt, PixmapPtr 
> pixmap, uint32_t *name)
> return TRUE;
>  }
>
> -static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
> -{
> -   PixmapPtr old = get_drawable_pixmap(drawable);
> -   ScreenPtr screen = drawable->pScreen;
> -   struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
> -   GCPtr gc;
> -
> -   /* With a glamor pixmap, 2D pixmaps are created in texture
> -* and without a static BO attached to it. To support DRI,
> -* we need to create a new textured-drm pixmap and
> -* need to copy the original content to this new textured-drm
> -* pixmap, and then convert the old pixmap to a coherent
> -* textured-drm pixmap which has a valid BO attached to it
> -* and also has a valid texture, thus both glamor and DRI2
> -* can access it.
> -*
> -*/
> -
> -   /* Copy the current contents of the pixmap to the bo. */
> -   gc = GetScratchGC(drawable->depth, screen);
> -   if (gc) {
> -   ValidateGC(>drawable, gc);
> -   gc->ops->CopyArea(>drawable, >drawable,
> - gc,
> - 0, 0,
> - old->drawable.width,
> - old->drawable.height, 0, 0);
> -   FreeScratchGC(gc);
> -   }
> -
> -   amdgpu_set_pixmap_private(pixmap, NULL);
> -
> -   /* And redirect the pixmap to the new bo (for 3D). */
> -   glamor_egl_exchange_buffers(old, pixmap);
> -   amdgpu_set_pixmap_private(old, priv);
> -   old->refcnt++;
> -
> -   screen->ModifyPixmapHeader(old,
> -  old->drawable.width,
> -  old->drawable.height,
> -  0, 0, pixmap->devKind, NULL);
> -   old->devPrivate.ptr = NULL;
> -
> -   screen->DestroyPixmap(pixmap);
> -
> -   return old;
> -}
> -
>  static BufferPtr
>  amdgpu_dri2_create_buffer2(ScreenPtr pScreen,
>DrawablePtr drawable,
> @@ -217,8 +169,10 @@ amdgpu_dri2_create_buffer2(ScreenPtr pScreen,
> goto error;
>
> if (pixmap) {
> -   if (is_glamor_pixmap)
> -   pixmap = fixup_glamor(drawable, pixmap);
> +   if (is_glamor_pixmap) {
> +   pixmap = amdgpu_glamor_set_pixmap_bo(drawable, 
> pixmap);
> +   pixmap->refcnt++;
> +   }
>
> if (!amdgpu_get_flink_name(pAMDGPUEnt, pixmap, 
> >name))
> goto error;
> diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
> index b6ec98f..6fbe089 100644
> --- a/src/amdgpu_glamor.c
> +++ b/src/amdgpu_glamor.c
> @@ -272,6 +272,54 @@ fallback_pixmap:
> return fbCreatePixmap(screen, w, h, depth, usage);
>  }
>
> +PixmapPtr
> +amdgpu_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap)
> +{
> +   PixmapPtr old = get_drawable_pixmap(drawable);
> +   ScreenPtr screen = drawable->pScreen;
> +   struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
> +   GCPtr gc;
> +
> +   /* With a glamor pixmap, 2D pixmaps are created in texture
> +* and without a static BO attached to it. To support DRI,
> +* we need to create a new textured-drm pixmap and
> +* need to copy the original content to this new textured-drm
> +* pixmap, and then convert the old pixmap to a coherent
> +* textured-drm pixmap which has a valid BO attached to it
> +* and also has a valid texture, thus both glamor and DRI2
> +* can access it.
> +*
> +*/
> +
> +   /* Cop

Re: [PATCH xf86-video-amdgpu 6/6] glamor: Reallocate linear pixmap BO if necessary for DRI2 PRIME

2016-06-08 Thread Alex Deucher
On Wed, Jun 8, 2016 at 4:45 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes corruption when using DRI2 PRIME render offloading with the master
> screen using this driver.
>
> Reported-by: Qiang Yu <qiang...@amd.com>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Series is:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_glamor.c | 18 ++
>  1 file changed, 18 insertions(+)
>
> diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
> index 1159e29..53ba277 100644
> --- a/src/amdgpu_glamor.c
> +++ b/src/amdgpu_glamor.c
> @@ -328,10 +328,28 @@ amdgpu_glamor_share_pixmap_backing(PixmapPtr pixmap, 
> ScreenPtr slave,
>void **handle_p)
>  {
> ScreenPtr screen = pixmap->drawable.pScreen;
> +   uint64_t tiling_info;
> CARD16 stride;
> CARD32 size;
> int fd;
>
> +   tiling_info = amdgpu_pixmap_get_tiling_info(pixmap);
> +   if (AMDGPU_TILING_GET(tiling_info, ARRAY_MODE) != 0) {
> +   PixmapPtr linear;
> +
> +   /* We don't want to re-allocate the screen pixmap as
> +* linear, to avoid trouble with page flipping
> +*/
> +   if (screen->GetScreenPixmap(screen) == pixmap)
> +   return FALSE;
> +
> +   linear = screen->CreatePixmap(screen, pixmap->drawable.width,
> + pixmap->drawable.height,
> + pixmap->drawable.depth,
> + CREATE_PIXMAP_USAGE_SHARED);
> +   amdgpu_glamor_set_pixmap_bo(>drawable, linear);
> +   }
> +
> fd = glamor_fd_from_pixmap(screen, pixmap, , );
> if (fd < 0)
> return FALSE;
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Adapt to XF86_CRTC_VERSION 7

2016-06-01 Thread Alex Deucher
On Wed, Jun 1, 2016 at 5:21 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Now the HW cursor can be used with TearFree rotation.
>
> This also allows always using the separate scanout pixmap mechanism for
> rotation, so that should be much smoother even without TearFree enabled.
>
> (Ported from radeon commit )
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>
> ---
>
> I'll fill in the radeon commit hash before I push this.

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

>
>  src/drmmode_display.c | 18 +-
>  1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 7b326bb..c5e0a52 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -581,7 +581,7 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
> if (crtc->transformPresent)
> return FALSE;
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> /* Xorg doesn't correctly handle cursor position transform in the
>  * rotation case
>  */
> @@ -604,11 +604,19 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
>  static Bool
>  drmmode_handle_transform(xf86CrtcPtr crtc)
>  {
> -   AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn);
> Bool ret;
>
> +#if XF86_CRTC_VERSION >= 7
> +   if (!crtc->transformPresent && crtc->rotation != RR_Rotate_0)
> +   crtc->driverIsPerformingTransform = XF86DriverTransformOutput;
> +   else
> +   crtc->driverIsPerformingTransform = XF86DriverTransformNone;
> +#else
> +   AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn);
> +
> crtc->driverIsPerformingTransform = info->tear_free &&
> !crtc->transformPresent && crtc->rotation != RR_Rotate_0;
> +#endif
>
> ret = xf86CrtcRotate(crtc);
>
> @@ -849,7 +857,7 @@ static void drmmode_set_cursor_position(xf86CrtcPtr crtc, 
> int x, int y)
> drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(crtc->scrn);
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> if (crtc->driverIsPerformingTransform) {
> x += crtc->x;
> y += crtc->y;
> @@ -860,7 +868,7 @@ static void drmmode_set_cursor_position(xf86CrtcPtr crtc, 
> int x, int y)
> drmModeMoveCursor(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id, 
> x, y);
>  }
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
>
>  static int
>  drmmode_cursor_src_offset(Rotation rotation, int width, int height,
> @@ -900,7 +908,7 @@ static void drmmode_do_load_cursor_argb(xf86CrtcPtr crtc, 
> CARD32 *image, uint32_
> ScrnInfoPtr pScrn = crtc->scrn;
> AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> if (crtc->driverIsPerformingTransform) {
> uint32_t cursor_w = info->cursor_w, cursor_h = info->cursor_h;
> int dstx, dsty;
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Add .editorconfig file

2016-05-31 Thread Alex Deucher
On Tue, May 31, 2016 at 5:18 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Basically a conversion from .dir-locals.el, but also correctly handles
> files which predominantly use tabs for indentation.
>
> Also, EditorConfig supports many more editors and IDEs.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

I'm not really familiar with .editorconfig, but the content makes sense.

Acked-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  .editorconfig | 10 ++
>  1 file changed, 10 insertions(+)
>  create mode 100644 .editorconfig
>
> diff --git a/.editorconfig b/.editorconfig
> new file mode 100644
> index 000..a47d030
> --- /dev/null
> +++ b/.editorconfig
> @@ -0,0 +1,10 @@
> +root=true
> +
> +[*]
> +indent_style=tab
> +tab_width=8
> +indent_size=4
> +charset=utf-8
> +
> +[src/{drmmode_display.c,radeon_dri3.c,radeon_glamor.c,radeon_glamor.h,radeon_glamor_wrappers.c}]
> +indent_size=8
> \ No newline at end of file
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Adapt to XF86_CRTC_VERSION 7

2016-05-31 Thread Alex Deucher
On Tue, May 31, 2016 at 4:56 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Now the HW cursor can be used with TearFree rotation.
>
> This also allows always using the separate scanout pixmap mechanism for
> rotation, so that should be much smoother even without TearFree enabled.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>
> See https://patchwork.freedesktop.org/patch/78319/ for the corresponding
> xserver change.
>
>  src/drmmode_display.c | 18 +-
>  1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 4271f04..b5d3dc9 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -632,7 +632,7 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
> if (crtc->transformPresent)
> return FALSE;
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> /* Xorg doesn't correctly handle cursor position transform in the
>  * rotation case
>  */
> @@ -655,11 +655,19 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
>  static Bool
>  drmmode_handle_transform(xf86CrtcPtr crtc)
>  {
> -   RADEONInfoPtr info = RADEONPTR(crtc->scrn);
> Bool ret;
>
> +#if XF86_CRTC_VERSION >= 7
> +   if (!crtc->transformPresent && crtc->rotation != RR_Rotate_0)
> +   crtc->driverIsPerformingTransform = XF86DriverTransformOutput;
> +   else
> +   crtc->driverIsPerformingTransform = XF86DriverTransformNone;
> +#else
> +   RADEONInfoPtr info = RADEONPTR(crtc->scrn);
> +
> crtc->driverIsPerformingTransform = info->tear_free &&
> !crtc->transformPresent && crtc->rotation != RR_Rotate_0;
> +#endif
>
> ret = xf86CrtcRotate(crtc);
>
> @@ -910,7 +918,7 @@ drmmode_set_cursor_position (xf86CrtcPtr crtc, int x, int 
> y)
> drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> drmmode_ptr drmmode = drmmode_crtc->drmmode;
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> if (crtc->driverIsPerformingTransform) {
> x += crtc->x;
> y += crtc->y;
> @@ -921,7 +929,7 @@ drmmode_set_cursor_position (xf86CrtcPtr crtc, int x, int 
> y)
> drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, 
> y);
>  }
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
>
>  static int
>  drmmode_cursor_src_offset(Rotation rotation, int width, int height,
> @@ -967,7 +975,7 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image)
> /* cursor should be mapped already */
> ptr = (uint32_t *)(drmmode_crtc->cursor_bo->ptr);
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> if (crtc->driverIsPerformingTransform) {
> uint32_t cursor_w = info->cursor_w, cursor_h = info->cursor_h;
> int dstx, dsty;
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Explicitly set the fbcon pixmap pitch again

2016-05-13 Thread Alex Deucher
On Fri, May 13, 2016 at 5:40 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> The kernel driver returns 0 as the pitch of the fbcon BO via the
> DRM_RADEON_GEM_GET_TILING ioctl, so we ended up using an incorrect
> pitch in some cases.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94901
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>  src/drmmode_display.c | 16 +---
>  src/radeon.h  | 10 ++
>  2 files changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 84c07c6..4271f04 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -98,6 +98,7 @@ RADEONZaphodStringMatches(ScrnInfoPtr pScrn, const char *s, 
> char *output_name)
>  static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
>   int width, int height,
>   int depth, int bpp,
> + int pitch,
>   struct radeon_bo *bo, struct 
> radeon_surface *psurf)
>  {
> RADEONInfoPtr info = RADEONPTR(pScrn);
> @@ -111,8 +112,16 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr 
> pScrn,
> if (!pixmap)
> return NULL;
>
> +   if (pitch <= 0 &&
> +   (radeon_bo_get_tiling(bo, , (uint32_t*)) != 0 ||
> +pitch <= 0)) {
> +   ErrorF("radeon_bo_get_tiling failed to determine pitch\n");
> +   pScreen->DestroyPixmap(pixmap);
> +   return NULL;
> +   }
> +
> if (!(*pScreen->ModifyPixmapHeader)(pixmap, width, height,
> -   depth, bpp, -1, NULL)) {
> +   depth, bpp, pitch, NULL)) {
> return NULL;
> }
>
> @@ -401,7 +410,8 @@ create_pixmap_for_fbcon(drmmode_ptr drmmode,
> }
>
> pixmap = drmmode_create_bo_pixmap(pScrn, fbcon->width, fbcon->height,
> - fbcon->depth, fbcon->bpp, bo, NULL);
> + fbcon->depth, fbcon->bpp, 
> fbcon->pitch,
> + bo, NULL);
> info->fbcon_pixmap = pixmap;
> radeon_bo_unref(bo);
>  out_free_fb:
> @@ -593,7 +603,7 @@ drmmode_crtc_scanout_create(xf86CrtcPtr crtc, struct 
> drmmode_scanout *scanout,
>  width, height,
>  pScrn->depth,
>  pScrn->bitsPerPixel,
> -scanout->bo, NULL);
> +-1, scanout->bo, NULL);
> if (scanout->pixmap == NULL)
> xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
>"Couldn't allocate scanout pixmap for CRTC\n");
> diff --git a/src/radeon.h b/src/radeon.h
> index 011b66b..37d5fb6 100644
> --- a/src/radeon.h
> +++ b/src/radeon.h
> @@ -656,8 +656,6 @@ uint32_t radeon_get_pixmap_tiling(PixmapPtr pPix);
>
>  static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
>  {
> -ScreenPtr pScreen = pPix->drawable.pScreen;
> -
>  #ifdef USE_GLAMOR
>  RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(pPix->drawable.pScreen));
>
> @@ -693,9 +691,7 @@ static inline void radeon_set_pixmap_bo(PixmapPtr pPix, 
> struct radeon_bo *bo)
> radeon_bo_ref(bo);
> priv->bo = bo;
>
> -   if (radeon_bo_get_tiling(bo, >tiling_flags, ) == 0 &&
> -   pitch != pPix->devKind)
> -   pScreen->ModifyPixmapHeader(pPix, -1, -1, -1, -1, pitch, 
> NULL);
> +   radeon_bo_get_tiling(bo, >tiling_flags, );
> }
>  out:
> radeon_set_pixmap_private(pPix, priv);
> @@ -714,9 +710,7 @@ out:
> radeon_bo_ref(bo);
> driver_priv->bo = bo;
>
> -   if (radeon_bo_get_tiling(bo, _priv->tiling_flags, ) 
> == 0 &&
> -   pitch != pPix->devKind)
> -   pScreen->ModifyPixmapHeader(pPix, -1, -1, -1, -1, pitch, 
> NULL);
> +   radeon_bo_get_tiling(bo, _priv->tiling_flags, );
> }
>  }
>  }
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Handle Zaphod mode correctly in amdgpu_mode_hotplug

2016-05-12 Thread Alex Deucher
On Thu, May 12, 2016 at 3:43 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> We need to scan both screens of the entity for existing connectors, and
> enumerate DVI & HDMI connectors consistently regardless of which screen
> they're assigned to.
>
> Fixes crash when hot-(un)plugging connectors in Zaphod mode.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93415
> (Ported from radeon commit c801f9f10a5d72d935faf21e72f7e7808fb4f05f)

Ugh.  I thought we had dropped that code when we started amdgpu.  Oh well.
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>
> ---
>  src/drmmode_display.c | 44 ++--
>  1 file changed, 34 insertions(+), 10 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 64ee489..7b326bb 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -36,6 +36,7 @@
>  #include "damagestr.h"
>  #include "micmap.h"
>  #include "xf86cmap.h"
> +#include "xf86Priv.h"
>  #include "sarea.h"
>
>  #include "drmmode_display.h"
> @@ -2362,9 +2363,10 @@ amdgpu_mode_hotplug(ScrnInfoPtr scrn, drmmode_ptr 
> drmmode)
> xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
> AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
> drmModeResPtr mode_res;
> -   int i, j;
> +   int i, j, s;
> Bool found;
> Bool changed = FALSE;
> +   int num_dvi = 0, num_hdmi = 0;
>
> mode_res = drmModeGetResources(pAMDGPUEnt->fd);
> if (!mode_res)
> @@ -2400,21 +2402,43 @@ restart_destroy:
> for (i = 0; i < mode_res->count_connectors; i++) {
> found = FALSE;
>
> -   for (j = 0; j < config->num_output; j++) {
> -   xf86OutputPtr output = config->output[j];
> -   drmmode_output_private_ptr drmmode_output;
> +   for (s = 0; !found && s < xf86NumScreens; s++) {
> +   ScrnInfoPtr loop_scrn = xf86Screens[s];
> +   xf86CrtcConfigPtr loop_config =
> +   XF86_CRTC_CONFIG_PTR(loop_scrn);
>
> -   drmmode_output = output->driver_private;
> -   if (mode_res->connectors[i] == 
> drmmode_output->output_id) {
> -   found = TRUE;
> -   break;
> +   if (AMDGPUEntPriv(loop_scrn) != pAMDGPUEnt)
> +   continue;
> +
> +   for (j = 0; !found && j < loop_config->num_output; 
> j++) {
> +   xf86OutputPtr output = loop_config->output[j];
> +   drmmode_output_private_ptr drmmode_output;
> +
> +   drmmode_output = output->driver_private;
> +   if (mode_res->connectors[i] ==
> +   drmmode_output->output_id) {
> +   found = TRUE;
> +
> +   
> switch(drmmode_output->mode_output->connector_type) {
> +   case DRM_MODE_CONNECTOR_DVII:
> +   case DRM_MODE_CONNECTOR_DVID:
> +   case DRM_MODE_CONNECTOR_DVIA:
> +   num_dvi++;
> +   break;
> +   case DRM_MODE_CONNECTOR_HDMIA:
> +   case DRM_MODE_CONNECTOR_HDMIB:
> +   num_hdmi++;
> +   break;
> +   }
> +   }
> }
> }
> if (found)
> continue;
>
> -   changed = TRUE;
> -   drmmode_output_init(scrn, drmmode, mode_res, i, NULL, NULL, 
> 1);
> +   if (drmmode_output_init(scrn, drmmode, mode_res, i, _dvi,
> +   _hdmi, 1) != 0)
> +   changed = TRUE;
> }
>
> if (changed) {
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Enable DRI3 by default when building for Xorg >= 1.18.3

2016-05-12 Thread Alex Deucher
On Thu, May 12, 2016 at 3:43 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Seems to work well enough in general now.
>
> (Ported from radeon commit 1181b9c582f10b6c523e4b2988e2ce87ecf3d367)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  man/amdgpu.man   | 2 ++
>  src/amdgpu_kms.c | 4 
>  2 files changed, 6 insertions(+)
>
> diff --git a/man/amdgpu.man b/man/amdgpu.man
> index 0100400..fd35a9f 100644
> --- a/man/amdgpu.man
> +++ b/man/amdgpu.man
> @@ -64,6 +64,8 @@ will assign xrandr outputs LVDS and VGA-0 to this instance 
> of the driver.
>  .BI "Option \*qDRI\*q \*q" integer \*q
>  Define the maximum level of DRI to enable. Valid values are 2 for DRI2 or 3 
> for DRI3.
>  The default is
> +.B 3 for DRI3
> +if the driver was compiled for Xorg >= 1.18.3, otherwise
>  .B 2 for DRI2.
>  .TP
>  .BI "Option \*qEnablePageFlip\*q \*q" boolean \*q
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index 125cb77..3c53bc9 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -1230,7 +1230,11 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
> }
>  #endif
>
> +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0)
> +   value = TRUE;
> +#else
> value = FALSE;
> +#endif
> from = X_DEFAULT;
>
> if (info->use_glamor) {
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 1/2] Add support for async flips to radeon_do_pageflip

2016-05-10 Thread Alex Deucher
On Tue, May 10, 2016 at 3:36 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Will be used by the next change. No functional change here.
>
> (Ported from radeon commit 90a915c62d012e99193833aecc93974e68880c60)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>  src/amdgpu_dri2.c |  2 +-
>  src/amdgpu_present.c  |  5 +++--
>  src/drmmode_display.c |  9 +++--
>  src/drmmode_display.h | 10 +-
>  4 files changed, 20 insertions(+), 6 deletions(-)
>
> diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
> index 29f60ba..27a0c1a 100644
> --- a/src/amdgpu_dri2.c
> +++ b/src/amdgpu_dri2.c
> @@ -615,7 +615,7 @@ amdgpu_dri2_schedule_flip(xf86CrtcPtr crtc, ClientPtr 
> client,
>AMDGPU_DRM_QUEUE_ID_DEFAULT, flip_info,
>ref_crtc_hw_id,
>amdgpu_dri2_flip_event_handler,
> -  amdgpu_dri2_flip_event_abort)) {
> +  amdgpu_dri2_flip_event_abort, FLIP_VSYNC)) {
> info->drmmode.dri2_flipping = TRUE;
> return TRUE;
> }
> diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
> index 4aa0708..e39b2d2 100644
> --- a/src/amdgpu_present.c
> +++ b/src/amdgpu_present.c
> @@ -311,7 +311,8 @@ amdgpu_present_flip(RRCrtcPtr crtc, uint64_t event_id, 
> uint64_t target_msc,
> ret = amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
>  pixmap, event_id, event, crtc_id,
>  amdgpu_present_flip_event,
> -amdgpu_present_flip_abort);
> +amdgpu_present_flip_abort,
> +FLIP_VSYNC);
> if (!ret)
> xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n");
> else
> @@ -348,7 +349,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
>
> if (amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, pixmap,
>event_id, event, -1, amdgpu_present_flip_event,
> -  amdgpu_present_flip_abort))
> +  amdgpu_present_flip_abort, FLIP_VSYNC))
> return;
>
>  modeset:
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 07ae9b2..64ee489 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -2495,7 +2495,8 @@ void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr 
> drmmode)
>  Bool amdgpu_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
> PixmapPtr new_front, uint64_t id, void *data,
> int ref_crtc_hw_id, amdgpu_drm_handler_proc handler,
> -   amdgpu_drm_abort_proc abort)
> +   amdgpu_drm_abort_proc abort,
> +   enum drmmode_flip_sync flip_sync)
>  {
> AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
> xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
> @@ -2503,6 +2504,7 @@ Bool amdgpu_do_pageflip(ScrnInfoPtr scrn, ClientPtr 
> client,
> drmmode_crtc_private_ptr drmmode_crtc = 
> config->crtc[0]->driver_private;
> drmmode_ptr drmmode = drmmode_crtc->drmmode;
> int i;
> +   uint32_t flip_flags = DRM_MODE_PAGE_FLIP_EVENT;
> drmmode_flipdata_ptr flipdata;
> uintptr_t drm_queue_seq = 0;
> uint32_t new_front_handle;
> @@ -2544,6 +2546,9 @@ Bool amdgpu_do_pageflip(ScrnInfoPtr scrn, ClientPtr 
> client,
> flipdata->handler = handler;
> flipdata->abort = abort;
>
> +   if (flip_sync == FLIP_ASYNC)
> +   flip_flags |= DRM_MODE_PAGE_FLIP_ASYNC;
> +
> for (i = 0; i < config->num_crtc; i++) {
> crtc = config->crtc[i];
>
> @@ -2570,7 +2575,7 @@ Bool amdgpu_do_pageflip(ScrnInfoPtr scrn, ClientPtr 
> client,
> }
>
> if (drmModePageFlip(pAMDGPUEnt->fd, 
> drmmode_crtc->mode_crtc->crtc_id,
> -   drmmode->fb_id, DRM_MODE_PAGE_FLIP_EVENT,
> +   drmmode->fb_id, flip_flags,
> (void*)drm_queue_seq)) {
> xf86DrvMsg(scrn->scrnIndex, X_WARNING,
>"flip queue failed: %s\n", 
> strerror(errno));
> diff --git a/src/drmmode_display.h b/src/drmmode_display.h
> index 24d517d..617f2bc

Re: [PATCH xf86-video-ati] Enable DRI3 by default when building for Xorg >= 1.18.3

2016-05-10 Thread Alex Deucher
On Tue, May 10, 2016 at 6:02 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Seems to work well enough in general now.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  man/radeon.man   | 2 ++
>  src/radeon_kms.c | 4 
>  2 files changed, 6 insertions(+)
>
> diff --git a/man/radeon.man b/man/radeon.man
> index 1acdc63..cacafb5 100644
> --- a/man/radeon.man
> +++ b/man/radeon.man
> @@ -270,6 +270,8 @@ Sea Islands.
>  .BI "Option \*qDRI\*q \*q" integer \*q
>  Define the maximum level of DRI to enable. Valid values are 2 for DRI2 or 3 
> for DRI3.
>  The default is
> +.B 3 for DRI3
> +if the driver was compiled for Xorg >= 1.18.3, otherwise
>  .B 2 for DRI2.
>  .TP
>  .BI "Option \*qEnablePageFlip\*q \*q" boolean \*q
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index c35c951..940aad2 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -1722,7 +1722,11 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
>  }
>  #endif
>
> +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0)
> +value = TRUE;
> +#else
>  value = FALSE;
> +#endif
>  from = X_DEFAULT;
>
>  if (!info->r600_shadow_fb) {
> --
> 2.8.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Handle Zaphod mode correctly in radeon_mode_hotplug

2016-04-19 Thread Alex Deucher
On Tue, Apr 19, 2016 at 3:41 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> We need to scan both screens of the entity for existing connectors, and
> enumerate DVI & HDMI connectors consistently regardless of which screen
> they're assigned to.
>
> Fixes crash when hot-(un)plugging DVI or HDMI connector in Zaphod mode.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93415
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>  src/drmmode_display.c | 45 +++--
>  1 file changed, 35 insertions(+), 10 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 4c66ca7..84c07c6 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -36,6 +36,7 @@
>  #include "damagestr.h"
>  #include "micmap.h"
>  #include "xf86cmap.h"
> +#include "xf86Priv.h"
>  #include "radeon.h"
>  #include "radeon_bo_helper.h"
>  #include "radeon_glamor.h"
> @@ -2514,10 +2515,12 @@ void
>  radeon_mode_hotplug(ScrnInfoPtr scrn, drmmode_ptr drmmode)
>  {
> xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
> +   RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
> drmModeResPtr mode_res;
> -   int i, j;
> +   int i, j, s;
> Bool found;
> Bool changed = FALSE;
> +   int num_dvi = 0, num_hdmi = 0;
>
> mode_res = drmModeGetResources(drmmode->fd);
> if (!mode_res)
> @@ -2553,21 +2556,43 @@ restart_destroy:
> for (i = 0; i < mode_res->count_connectors; i++) {
> found = FALSE;
>
> -   for (j = 0; j < config->num_output; j++) {
> -   xf86OutputPtr output = config->output[j];
> -   drmmode_output_private_ptr drmmode_output;
> +   for (s = 0; !found && s < xf86NumScreens; s++) {
> +   ScrnInfoPtr loop_scrn = xf86Screens[s];
> +   xf86CrtcConfigPtr loop_config =
> +   XF86_CRTC_CONFIG_PTR(loop_scrn);
>
> -   drmmode_output = output->driver_private;
> -   if (mode_res->connectors[i] == 
> drmmode_output->output_id) {
> -   found = TRUE;
> -   break;
> +   if (RADEONEntPriv(loop_scrn) != pRADEONEnt)
> +   continue;
> +
> +   for (j = 0; !found && j < loop_config->num_output; 
> j++) {
> +   xf86OutputPtr output = loop_config->output[j];
> +   drmmode_output_private_ptr drmmode_output;
> +
> +   drmmode_output = output->driver_private;
> +   if (mode_res->connectors[i] ==
> +   drmmode_output->output_id) {
> +   found = TRUE;
> +
> +   
> switch(drmmode_output->mode_output->connector_type) {
> +   case DRM_MODE_CONNECTOR_DVII:
> +   case DRM_MODE_CONNECTOR_DVID:
> +   case DRM_MODE_CONNECTOR_DVIA:
> +   num_dvi++;
> +   break;
> +   case DRM_MODE_CONNECTOR_HDMIA:
> +   case DRM_MODE_CONNECTOR_HDMIB:
> +   num_hdmi++;
> +   break;
> +   }
> +   }
> }
> }
> if (found)
> continue;
>
> -   changed = TRUE;
> -   drmmode_output_init(scrn, drmmode, mode_res, i, NULL, NULL, 
> 1);
> +   if (drmmode_output_init(scrn, drmmode, mode_res, i, _dvi,
> +   _hdmi, 1) != 0)
> +   changed = TRUE;
> }
>
> if (changed) {
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Adapt to XF86_CRTC_VERSION 7

2016-04-14 Thread Alex Deucher
On Thu, Apr 14, 2016 at 6:03 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Now the HW cursor can be used with TearFree rotation.
>
> This also allows always using the separate scanout pixmap mechanism for
> rotation, so that should be much smoother even without TearFree enabled.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>
> See https://patchwork.freedesktop.org/patch/78319/ for the corresponding
> xserver change.
>
>  src/drmmode_display.c | 18 +-
>  1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 4c66ca7..42c0b9c 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -621,7 +621,7 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
> if (crtc->transformPresent)
> return FALSE;
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> /* Xorg doesn't correctly handle cursor position transform in the
>  * rotation case
>  */
> @@ -644,11 +644,19 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
>  static Bool
>  drmmode_handle_transform(xf86CrtcPtr crtc)
>  {
> -   RADEONInfoPtr info = RADEONPTR(crtc->scrn);
> Bool ret;
>
> +#if XF86_CRTC_VERSION >= 7
> +   if (!crtc->transformPresent && crtc->rotation != RR_Rotate_0)
> +   crtc->driverIsPerformingTransform = XF86DriverTransformOutput;
> +   else
> +   crtc->driverIsPerformingTransform = XF86DriverTransformNone;
> +#else
> +   RADEONInfoPtr info = RADEONPTR(crtc->scrn);
> +
> crtc->driverIsPerformingTransform = info->tear_free &&
> !crtc->transformPresent && crtc->rotation != RR_Rotate_0;
> +#endif
>
> ret = xf86CrtcRotate(crtc);
>
> @@ -899,7 +907,7 @@ drmmode_set_cursor_position (xf86CrtcPtr crtc, int x, int 
> y)
> drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> drmmode_ptr drmmode = drmmode_crtc->drmmode;
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> if (crtc->driverIsPerformingTransform) {
> x += crtc->x;
> y += crtc->y;
> @@ -910,7 +918,7 @@ drmmode_set_cursor_position (xf86CrtcPtr crtc, int x, int 
> y)
> drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, 
> y);
>  }
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
>
>  static int
>  drmmode_cursor_src_offset(Rotation rotation, int width, int height,
> @@ -956,7 +964,7 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image)
> /* cursor should be mapped already */
> ptr = (uint32_t *)(drmmode_crtc->cursor_bo->ptr);
>
> -#if XF86_CRTC_VERSION >= 4
> +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7
> if (crtc->driverIsPerformingTransform) {
> uint32_t cursor_w = info->cursor_w, cursor_h = info->cursor_h;
> int dstx, dsty;
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Remove RR_Capability_SinkOutput for GPU without CRTC

2016-04-11 Thread Alex Deucher
On Mon, Apr 11, 2016 at 3:39 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Qiang Yu <qiang...@amd.com>
>
> Signed-off-by: Qiang Yu <qiang...@amd.com>
> (Ported from amdgpu commit a0bbb373f902e0ffc14570c85faec7e44134f62e)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>  src/radeon_kms.c | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index c5310ea..c35c951 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -1108,8 +1108,11 @@ static void RADEONSetupCapabilities(ScrnInfoPtr pScrn)
>  if (ret == 0) {
> if (value & DRM_PRIME_CAP_EXPORT)
> pScrn->capabilities |= RR_Capability_SourceOutput | 
> RR_Capability_SinkOffload;
> -   if (value & DRM_PRIME_CAP_IMPORT)
> -   pScrn->capabilities |= RR_Capability_SinkOutput | 
> RR_Capability_SourceOffload;
> +   if (value & DRM_PRIME_CAP_IMPORT) {
> +   pScrn->capabilities |= RR_Capability_SourceOffload;
> +   if (info->drmmode.count_crtcs)
> +   pScrn->capabilities |= RR_Capability_SinkOutput;
> +   }
>  }
>  #endif
>  }
> @@ -1228,8 +1231,6 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
>
>  info->allowColorTiling2D = FALSE;
>
> -RADEONSetupCapabilities(pScrn);
> -
>  /* don't enable tiling if accel is not enabled */
>  if (!info->r600_shadow_fb) {
> Bool colorTilingDefault =
> @@ -1328,6 +1329,8 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
> goto fail;
>  }
>
> +RADEONSetupCapabilities(pScrn);
> +
>  if (info->drmmode.count_crtcs == 1)
>  pRADEONEnt->HasCRTC2 = FALSE;
>  else
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] glamor: Force GPU rendering to/from pixmaps created via DRI3

2016-04-04 Thread Alex Deucher
On Mon, Apr 4, 2016 at 5:30 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes crash when running DRI3 clients with ShadowPrimary enabled.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94799
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>


Revewied-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_dri3.c|  6 +-
>  src/amdgpu_glamor_wrappers.c | 11 ++-
>  2 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/src/amdgpu_dri3.c b/src/amdgpu_dri3.c
> index c3042e7..0686599 100644
> --- a/src/amdgpu_dri3.c
> +++ b/src/amdgpu_dri3.c
> @@ -135,8 +135,12 @@ static PixmapPtr amdgpu_dri3_pixmap_from_fd(ScreenPtr 
> screen,
> if (AMDGPUPTR(xf86ScreenToScrn(screen))->use_glamor) {
> pixmap = glamor_pixmap_from_fd(screen, fd, width, height,
>stride, depth, bpp);
> -   if (pixmap)
> +   if (pixmap) {
> +   struct amdgpu_pixmap *priv = calloc(1, sizeof(*priv));
> +
> +   amdgpu_set_pixmap_private(pixmap, priv);
> return pixmap;
> +   }
> }
>  #endif
>
> diff --git a/src/amdgpu_glamor_wrappers.c b/src/amdgpu_glamor_wrappers.c
> index 6700851..35b6d7e 100644
> --- a/src/amdgpu_glamor_wrappers.c
> +++ b/src/amdgpu_glamor_wrappers.c
> @@ -148,10 +148,11 @@ amdgpu_glamor_finish_access_cpu(PixmapPtr pixmap)
>   */
>
>  static Bool
> -amdgpu_glamor_use_gpu(PixmapPtr pixmap)
> +amdgpu_glamor_use_gpu(PixmapPtr pixmap, struct amdgpu_pixmap *priv)
>  {
> return (pixmap->usage_hint &
> -   (AMDGPU_CREATE_PIXMAP_SCANOUT | AMDGPU_CREATE_PIXMAP_DRI2)) 
> != 0;
> +   (AMDGPU_CREATE_PIXMAP_SCANOUT | AMDGPU_CREATE_PIXMAP_DRI2)) 
> != 0 ||
> +   (priv && !priv->bo);
>  }
>
>  static Bool
> @@ -432,7 +433,7 @@ amdgpu_glamor_poly_fill_rect(DrawablePtr pDrawable, GCPtr 
> pGC,
> PixmapPtr pixmap = get_drawable_pixmap(pDrawable);
> struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
>
> -   if ((info->force_accel || amdgpu_glamor_use_gpu(pixmap)) &&
> +   if ((info->force_accel || amdgpu_glamor_use_gpu(pixmap, priv)) &&
> amdgpu_glamor_prepare_access_gpu(priv)) {
> info->glamor.SavedPolyFillRect(pDrawable, pGC, nrect, prect);
> amdgpu_glamor_finish_access_gpu_rw(info, priv);
> @@ -536,8 +537,8 @@ amdgpu_glamor_copy_area(DrawablePtr pSrcDrawable, 
> DrawablePtr pDstDrawable,
> struct amdgpu_pixmap *dst_priv = 
> amdgpu_get_pixmap_private(dst_pixmap);
> RegionPtr ret = NULL;
>
> -   if (amdgpu_glamor_use_gpu(dst_pixmap) ||
> -   amdgpu_glamor_use_gpu(src_pixmap)) {
> +   if (amdgpu_glamor_use_gpu(dst_pixmap, dst_priv) ||
> +   amdgpu_glamor_use_gpu(src_pixmap, src_priv)) {
> if (!amdgpu_glamor_prepare_access_gpu(dst_priv))
> goto fallback;
> if (src_priv != dst_priv &&
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati 2/2] present: Support async flips

2016-04-01 Thread Alex Deucher
On Fri, Apr 1, 2016 at 5:52 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> The xserver Present code only calls radeon_present_flip with
> sync_flip=FALSE if radeon_present_screen_init sets
> PresentCapabilityAsync, and the latter only sets it if the kernel driver
> advertises support for async flips.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>  src/radeon_present.c | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/src/radeon_present.c b/src/radeon_present.c
> index c012fed..1eced4a 100644
> --- a/src/radeon_present.c
> +++ b/src/radeon_present.c
> @@ -248,9 +248,6 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr 
> window, PixmapPtr pixmap,
>  if (info->hwcursor_disabled)
> return FALSE;
>
> -if (!sync_flip)
> -   return FALSE;
> -
>  if (info->drmmode.dri2_flipping)
> return FALSE;
>
> @@ -339,7 +336,7 @@ radeon_present_flip(RRCrtcPtr crtc, uint64_t event_id, 
> uint64_t target_msc,
>  event_id, event, crtc_id,
>  radeon_present_flip_event,
>  radeon_present_flip_abort,
> -FLIP_VSYNC);
> +sync_flip ? FLIP_VSYNC : FLIP_ASYNC);
>  if (!ret)
> xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n");
>  else
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Update manpage entry for Option "TearFree"

2016-04-01 Thread Alex Deucher
On Fri, Apr 1, 2016 at 3:10 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> It's now effective for rotation as well.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  man/amdgpu.man | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/man/amdgpu.man b/man/amdgpu.man
> index 4e95ead..0100400 100644
> --- a/man/amdgpu.man
> +++ b/man/amdgpu.man
> @@ -72,9 +72,10 @@ Enable DRI2 page flipping.  The default is
>  .TP
>  .BI "Option \*qTearFree\*q \*q" boolean \*q
>  Enable tearing prevention using the hardware page flipping mechanism. This
> -option currently doesn't have any effect for rotated CRTCs. It requires
> -allocating two separate scanout buffers for each non-rotated CRTC. Enabling
> -this option currently disables Option \*qEnablePageFlip\*q. The default is
> +option currently doesn't have any effect for CRTCs using transforms other 
> than
> +rotation or reflection. It requires allocating two separate scanout buffers 
> for
> +each supported CRTC. Enabling this option currently disables Option
> +\*qEnablePageFlip\*q. The default is
>  .B off.
>  .TP
>  .BI "Option \*qAccelMethod\*q \*q" string \*q
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Identify DRM event queue entries by sequence number instead of by pointer

2016-04-01 Thread Alex Deucher
On Fri, Apr 1, 2016 at 2:54 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> If the memory for an entry was allocated at the same address as that for
> a previously cancelled entry, the handler could theoretically be called
> prematurely, triggered by the DRM event which was submitted for the
> cancelled entry.
>
> (Ported from radeon commit 4693b1bd5b5c381e8b7b68a6f7f0c6696d6a68df)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_dri2.c  | 47 ---
>  src/amdgpu_drm_queue.c | 24 ++--
>  src/amdgpu_drm_queue.h | 12 +---
>  src/amdgpu_kms.c   | 36 ++--
>  src/amdgpu_present.c   | 17 +
>  src/drmmode_display.c  | 20 ++--
>  6 files changed, 84 insertions(+), 72 deletions(-)
>
> diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
> index 4478b16..29f60ba 100644
> --- a/src/amdgpu_dri2.c
> +++ b/src/amdgpu_dri2.c
> @@ -395,7 +395,7 @@ typedef struct _DRI2FrameEvent {
> unsigned frame;
> xf86CrtcPtr crtc;
> OsTimerPtr timer;
> -   struct amdgpu_drm_queue_entry *drm_queue;
> +   uintptr_t drm_queue_seq;
>
> /* for swaps & flips only */
> DRI2SwapEventPtr event_complete;
> @@ -961,8 +961,8 @@ CARD32 amdgpu_dri2_deferred_event(OsTimerPtr timer, 
> CARD32 now, pointer data)
>  */
> if (!event_info->crtc) {
> ErrorF("%s no crtc\n", __func__);
> -   if (event_info->drm_queue)
> -   amdgpu_drm_abort_entry(event_info->drm_queue);
> +   if (event_info->drm_queue_seq)
> +   amdgpu_drm_abort_entry(event_info->drm_queue_seq);
> else
> amdgpu_dri2_frame_event_abort(NULL, data);
> return 0;
> @@ -974,9 +974,9 @@ CARD32 amdgpu_dri2_deferred_event(OsTimerPtr timer, 
> CARD32 now, pointer data)
> if (ret) {
> xf86DrvMsg(scrn->scrnIndex, X_ERROR,
>"%s cannot get current time\n", __func__);
> -   if (event_info->drm_queue)
> +   if (event_info->drm_queue_seq)
> amdgpu_drm_queue_handler(pAMDGPUEnt->fd, 0, 0, 0,
> -event_info->drm_queue);
> +
> (void*)event_info->drm_queue_seq);
> else
> amdgpu_dri2_frame_event_handler(crtc, 0, 0, data);
> return 0;
> @@ -990,9 +990,10 @@ CARD32 amdgpu_dri2_deferred_event(OsTimerPtr timer, 
> CARD32 now, pointer data)
> delta_seq = delta_t * drmmode_crtc->dpms_last_fps;
> delta_seq /= 100;
> frame = (CARD64) drmmode_crtc->dpms_last_seq + delta_seq;
> -   if (event_info->drm_queue)
> +   if (event_info->drm_queue_seq)
> amdgpu_drm_queue_handler(pAMDGPUEnt->fd, frame, drm_now / 
> 100,
> -drm_now % 100, 
> event_info->drm_queue);
> +drm_now % 100,
> +(void*)event_info->drm_queue_seq);
> else
> amdgpu_dri2_frame_event_handler(crtc, frame, drm_now, data);
> return 0;
> @@ -1023,7 +1024,7 @@ static int amdgpu_dri2_schedule_wait_msc(ClientPtr 
> client, DrawablePtr draw,
> ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
> DRI2FrameEventPtr wait_info = NULL;
> -   struct amdgpu_drm_queue_entry *wait = NULL;
> +   uintptr_t drm_queue_seq = 0;
> xf86CrtcPtr crtc = amdgpu_dri2_drawable_crtc(draw, TRUE);
> uint32_t msc_delta;
> drmVBlank vbl;
> @@ -1079,15 +1080,15 @@ static int amdgpu_dri2_schedule_wait_msc(ClientPtr 
> client, DrawablePtr draw,
> current_msc = vbl.reply.sequence + msc_delta;
> current_msc &= 0x;
>
> -   wait = amdgpu_drm_queue_alloc(crtc, client, 
> AMDGPU_DRM_QUEUE_ID_DEFAULT,
> - wait_info, 
> amdgpu_dri2_frame_event_handler,
> - amdgpu_dri2_frame_event_abort);
> -   if (!wait) {
> +   drm_queue_seq = amdgpu_drm_queue_alloc(crtc, client, 
> AMDGPU_DRM_QUEUE_ID_DEFAULT,
> +  wait_info, 
> amdgpu_dri2_fr

Re: [PATCH xf86-video-ati] Identify DRM event queue entries by sequence number instead of by pointer

2016-03-31 Thread Alex Deucher
On Thu, Mar 31, 2016 at 4:40 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> If the memory for an entry was allocated at the same address as that for
> a previously cancelled entry, the handler could theoretically be called
> prematurely, triggered by the DRM event which was submitted for the
> cancelled entry.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c  | 20 ++--
>  src/radeon_dri2.c  | 47 ---
>  src/radeon_drm_queue.c | 24 ++--
>  src/radeon_drm_queue.h | 12 +---
>  src/radeon_kms.c   | 36 ++--
>  src/radeon_present.c   | 17 +
>  6 files changed, 84 insertions(+), 72 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 7331015..a368a41 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -2660,7 +2660,7 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr 
> client,
> int i;
> uint32_t tiling_flags = 0;
> drmmode_flipdata_ptr flipdata;
> -   struct radeon_drm_queue_entry *drm_queue = NULL;
> +   uintptr_t drm_queue_seq = 0;
>
> if (info->allowColorTiling) {
> if (info->ChipFamily >= CHIP_FAMILY_R600)
> @@ -2720,11 +2720,11 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr 
> client,
> if (drmmode_crtc->hw_id == ref_crtc_hw_id)
> flipdata->fe_crtc = crtc;
>
> -   drm_queue = radeon_drm_queue_alloc(crtc, client, id,
> -  flipdata,
> -  drmmode_flip_handler,
> -  drmmode_flip_abort);
> -   if (!drm_queue) {
> +   drm_queue_seq = radeon_drm_queue_alloc(crtc, client, id,
> +  flipdata,
> +  drmmode_flip_handler,
> +  drmmode_flip_abort);
> +   if (!drm_queue_seq) {
> xf86DrvMsg(scrn->scrnIndex, X_WARNING,
>"Allocating DRM queue event entry 
> failed.\n");
> goto error;
> @@ -2732,13 +2732,13 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr 
> client,
>
> if (drmModePageFlip(drmmode->fd, 
> drmmode_crtc->mode_crtc->crtc_id,
> drmmode->fb_id, DRM_MODE_PAGE_FLIP_EVENT,
> -   drm_queue)) {
> +   (void*)drm_queue_seq)) {
> xf86DrvMsg(scrn->scrnIndex, X_WARNING,
>"flip queue failed: %s\n", 
> strerror(errno));
> goto error;
> }
> drmmode_crtc->flip_pending = TRUE;
> -   drm_queue = NULL;
> +   drm_queue_seq = 0;
> }
>
> if (flipdata->flip_count > 0)
> @@ -2750,8 +2750,8 @@ error:
> drmmode->fb_id = flipdata->old_fb_id;
> }
>
> -   if (drm_queue)
> -   radeon_drm_abort_entry(drm_queue);
> +   if (drm_queue_seq)
> +   radeon_drm_abort_entry(drm_queue_seq);
> else if (crtc)
> drmmode_flip_abort(crtc, flipdata);
> else if (flipdata && flipdata->flip_count <= 1)
> diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
> index 73e09d0..84cd031 100644
> --- a/src/radeon_dri2.c
> +++ b/src/radeon_dri2.c
> @@ -516,7 +516,7 @@ typedef struct _DRI2FrameEvent {
>  unsigned frame;
>  xf86CrtcPtr crtc;
>  OsTimerPtr timer;
> -struct radeon_drm_queue_entry *drm_queue;
> +uintptr_t drm_queue_seq;
>
>  /* for swaps & flips only */
>  DRI2SwapEventPtr event_complete;
> @@ -1079,8 +1079,8 @@ CARD32 radeon_dri2_deferred_event(OsTimerPtr timer, 
> CARD32 now, pointer data)
>   */
>  if (!event_info->crtc) {
> ErrorF("%s no crtc\n", __func__);
> -   if (event_info->drm_queue)
> -   radeon_drm_abort_entry(event_info->drm_queue);
> +   if (event_info->drm_queue_seq)
> +   radeon_drm_abort_entry(event_info->drm_queue_seq);
> else
> radeon_dri2_frame_event_abort(NULL, data);
>

Re: [PATCH xf86-video-ati] Update pixmap pitch in radeon_set_pixmap_bo

2016-03-31 Thread Alex Deucher
On Thu, Mar 31, 2016 at 3:34 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Stop second guessing it in drmmode_crtc_scanout_create.
>
> Should fix display corruption in some cases with TearFree enabled.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94751
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 11 ++-
>  src/radeon.h  | 10 --
>  2 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 7ed8d6c..7331015 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -97,7 +97,6 @@ RADEONZaphodStringMatches(ScrnInfoPtr pScrn, const char *s, 
> char *output_name)
>  static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
>   int width, int height,
>   int depth, int bpp,
> - int pitch,
>   struct radeon_bo *bo, struct 
> radeon_surface *psurf)
>  {
> RADEONInfoPtr info = RADEONPTR(pScrn);
> @@ -112,7 +111,7 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr 
> pScrn,
> return NULL;
>
> if (!(*pScreen->ModifyPixmapHeader)(pixmap, width, height,
> -   depth, bpp, pitch, NULL)) {
> +   depth, bpp, -1, NULL)) {
> return NULL;
> }
>
> @@ -401,8 +400,7 @@ create_pixmap_for_fbcon(drmmode_ptr drmmode,
> }
>
> pixmap = drmmode_create_bo_pixmap(pScrn, fbcon->width, fbcon->height,
> - fbcon->depth, fbcon->bpp,
> - fbcon->pitch, bo, NULL);
> + fbcon->depth, fbcon->bpp, bo, NULL);
> info->fbcon_pixmap = pixmap;
> radeon_bo_unref(bo);
>  out_free_fb:
> @@ -577,7 +575,6 @@ drmmode_crtc_scanout_create(xf86CrtcPtr crtc, struct 
> drmmode_scanout *scanout,
> ScrnInfoPtr pScrn = crtc->scrn;
> drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> drmmode_ptr drmmode = drmmode_crtc->drmmode;
> -   unsigned long rotate_pitch;
>
> if (scanout->pixmap) {
> if (scanout->width == width && scanout->height == height)
> @@ -591,14 +588,10 @@ drmmode_crtc_scanout_create(xf86CrtcPtr crtc, struct 
> drmmode_scanout *scanout,
> return NULL;
> }
>
> -   rotate_pitch = RADEON_ALIGN(width, drmmode_get_pitch_align(pScrn, 
> drmmode->cpp, 0))
> -   * drmmode->cpp;
> -
> scanout->pixmap = drmmode_create_bo_pixmap(pScrn,
>  width, height,
>  pScrn->depth,
>  pScrn->bitsPerPixel,
> -rotate_pitch,
>  scanout->bo, NULL);
> if (scanout->pixmap == NULL)
> xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> diff --git a/src/radeon.h b/src/radeon.h
> index 37d5fb6..011b66b 100644
> --- a/src/radeon.h
> +++ b/src/radeon.h
> @@ -656,6 +656,8 @@ uint32_t radeon_get_pixmap_tiling(PixmapPtr pPix);
>
>  static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
>  {
> +ScreenPtr pScreen = pPix->drawable.pScreen;
> +
>  #ifdef USE_GLAMOR
>  RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(pPix->drawable.pScreen));
>
> @@ -691,7 +693,9 @@ static inline void radeon_set_pixmap_bo(PixmapPtr pPix, 
> struct radeon_bo *bo)
> radeon_bo_ref(bo);
> priv->bo = bo;
>
> -   radeon_bo_get_tiling(bo, >tiling_flags, );
> +   if (radeon_bo_get_tiling(bo, >tiling_flags, ) == 0 &&
> +   pitch != pPix->devKind)
> +   pScreen->ModifyPixmapHeader(pPix, -1, -1, -1, -1, pitch, 
> NULL);
> }
>  out:
> radeon_set_pixmap_private(pPix, priv);
> @@ -710,7 +714,9 @@ out:
> radeon_bo_ref(bo);
> driver_priv->bo = bo;
>
> -   radeon_bo_get_tiling(bo, _priv->tiling_flags, );
> +   if (radeon_bo_get_tiling(bo, _priv->tiling_flags, ) 
> == 0 &&
> +   pitch != pPix->devKind)
> +   pScreen->ModifyPixmapHeader(pPix, -1, -1, -1, -1, pitch, 
> NULL);
> }
>  }
>  }
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] DRI3: Refuse to open DRM file descriptor for ssh clients (v2)

2016-03-30 Thread Alex Deucher
On Wed, Mar 30, 2016 at 5:36 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes hangs when attempting to use DRI3 on display connections forwarded
> via SSH.
>
> Don't do this for Xorg > 1.18.99.1 since the corresponding xserver
> change has landed in Git master.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261
>
> (Ported from radeon commit 0b3aac1de9db42bfca545fa331e4985836682ec7)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_dri3.c | 39 ++-
>  1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/src/amdgpu_dri3.c b/src/amdgpu_dri3.c
> index 06d0668..c3042e7 100644
> --- a/src/amdgpu_dri3.c
> +++ b/src/amdgpu_dri3.c
> @@ -38,6 +38,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>
>  static int
> @@ -87,6 +88,38 @@ amdgpu_dri3_open(ScreenPtr screen, RRProviderPtr provider, 
> int *out)
> return Success;
>  }
>
> +#if DRI3_SCREEN_INFO_VERSION >= 1 && XORG_VERSION_CURRENT <= 
> XORG_VERSION_NUMERIC(1,18,99,1,0)
> +
> +static int
> +amdgpu_dri3_open_client(ClientPtr client, ScreenPtr screen,
> +   RRProviderPtr provider, int *out)
> +{
> +   const char *cmdname = GetClientCmdName(client);
> +   Bool is_ssh = FALSE;
> +
> +   /* If the executable name is "ssh", assume that this client connection
> +* is forwarded from another host via SSH
> +*/
> +   if (cmdname) {
> +   char *cmd = strdup(cmdname);
> +
> +   /* Cut off any colon and whatever comes after it, see
> +* 
> https://lists.freedesktop.org/archives/xorg-devel/2015-December/048164.html
> +*/
> +   cmd = strtok(cmd, ":");
> +
> +   is_ssh = strcmp(basename(cmd), "ssh") == 0;
> +   free(cmd);
> +   }
> +
> +   if (!is_ssh)
> +   return amdgpu_dri3_open(screen, provider, out);
> +
> +   return BadAccess;
> +}
> +
> +#endif /* DRI3_SCREEN_INFO_VERSION >= 1 && XORG_VERSION_CURRENT <= 
> XORG_VERSION_NUMERIC(1,18,99,1,0) */
> +
>  static PixmapPtr amdgpu_dri3_pixmap_from_fd(ScreenPtr screen,
> int fd,
> CARD16 width,
> @@ -172,9 +205,13 @@ static int amdgpu_dri3_fd_from_pixmap(ScreenPtr screen,
>  }
>
>  static dri3_screen_info_rec amdgpu_dri3_screen_info = {
> +#if DRI3_SCREEN_INFO_VERSION >= 1 && XORG_VERSION_CURRENT <= 
> XORG_VERSION_NUMERIC(1,18,99,1,0)
> +   .version = 1,
> +   .open_client = amdgpu_dri3_open_client,
> +#else
> .version = 0,
> -
> .open = amdgpu_dri3_open,
> +#endif
> .pixmap_from_fd = amdgpu_dri3_pixmap_from_fd,
> .fd_from_pixmap = amdgpu_dri3_fd_from_pixmap
>  };
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] DRI3: Refuse to open DRM file descriptor for ssh clients

2016-03-28 Thread Alex Deucher
On Mon, Mar 28, 2016 at 5:45 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes hangs when attempting to use DRI3 on display connections forwarded
> via SSH.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/radeon_dri3.c | 39 ++-
>  1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/src/radeon_dri3.c b/src/radeon_dri3.c
> index 1415a0d..faaf4eb 100644
> --- a/src/radeon_dri3.c
> +++ b/src/radeon_dri3.c
> @@ -38,6 +38,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>
>  static int
> @@ -86,6 +87,38 @@ radeon_dri3_open(ScreenPtr screen, RRProviderPtr provider, 
> int *out)
> return Success;
>  }
>
> +#if DRI3_SCREEN_INFO_VERSION >= 1
> +
> +static int
> +radeon_dri3_open_client(ClientPtr client, ScreenPtr screen,
> +   RRProviderPtr provider, int *out)
> +{
> +   const char *cmdname = GetClientCmdName(client);
> +   Bool is_ssh = FALSE;
> +
> +   /* If the executable name is "ssh", assume that this client connection
> +* is forwarded from another host via SSH
> +*/
> +   if (cmdname) {
> +   char *cmd = strdup(cmdname);
> +
> +   /* Cut off any colon and whatever comes after it, see
> +* 
> https://lists.freedesktop.org/archives/xorg-devel/2015-December/048164.html
> +*/
> +   cmd = strtok(cmd, ":");
> +
> +   is_ssh = strcmp(basename(cmd), "ssh") == 0;
> +   free(cmd);
> +   }
> +
> +   if (!is_ssh)
> +   return radeon_dri3_open(screen, provider, out);
> +
> +   return BadAccess;
> +}
> +
> +#endif /* DRI3_SCREEN_INFO_VERSION >= 1 */
> +
>  static PixmapPtr radeon_dri3_pixmap_from_fd(ScreenPtr screen,
> int fd,
> CARD16 width,
> @@ -179,9 +212,13 @@ static int radeon_dri3_fd_from_pixmap(ScreenPtr screen,
>  }
>
>  static dri3_screen_info_rec radeon_dri3_screen_info = {
> +#if DRI3_SCREEN_INFO_VERSION >= 1
> +   .version = 1,
> +   .open_client = radeon_dri3_open_client,
> +#else
> .version = 0,
> -
> .open = radeon_dri3_open,
> +#endif
> .pixmap_from_fd = radeon_dri3_pixmap_from_fd,
> .fd_from_pixmap = radeon_dri3_fd_from_pixmap
>  };
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Revert "Use render node for DRI3 if available"

2016-03-24 Thread Alex Deucher
On Thu, Mar 24, 2016 at 10:54 PM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> This reverts commit cd94248ffa7d8fe0b57476f79e7e860dee66d1b0.
>
> It broke VDPAU<->GL interop with DRI3 enabled, because the Gallium VDPAU
> code doesn't support DRI3 yet. We can consider re-enabling this once
> there is a Mesa release where the Gallium VDPAU code supports DRI3.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94675
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For both -ati and -amdgpu:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  configure.ac   |  2 +-
>  src/radeon_dri3.c  | 37 +++--
>  src/radeon_probe.h |  1 -
>  3 files changed, 4 insertions(+), 36 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index a4963c3..2409004 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -71,7 +71,7 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
>  XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
>
>  # Checks for libraries.
> -PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.60])
> +PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.58])
>  PKG_CHECK_MODULES(LIBDRM_RADEON, [libdrm_radeon])
>
>  # Obtain compiler/linker options for the driver dependencies
> diff --git a/src/radeon_dri3.c b/src/radeon_dri3.c
> index de97f39..1415a0d 100644
> --- a/src/radeon_dri3.c
> +++ b/src/radeon_dri3.c
> @@ -39,7 +39,9 @@
>  #include 
>  #include 
>
> -static int open_master_node(ScreenPtr screen, int *out)
> +
> +static int
> +radeon_dri3_open(ScreenPtr screen, RRProviderPtr provider, int *out)
>  {
> ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> RADEONInfoPtr info = RADEONPTR(scrn);
> @@ -84,36 +86,6 @@ static int open_master_node(ScreenPtr screen, int *out)
> return Success;
>  }
>
> -static int open_render_node(ScreenPtr screen, int *out)
> -{
> -   ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> -   RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
> -   int fd;
> -
> -   fd = open(pRADEONEnt->render_node, O_RDWR | O_CLOEXEC);
> -   if (fd < 0)
> -   return BadAlloc;
> -
> -   *out = fd;
> -   return Success;
> -}
> -
> -static int
> -radeon_dri3_open(ScreenPtr screen, RRProviderPtr provider, int *out)
> -{
> -   ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> -   RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
> -   int ret = BadAlloc;
> -
> -   if (pRADEONEnt->render_node)
> -   ret = open_render_node(screen, out);
> -
> -   if (ret != Success)
> -   ret = open_master_node(screen, out);
> -
> -   return ret;
> -}
> -
>  static PixmapPtr radeon_dri3_pixmap_from_fd(ScreenPtr screen,
> int fd,
> CARD16 width,
> @@ -218,9 +190,6 @@ Bool
>  radeon_dri3_screen_init(ScreenPtr screen)
>  {
> ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> -   RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
> -
> -   pRADEONEnt->render_node = 
> drmGetRenderDeviceNameFromFd(pRADEONEnt->fd);
>
> if (!dri3_screen_init(screen, _dri3_screen_info)) {
> xf86DrvMsg(scrn->scrnIndex, X_WARNING,
> diff --git a/src/radeon_probe.h b/src/radeon_probe.h
> index 36e2ff6..258c7be 100644
> --- a/src/radeon_probe.h
> +++ b/src/radeon_probe.h
> @@ -142,7 +142,6 @@ typedef struct
>  #ifdef XSERVER_PLATFORM_BUS
>  struct xf86_platform_device *platform_dev;
>  #endif
> -char *render_node;
>  } RADEONEntRec, *RADEONEntPtr;
>
>  extern const OptionInfoRec *RADEONOptionsWeak(void);
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 6/6] Require xserver 1.9 or newer

2016-03-24 Thread Alex Deucher
On Thu, Mar 24, 2016 at 6:14 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> 1.9.0 was released in August 2010.
>
> We were already unintentionally relying on things not available in 1.8
> for at least a year, and nobody has complained.
>
> (Ported from radeon commit e592f32f8b5f5873fcc18b10a69dd5e4ccf11073)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>  configure.ac|  2 +-
>  src/amdgpu_dri2.c   | 14 --
>  src/amdgpu_glamor.c |  8 
>  src/amdgpu_pixmap.c |  4 
>  src/amdgpu_pixmap.h |  8 
>  src/amdgpu_video.c  |  2 --
>  6 files changed, 1 insertion(+), 37 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 1deab68..58b79c5 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -76,7 +76,7 @@ PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu])
>  PKG_CHECK_MODULES(GBM, [gbm])
>
>  # Obtain compiler/linker options for the driver dependencies
> -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.8 xproto fontsproto xf86driproto 
> $REQUIRED_MODULES])
> +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.9 xproto fontsproto xf86driproto 
> $REQUIRED_MODULES])
>  PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
>HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, 
> [xextproto 7.1 available]),
>HAVE_XEXTPROTO_71="no")
> diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
> index de628cd..4478b16 100644
> --- a/src/amdgpu_dri2.c
> +++ b/src/amdgpu_dri2.c
> @@ -71,18 +71,9 @@ struct dri2_window_priv {
> int vblank_delta;
>  };
>
> -#if HAS_DEVPRIVATEKEYREC
> -
>  static DevPrivateKeyRec dri2_window_private_key_rec;
>  #define dri2_window_private_key (_window_private_key_rec)
>
> -#else
> -
> -static int dri2_window_private_key_index;
> -DevPrivateKey dri2_window_private_key = _window_private_key_index;
> -
> -#endif /* HAS_DEVPRIVATEKEYREC */
> -
>  #define get_dri2_window_priv(window) \
> ((struct dri2_window_priv*) \
>  dixLookupPrivate(&(window)->devPrivates, dri2_window_private_key))
> @@ -1454,14 +1445,9 @@ Bool amdgpu_dri2_screen_init(ScreenPtr pScreen)
> driverNames[0] = driverNames[1] = dri2_info.driverName;
>
> if (DRI2InfoCnt == 0) {
> -#if HAS_DIXREGISTERPRIVATEKEY
> if (!dixRegisterPrivateKey(dri2_window_private_key,
>PRIVATE_WINDOW,
>sizeof(struct 
> dri2_window_priv))) {
> -#else
> -   if (!dixRequestPrivate(dri2_window_private_key,
> -  sizeof(struct 
> dri2_window_priv))) {
> -#endif
> xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
>"Failed to get DRI2 window 
> private\n");
> return FALSE;
> diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
> index efde2b0..52aa30d 100644
> --- a/src/amdgpu_glamor.c
> +++ b/src/amdgpu_glamor.c
> @@ -38,11 +38,7 @@
>
>  #include 
>
> -#if HAS_DEVPRIVATEKEYREC
>  DevPrivateKeyRec amdgpu_pixmap_index;
> -#else
> -int amdgpu_pixmap_index;
> -#endif
>
>  void amdgpu_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst)
>  {
> @@ -355,11 +351,7 @@ Bool amdgpu_glamor_init(ScreenPtr screen)
>"Failed to initialize textured pixmap of screen 
> for glamor.\n");
> return FALSE;
> }
> -#if HAS_DIXREGISTERPRIVATEKEY
> if (!dixRegisterPrivateKey(_pixmap_index, PRIVATE_PIXMAP, 0))
> -#else
> -   if (!dixRequestPrivate(_pixmap_index, 0))
> -#endif
> return FALSE;
>
> if (info->shadow_primary)
> diff --git a/src/amdgpu_pixmap.c b/src/amdgpu_pixmap.c
> index 0a1b0b1..f2008b5 100644
> --- a/src/amdgpu_pixmap.c
> +++ b/src/amdgpu_pixmap.c
> @@ -103,11 +103,7 @@ static Bool amdgpu_pixmap_destroy(PixmapPtr pixmap)
>  /* This should only be called when glamor is disabled */
>  Bool amdgpu_pixmap_init(ScreenPtr screen)
>  {
> -#if HAS_DIXREGISTERPRIVATEKEY
> if (!dixRegisterPrivateKey(_pixmap_index, PRIVATE_PIXMAP, 0))
> -#else
> -   if (!dixRequestPrivate(_pixmap_index, 0))
> -#endif
> return FALSE;
>
> screen->CreatePixmap = amdgpu_pixmap_create;
> diff --git a/src/amdgpu_pixmap.h b/src/amdgpu_pixmap.h
> index 6d16628..1fba90e 100644
> --- a/src/

Re: [PATCH xf86-video-amdgpu] Call AMDGPUBlockHandler_KMS before setting initial modes

2016-03-23 Thread Alex Deucher
On Wed, Mar 23, 2016 at 11:19 PM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Doing it the other way around meant that there was still a possibility
> for the front buffer contents to be uninitialized when they start being
> scanned out.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_kms.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index 9fd3254..f840e10 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -536,9 +536,9 @@ static void 
> AMDGPUBlockHandler_oneshot(BLOCKHANDLER_ARGS_DECL)
> ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
> AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
>
> -   drmmode_set_desired_modes(pScrn, >drmmode, TRUE);
> -
> AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS);
> +
> +   drmmode_set_desired_modes(pScrn, >drmmode, TRUE);
>  }
>
>  static void
> --
> 2.8.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


[PATCH xf86-video-amdgpu 1/3] add Polaris chip families

2016-03-23 Thread Alex Deucher
Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
---
 src/amdgpu_probe.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/amdgpu_probe.h b/src/amdgpu_probe.h
index 6edd4a1..865c197 100644
--- a/src/amdgpu_probe.h
+++ b/src/amdgpu_probe.h
@@ -67,6 +67,8 @@ typedef enum {
CHIP_FAMILY_CARRIZO,
CHIP_FAMILY_FIJI,
CHIP_FAMILY_STONEY,
+   CHIP_FAMILY_POLARIS10,
+   CHIP_FAMILY_POLARIS11,
CHIP_FAMILY_LAST
 } AMDGPUChipFamily;
 
-- 
2.5.0

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


[PATCH xf86-video-amdgpu 2/3] add polaris11 pci id

2016-03-23 Thread Alex Deucher
From: Flora Cui <flora@amd.com>

Signed-off-by: Flora Cui <flora@amd.com>
Reviewed-By: Jammy Zhou <jammy.z...@amd.com>
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>
---
 src/amdgpu_chipinfo_gen.h | 6 ++
 src/amdgpu_chipset_gen.h  | 6 ++
 src/amdgpu_pci_chipset_gen.h  | 6 ++
 src/amdgpu_pci_device_match_gen.h | 6 ++
 src/ati_pciids_gen.h  | 6 ++
 src/pcidb/ati_pciids.csv  | 6 ++
 6 files changed, 36 insertions(+)

diff --git a/src/amdgpu_chipinfo_gen.h b/src/amdgpu_chipinfo_gen.h
index dab8746..df8d717 100644
--- a/src/amdgpu_chipinfo_gen.h
+++ b/src/amdgpu_chipinfo_gen.h
@@ -79,4 +79,10 @@ static AMDGPUCardInfo AMDGPUCards[] = {
  { 0x9877, CHIP_FAMILY_CARRIZO },
  { 0x7300, CHIP_FAMILY_FIJI },
  { 0x98E4, CHIP_FAMILY_STONEY },
+ { 0x67E0, CHIP_FAMILY_POLARIS11 },
+ { 0x67E1, CHIP_FAMILY_POLARIS11 },
+ { 0x67E8, CHIP_FAMILY_POLARIS11 },
+ { 0x67E9, CHIP_FAMILY_POLARIS11 },
+ { 0x67EB, CHIP_FAMILY_POLARIS11 },
+ { 0x67FF, CHIP_FAMILY_POLARIS11 },
 };
diff --git a/src/amdgpu_chipset_gen.h b/src/amdgpu_chipset_gen.h
index a8683e0..fe7c7a8 100644
--- a/src/amdgpu_chipset_gen.h
+++ b/src/amdgpu_chipset_gen.h
@@ -79,5 +79,11 @@ SymTabRec AMDGPUChipsets[] = {
   { PCI_CHIP_CARRIZO_9877, "CARRIZO" },
   { PCI_CHIP_FIJI_7300, "FIJI" },
   { PCI_CHIP_STONEY_98E4, "STONEY" },
+  { PCI_CHIP_POLARIS11_67E0, "POLARIS11" },
+  { PCI_CHIP_POLARIS11_67E1, "POLARIS11" },
+  { PCI_CHIP_POLARIS11_67E8, "POLARIS11" },
+  { PCI_CHIP_POLARIS11_67E9, "POLARIS11" },
+  { PCI_CHIP_POLARIS11_67EB, "POLARIS11" },
+  { PCI_CHIP_POLARIS11_67FF, "POLARIS11" },
   { -1, NULL }
 };
diff --git a/src/amdgpu_pci_chipset_gen.h b/src/amdgpu_pci_chipset_gen.h
index fc16b62..3fa9a47 100644
--- a/src/amdgpu_pci_chipset_gen.h
+++ b/src/amdgpu_pci_chipset_gen.h
@@ -79,5 +79,11 @@ static PciChipsets AMDGPUPciChipsets[] = {
  { PCI_CHIP_CARRIZO_9877, PCI_CHIP_CARRIZO_9877, RES_SHARED_VGA },
  { PCI_CHIP_FIJI_7300, PCI_CHIP_FIJI_7300, RES_SHARED_VGA },
  { PCI_CHIP_STONEY_98E4, PCI_CHIP_STONEY_98E4, RES_SHARED_VGA },
+ { PCI_CHIP_POLARIS11_67E0, PCI_CHIP_POLARIS11_67E0, RES_SHARED_VGA },
+ { PCI_CHIP_POLARIS11_67E1, PCI_CHIP_POLARIS11_67E1, RES_SHARED_VGA },
+ { PCI_CHIP_POLARIS11_67E8, PCI_CHIP_POLARIS11_67E8, RES_SHARED_VGA },
+ { PCI_CHIP_POLARIS11_67E9, PCI_CHIP_POLARIS11_67E9, RES_SHARED_VGA },
+ { PCI_CHIP_POLARIS11_67EB, PCI_CHIP_POLARIS11_67EB, RES_SHARED_VGA },
+ { PCI_CHIP_POLARIS11_67FF, PCI_CHIP_POLARIS11_67FF, RES_SHARED_VGA },
  { -1, -1, RES_UNDEFINED }
 };
diff --git a/src/amdgpu_pci_device_match_gen.h 
b/src/amdgpu_pci_device_match_gen.h
index 1c00759..5021d99 100644
--- a/src/amdgpu_pci_device_match_gen.h
+++ b/src/amdgpu_pci_device_match_gen.h
@@ -79,5 +79,11 @@ static const struct pci_id_match amdgpu_device_match[] = {
  ATI_DEVICE_MATCH( PCI_CHIP_CARRIZO_9877, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_FIJI_7300, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_STONEY_98E4, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67E0, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67E1, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67E8, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67E9, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67EB, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67FF, 0 ),
  { 0, 0, 0 }
 };
diff --git a/src/ati_pciids_gen.h b/src/ati_pciids_gen.h
index 76d161c..86a8e19 100644
--- a/src/ati_pciids_gen.h
+++ b/src/ati_pciids_gen.h
@@ -77,3 +77,9 @@
 #define PCI_CHIP_CARRIZO_9877 0x9877
 #define PCI_CHIP_FIJI_7300 0x7300
 #define PCI_CHIP_STONEY_98E4 0x98E4
+#define PCI_CHIP_POLARIS11_67E0 0x67E0
+#define PCI_CHIP_POLARIS11_67E1 0x67E1
+#define PCI_CHIP_POLARIS11_67E8 0x67E8
+#define PCI_CHIP_POLARIS11_67E9 0x67E9
+#define PCI_CHIP_POLARIS11_67EB 0x67EB
+#define PCI_CHIP_POLARIS11_67FF 0x67FF
diff --git a/src/pcidb/ati_pciids.csv b/src/pcidb/ati_pciids.csv
index 21de3a9..55e5cda 100644
--- a/src/pcidb/ati_pciids.csv
+++ b/src/pcidb/ati_pciids.csv
@@ -78,3 +78,9 @@
 "0x9877","CARRIZO_9877","CARRIZO","CARRIZO"
 "0x7300","FIJI_7300","FIJI","FIJI"
 "0x98E4","STONEY_98E4","STONEY","STONEY"
+"0x67E0","POLARIS11_67E0","POLARIS11","POLARIS11"
+"0x67E1","POLARIS11_67E1","POLARIS11","POLARIS11"
+"0x67E8","POLARIS11_67E8","POLARIS11","POLARIS11"
+"0x67E9","POLARIS11_67E9","POLARIS11","POLARIS11"
+"0x67EB","POLARIS11_67EB","POLARIS11","POLARIS11"
+"0x67FF","POLARIS11_67FF","POLARIS11","POLARIS11"
-- 
2.5.0

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


[PATCH xf86-video-amdgpu 3/3] add polaris10 pci id

2016-03-23 Thread Alex Deucher
From: Flora Cui 

Signed-off-by: Flora Cui 
Reviewed-by: Jammy Zhou 
---
 src/amdgpu_chipinfo_gen.h | 2 ++
 src/amdgpu_chipset_gen.h  | 2 ++
 src/amdgpu_pci_chipset_gen.h  | 2 ++
 src/amdgpu_pci_device_match_gen.h | 2 ++
 src/ati_pciids_gen.h  | 2 ++
 src/pcidb/ati_pciids.csv  | 2 ++
 6 files changed, 12 insertions(+)

diff --git a/src/amdgpu_chipinfo_gen.h b/src/amdgpu_chipinfo_gen.h
index df8d717..4a0f6b8 100644
--- a/src/amdgpu_chipinfo_gen.h
+++ b/src/amdgpu_chipinfo_gen.h
@@ -85,4 +85,6 @@ static AMDGPUCardInfo AMDGPUCards[] = {
  { 0x67E9, CHIP_FAMILY_POLARIS11 },
  { 0x67EB, CHIP_FAMILY_POLARIS11 },
  { 0x67FF, CHIP_FAMILY_POLARIS11 },
+ { 0x67C0, CHIP_FAMILY_POLARIS10 },
+ { 0x67DF, CHIP_FAMILY_POLARIS10 },
 };
diff --git a/src/amdgpu_chipset_gen.h b/src/amdgpu_chipset_gen.h
index fe7c7a8..1be967c 100644
--- a/src/amdgpu_chipset_gen.h
+++ b/src/amdgpu_chipset_gen.h
@@ -85,5 +85,7 @@ SymTabRec AMDGPUChipsets[] = {
   { PCI_CHIP_POLARIS11_67E9, "POLARIS11" },
   { PCI_CHIP_POLARIS11_67EB, "POLARIS11" },
   { PCI_CHIP_POLARIS11_67FF, "POLARIS11" },
+  { PCI_CHIP_POLARIS10_67C0, "POLARIS10" },
+  { PCI_CHIP_POLARIS10_67DF, "POLARIS10" },
   { -1, NULL }
 };
diff --git a/src/amdgpu_pci_chipset_gen.h b/src/amdgpu_pci_chipset_gen.h
index 3fa9a47..9ed8faf 100644
--- a/src/amdgpu_pci_chipset_gen.h
+++ b/src/amdgpu_pci_chipset_gen.h
@@ -85,5 +85,7 @@ static PciChipsets AMDGPUPciChipsets[] = {
  { PCI_CHIP_POLARIS11_67E9, PCI_CHIP_POLARIS11_67E9, RES_SHARED_VGA },
  { PCI_CHIP_POLARIS11_67EB, PCI_CHIP_POLARIS11_67EB, RES_SHARED_VGA },
  { PCI_CHIP_POLARIS11_67FF, PCI_CHIP_POLARIS11_67FF, RES_SHARED_VGA },
+ { PCI_CHIP_POLARIS10_67C0, PCI_CHIP_POLARIS10_67C0, RES_SHARED_VGA },
+ { PCI_CHIP_POLARIS10_67DF, PCI_CHIP_POLARIS10_67DF, RES_SHARED_VGA },
  { -1, -1, RES_UNDEFINED }
 };
diff --git a/src/amdgpu_pci_device_match_gen.h 
b/src/amdgpu_pci_device_match_gen.h
index 5021d99..dd2c0cd 100644
--- a/src/amdgpu_pci_device_match_gen.h
+++ b/src/amdgpu_pci_device_match_gen.h
@@ -85,5 +85,7 @@ static const struct pci_id_match amdgpu_device_match[] = {
  ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67E9, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67EB, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_POLARIS11_67FF, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_POLARIS10_67C0, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_POLARIS10_67DF, 0 ),
  { 0, 0, 0 }
 };
diff --git a/src/ati_pciids_gen.h b/src/ati_pciids_gen.h
index 86a8e19..a949118 100644
--- a/src/ati_pciids_gen.h
+++ b/src/ati_pciids_gen.h
@@ -83,3 +83,5 @@
 #define PCI_CHIP_POLARIS11_67E9 0x67E9
 #define PCI_CHIP_POLARIS11_67EB 0x67EB
 #define PCI_CHIP_POLARIS11_67FF 0x67FF
+#define PCI_CHIP_POLARIS10_67C0 0x67C0
+#define PCI_CHIP_POLARIS10_67DF 0x67DF
diff --git a/src/pcidb/ati_pciids.csv b/src/pcidb/ati_pciids.csv
index 55e5cda..7620aa3 100644
--- a/src/pcidb/ati_pciids.csv
+++ b/src/pcidb/ati_pciids.csv
@@ -84,3 +84,5 @@
 "0x67E9","POLARIS11_67E9","POLARIS11","POLARIS11"
 "0x67EB","POLARIS11_67EB","POLARIS11","POLARIS11"
 "0x67FF","POLARIS11_67FF","POLARIS11","POLARIS11"
+"0x67C0","POLARIS10_67C0","POLARIS10","POLARIS10"
+"0x67DF","POLARIS10_67DF","POLARIS10","POLARIS10"
-- 
2.5.0

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati 5/5] Require xserver 1.9 or newer

2016-03-23 Thread Alex Deucher
On Wed, Mar 23, 2016 at 5:52 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> 1.9.0 was released in August 2010.
>
> We were already unintentionally relying on things not available in 1.8
> for at least a year, and nobody has complained.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>  configure.ac|  2 +-
>  src/radeon.h|  8 
>  src/radeon_dri2.c   | 14 --
>  src/radeon_glamor.c |  8 
>  src/radeon_video.c  |  2 --
>  5 files changed, 1 insertion(+), 33 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index eb97a6b..a4963c3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -75,7 +75,7 @@ PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.60])
>  PKG_CHECK_MODULES(LIBDRM_RADEON, [libdrm_radeon])
>
>  # Obtain compiler/linker options for the driver dependencies
> -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.8 xproto fontsproto xf86driproto 
> $REQUIRED_MODULES])
> +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.9 xproto fontsproto xf86driproto 
> $REQUIRED_MODULES])
>  PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
>HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, 
> [xextproto 7.1 available]),
>HAVE_XEXTPROTO_71="no")
> diff --git a/src/radeon.h b/src/radeon.h
> index b9afd8e..37d5fb6 100644
> --- a/src/radeon.h
> +++ b/src/radeon.h
> @@ -272,19 +272,11 @@ struct radeon_pixmap {
> uint32_t handle;
>  };
>
> -#if HAS_DEVPRIVATEKEYREC
>  extern DevPrivateKeyRec glamor_pixmap_index;
> -#else
> -extern int glamor_pixmap_index;
> -#endif
>
>  static inline struct radeon_pixmap *radeon_get_pixmap_private(PixmapPtr 
> pixmap)
>  {
> -#if HAS_DEVPRIVATEKEYREC
> return dixGetPrivate(>devPrivates, _pixmap_index);
> -#else
> -   return dixLookupPrivate(>devPrivates, _pixmap_index);
> -#endif
>  }
>
>  static inline void radeon_set_pixmap_private(PixmapPtr pixmap, struct 
> radeon_pixmap *priv)
> diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
> index 474611a..73e09d0 100644
> --- a/src/radeon_dri2.c
> +++ b/src/radeon_dri2.c
> @@ -70,18 +70,9 @@ struct dri2_window_priv {
>  int vblank_delta;
>  };
>
> -#if HAS_DEVPRIVATEKEYREC
> -
>  static DevPrivateKeyRec dri2_window_private_key_rec;
>  #define dri2_window_private_key (_window_private_key_rec)
>
> -#else
> -
> -static int dri2_window_private_key_index;
> -DevPrivateKey dri2_window_private_key = _window_private_key_index;
> -
> -#endif /* HAS_DEVPRIVATEKEYREC */
> -
>  #define get_dri2_window_priv(window) \
>  ((struct dri2_window_priv*) \
>   dixLookupPrivate(&(window)->devPrivates, dri2_window_private_key))
> @@ -1588,14 +1579,9 @@ radeon_dri2_screen_init(ScreenPtr pScreen)
>  driverNames[1] = NULL; /* no VDPAU support */
>
> if (DRI2InfoCnt == 0) {
> -#if HAS_DIXREGISTERPRIVATEKEY
> if (!dixRegisterPrivateKey(dri2_window_private_key,
>PRIVATE_WINDOW,
>sizeof(struct dri2_window_priv))) {
> -#else
> -   if (!dixRequestPrivate(dri2_window_private_key,
> -  sizeof(struct dri2_window_priv))) {
> -#endif
> xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
>"Failed to get DRI2 window private\n");
> return FALSE;
> diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
> index cc2b1f2..f94e0fd 100644
> --- a/src/radeon_glamor.c
> +++ b/src/radeon_glamor.c
> @@ -34,11 +34,7 @@
>  #include "radeon_bo_helper.h"
>  #include "radeon_glamor.h"
>
> -#if HAS_DEVPRIVATEKEYREC
>  DevPrivateKeyRec glamor_pixmap_index;
> -#else
> -int glamor_pixmap_index;
> -#endif
>
>  void
>  radeon_glamor_exchange_buffers(PixmapPtr src,
> @@ -370,11 +366,7 @@ radeon_glamor_init(ScreenPtr screen)
> return FALSE;
> }
>
> -#if HAS_DIXREGISTERPRIVATEKEY
> if (!dixRegisterPrivateKey(_pixmap_index, PRIVATE_PIXMAP, 0))
> -#else
> -   if (!dixRequestPrivate(_pixmap_index, 0))
> -#endif
> return FALSE;
>
> if (info->shadow_primary)
> diff --git a/src/radeon_video.c b/src/radeon_video.c
> index 48b06e2..e08d8e0 100644
> --- a/src/radeon_video.c
> +++ b/src/radeon_video.c
> @@ -94,9 +94,7 @@ radeon_pick_best_crtc(ScrnInfoPtr pScrn, Bool 
> consider_disabled,
>  best_coverage = 0;
>
>

Re: [PATCH xf86-video-ati] Check for xf86CursorResetCursor

2016-03-20 Thread Alex Deucher
On Fri, Mar 18, 2016 at 3:47 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> If it's available, Xorg calls it on each mode configuration change. It
> does what xf86_reload_cursors does (and more), so we don't need to call
> the latter anymore.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  configure.ac  | 6 ++
>  src/drmmode_display.c | 2 ++
>  2 files changed, 8 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index f2bf57c..eb97a6b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -147,6 +147,12 @@ AC_CHECK_DECL(fbGlyphs,
>#include 
>#include ])
>
> +AC_CHECK_DECL(xf86CursorResetCursor,
> + [AC_DEFINE(HAVE_XF86_CURSOR_RESET_CURSOR, 1,
> + [Have xf86CursorResetCursor API])], [],
> + [#include 
> +  #include ])
> +
>  AC_CHECK_DECL(xorg_list_init,
>   [AC_DEFINE(HAVE_XORG_LIST, 1, [Have xorg_list API])], [],
>   [#include 
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 635f71c..3e0bf25 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -870,8 +870,10 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
> break;
> }
>
> +#ifndef HAVE_XF86_CURSOR_RESET_CURSOR
> if (!info->hwcursor_disabled)
> xf86_reload_cursors(pScreen);
> +#endif
>
>  done:
> if (!ret) {
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati 2/2] Don't try DRI2/Present flipping while the HW cursor can't be used

2016-03-19 Thread Alex Deucher
On Fri, Mar 18, 2016 at 3:28 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Flipping doesn't interact correctly with SW cursor: A flip makes the SW
> cursor disappear. It will only appear again when the cursor is moved,
> but it will be surrounded by corruption, because the SW cursor code
> will restore stale screen contents at the old cursor location before
> drawing the cursor at the new location.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 15 ++-
>  src/radeon.h  |  5 +
>  src/radeon_dri2.c |  1 +
>  src/radeon_kms.c  |  7 +--
>  src/radeon_present.c  |  3 +++
>  5 files changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 36a7957..635f71c 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -857,7 +857,20 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
> }
> }
>
> -   if (drmmode_can_use_hw_cursor(crtc))
> +   /* Compute index of this CRTC into xf86_config->crtc */
> +   for (i = 0; i < xf86_config->num_crtc; i++) {
> +   if (xf86_config->crtc[i] != crtc)
> +   continue;
> +
> +   if (!crtc->enabled || drmmode_can_use_hw_cursor(crtc))
> +   info->hwcursor_disabled &= ~(1 << i);
> +   else
> +   info->hwcursor_disabled |= 1 << i;
> +
> +   break;
> +   }
> +
> +   if (!info->hwcursor_disabled)
> xf86_reload_cursors(pScreen);
>
>  done:
> diff --git a/src/radeon.h b/src/radeon.h
> index fe26df4..b9afd8e 100644
> --- a/src/radeon.h
> +++ b/src/radeon.h
> @@ -547,6 +547,11 @@ typedef struct {
>  int cursor_w;
>  int cursor_h;
>
> +/* If bit n of this field is set, xf86_config->crtc[n] currently can't
> + * use the HW cursor
> + */
> +unsigned hwcursor_disabled;
> +
>  #ifdef USE_GLAMOR
>  struct {
> CreateGCProcPtr SavedCreateGC;
> diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
> index 657e6a6..474611a 100644
> --- a/src/radeon_dri2.c
> +++ b/src/radeon_dri2.c
> @@ -823,6 +823,7 @@ can_flip(ScrnInfoPtr pScrn, DrawablePtr draw,
>
>  return draw->type == DRAWABLE_WINDOW &&
>info->allowPageFlip &&
> +  !info->hwcursor_disabled &&
>!info->drmmode.present_flipping &&
>pScrn->vtSema &&
>DRI2CanFlip(draw) &&
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 8048c95..d89c376 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -1285,15 +1285,18 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
> xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TearFree enabled\n");
>
>  if (info->dri2.pKernelDRMVersion->version_minor >= 8) {
> +   Bool sw_cursor = xf86ReturnOptValBool(info->Options, 
> OPTION_SW_CURSOR, FALSE);
> +
> info->allowPageFlip = xf86ReturnOptValBool(info->Options,
>OPTION_PAGE_FLIP, TRUE);
>
> -   if (info->tear_free || info->shadow_primary) {
> +   if (sw_cursor || info->tear_free || info->shadow_primary) {
> xf86DrvMsg(pScrn->scrnIndex,
>info->allowPageFlip ? X_WARNING : X_DEFAULT,
>"KMS Pageflipping: disabled%s\n",
>info->allowPageFlip ?
> -  " because of ShadowPrimary/TearFree" : "");
> +  (sw_cursor ? " because of SWcursor" :
> +   " because of ShadowPrimary/TearFree") : "");
> info->allowPageFlip = FALSE;
> } else {
> xf86DrvMsg(pScrn->scrnIndex, X_INFO,
> diff --git a/src/radeon_present.c b/src/radeon_present.c
> index e0a549d..3be3360 100644
> --- a/src/radeon_present.c
> +++ b/src/radeon_present.c
> @@ -244,6 +244,9 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr 
> window, PixmapPtr pixmap,
>  if (!info->allowPageFlip)
> return FALSE;
>
> +if (info->hwcursor_disabled)
> +   return FALSE;
> +
>  if (!sync_flip)
> return FALSE;
>
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 00/12] A dozen fixes ported from radeon

2016-03-19 Thread Alex Deucher
On Fri, Mar 18, 2016 at 6:01 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> [PATCH xf86-video-amdgpu 01/12] Build RandR 1.4 provider name from
> [PATCH xf86-video-amdgpu 02/12] Fix RandR CRTC transforms
> [PATCH xf86-video-amdgpu 03/12] drm_queue: Don't abort events
> [PATCH xf86-video-amdgpu 04/12] DRI2: Also clear dri2_flipping when
> [PATCH xf86-video-amdgpu 05/12] Remove amdgpu_scanout_flip_handler
> [PATCH xf86-video-amdgpu 06/12] Make DRM event queue xf86CrtcPtr
> [PATCH xf86-video-amdgpu 07/12] Deal with modesets and page flips
> [PATCH xf86-video-amdgpu 08/12] Remove check for XF86_CRTC_VERSION 3
> [PATCH xf86-video-amdgpu 09/12] Consolidate pScreen usage in
> [PATCH xf86-video-amdgpu 10/12] Make Option "TearFree" effective for
> [PATCH xf86-video-amdgpu 11/12] present: Clear drmmode->fb_id before
> [PATCH xf86-video-amdgpu 12/12] present: Return rotated CRTCs from

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati 2/2] present: Return rotated CRTCs from radeon_present_get_crtc

2016-03-09 Thread Alex Deucher
On Wed, Mar 9, 2016 at 4:46 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Sync-to-vblank works fine with rotation. We're still checking for
> rotation in radeon_present_check_flip.
>
> Returning NULL from here resulted in the xserver present code falling
> back to the fake CRTC running at 1 fps.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/radeon_present.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/radeon_present.c b/src/radeon_present.c
> index 286b3f4..e0a549d 100644
> --- a/src/radeon_present.c
> +++ b/src/radeon_present.c
> @@ -77,8 +77,7 @@ radeon_present_get_crtc(WindowPtr window)
>  window->drawable.y,
>  window->drawable.y + 
> window->drawable.height);
>
> -/* Make sure the CRTC is valid and this is the real front buffer */
> -if (crtc != NULL && !crtc->rotatedData)
> +if (crtc)
> randr_crtc = crtc->randr_crtc;
>
>  return randr_crtc;
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati 3/3] Make Option "TearFree" effective for rotated/reflected outputs as well

2016-03-08 Thread Alex Deucher
On Tue, Mar 8, 2016 at 4:48 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Support varies by xserver version:
>
> < 1.12:No support for the driver handling rotation/reflection
> 1.12-1.15: Support for driver handling rotation/reflection, but there's
>a bug preventing the HW cursor from being visible everywhere
>it should be on rotated outputs, so we can only support
>TearFree for reflection.
>>= 1.16:   While the bug above is still there (fixes pending review),
>the driver can force SW cursor for rotated outputs, so we
>can support TearFree for rotation as well.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 132 
> +-
>  src/radeon_kms.c  | 123 ++
>  2 files changed, 214 insertions(+), 41 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index cc71dd0..c5a7eef 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -617,6 +617,34 @@ radeon_screen_damage_report(DamagePtr damage, RegionPtr 
> region, void *closure)
> damage->damage.data = NULL;
>  }
>
> +#if XF86_CRTC_VERSION >= 4
> +
> +static Bool
> +drmmode_handle_transform(xf86CrtcPtr crtc)
> +{
> +   RADEONInfoPtr info = RADEONPTR(crtc->scrn);
> +   Bool ret;
> +
> +   crtc->driverIsPerformingTransform = info->tear_free &&
> +   !crtc->transformPresent && crtc->rotation != RR_Rotate_0;
> +
> +   ret = xf86CrtcRotate(crtc);
> +
> +   crtc->driverIsPerformingTransform = ret && crtc->transform_in_use;
> +
> +   return ret;
> +}
> +
> +#else
> +
> +static Bool
> +drmmode_handle_transform(xf86CrtcPtr crtc)
> +{
> +   return xf86CrtcRotate(crtc);
> +}
> +
> +#endif
> +
>  static Bool
>  drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
>  Rotation rotation, int x, int y)
> @@ -694,9 +722,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
> output_count++;
> }
>
> -   if (!xf86CrtcRotate(crtc)) {
> +   if (!drmmode_handle_transform(crtc))
> goto done;
> -   }
> +
> crtc->funcs->gamma_set(crtc, crtc->gamma_red, 
> crtc->gamma_green,
>crtc->gamma_blue, crtc->gamma_size);
>
> @@ -718,7 +746,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
>
> drmmode_crtc_scanout_destroy(drmmode, 
> _crtc->scanout[0]);
> drmmode_crtc_scanout_destroy(drmmode, 
> _crtc->scanout[1]);
> -   } else if (info->tear_free || info->shadow_primary) {
> +   } else if (info->tear_free || info->shadow_primary ||
> +  crtc->driverIsPerformingTransform) {
> for (i = 0; i < (info->tear_free ? 2 : 1); i++) {
> drmmode_crtc_scanout_create(crtc,
> 
> _crtc->scanout[i],
> @@ -744,8 +773,17 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
> pBox = RegionExtents(pRegion);
> pBox->x1 = min(pBox->x1, x);
> pBox->y1 = min(pBox->y1, y);
> -   pBox->x2 = max(pBox->x2, x + 
> mode->HDisplay);
> -   pBox->y2 = max(pBox->y2, y + 
> mode->VDisplay);
> +
> +   switch (crtc->rotation & 0xf) {
> +   case RR_Rotate_90:
> +   case RR_Rotate_270:
> +   pBox->x2 = max(pBox->x2, x + 
> mode->VDisplay);
> +   pBox->y2 = max(pBox->y2, y + 
> mode->HDisplay);
> +   break;
> +   default:
> +   pBox->x2 = max(pBox->x2, x + 
> mode->HDisplay);
> +   pBox->y2 = max(pBox->y2, y + 
> mode-&

Re: [PATCH xf86-video-ati 2/2] Deal with modesets and page flips crossing on a CRTC

2016-02-29 Thread Alex Deucher
On Mon, Feb 29, 2016 at 4:58 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> If we set a mode while a flip is pending, the kernel driver may program
> the flip to the hardware after the modeset. If that happens, the hardware
> will display the BO from the flip, whereas we will assume it displays the
> BO from the modeset. In other words, the display will most likely freeze,
> at least until another modeset.
>
> Prevent this condition by waiting for a pending flip to finish before
> setting a mode.
>
> Fixes display freezing when setting rotation or a transform with
> TearFree enabled.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>


> ---
>  src/drmmode_display.c | 13 +
>  src/drmmode_display.h |  6 +-
>  src/radeon_kms.c  |  2 ++
>  3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 24430a2..f1ca02c 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -760,6 +760,12 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
> radeon_bo_wait(drmmode_crtc->scanout[0].bo);
> }
> }
> +
> +   /* Wait for any pending flip to finish */
> +   do {} while (drmmode_crtc->flip_pending &&
> +drmHandleEvent(drmmode->fd,
> +   >event_context) > 0);
> +
> if (drmModeSetCrtc(drmmode->fd,
>drmmode_crtc->mode_crtc->crtc_id,
>fb_id, x, y, output_ids,
> @@ -2024,6 +2030,7 @@ static const xf86CrtcConfigFuncsRec 
> drmmode_xf86crtc_config_funcs = {
>  static void
>  drmmode_flip_abort(xf86CrtcPtr crtc, void *event_data)
>  {
> +   drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> drmmode_flipdata_ptr flipdata = event_data;
>
> if (--flipdata->flip_count == 0) {
> @@ -2032,11 +2039,14 @@ drmmode_flip_abort(xf86CrtcPtr crtc, void *event_data)
> flipdata->abort(crtc, flipdata->event_data);
> free(flipdata);
> }
> +
> +   drmmode_crtc->flip_pending = FALSE;
>  }
>
>  static void
>  drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void 
> *event_data)
>  {
> +   drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> RADEONInfoPtr info = RADEONPTR(crtc->scrn);
> drmmode_flipdata_ptr flipdata = event_data;
>
> @@ -2059,6 +2069,8 @@ drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, 
> uint64_t usec, void *even
>
> free(flipdata);
> }
> +
> +   drmmode_crtc->flip_pending = FALSE;
>  }
>
>
> @@ -2582,6 +2594,7 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr 
> client,
>"flip queue failed: %s\n", 
> strerror(errno));
> goto error;
> }
> +   drmmode_crtc->flip_pending = TRUE;
> drm_queue = NULL;
> }
>
> diff --git a/src/drmmode_display.h b/src/drmmode_display.h
> index 99c6c91..c295735 100644
> --- a/src/drmmode_display.h
> +++ b/src/drmmode_display.h
> @@ -95,8 +95,12 @@ typedef struct {
>  uint16_t lut_r[256], lut_g[256], lut_b[256];
>  int prime_pixmap_x;
>
> -/* Modeset needed for DPMS on */
> +/* Modeset needed (for DPMS on or after a page flip crossing with a
> + * modeset)
> + */
>  Bool need_modeset;
> +/* A flip is pending for this CRTC */
> +Bool flip_pending;
>  } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr;
>
>  typedef struct {
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 3768983..44fe71e 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -483,6 +483,7 @@ radeon_scanout_flip_abort(xf86CrtcPtr crtc, void 
> *event_data)
>  drmmode_crtc_private_ptr drmmode_crtc = event_data;
>
>  drmmode_crtc->scanout_update_pending = FALSE;
> +drmmode_crtc->flip_pending = FALSE;
>  }
>
>  static void
> @@ -523,6 +524,7 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
>
>  drmmode_crtc->scanout_id = scanout_id;
>  drmmode_crtc->scanout_update_pending = TRUE;
> +drmmode_crtc->flip_pending = TRUE;
>  }
>
>  static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati 1/2] drm_queue: Don't abort events immediately from radeon_drm_abort_client

2016-02-26 Thread Alex Deucher
On Thu, Feb 25, 2016 at 2:50 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Keep them around until the DRM event arrives, but then call the abort
> functions instead of the handler functions.
>
> This is a prerequisite for the following fix.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/radeon_drm_queue.c | 18 +-
>  1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/src/radeon_drm_queue.c b/src/radeon_drm_queue.c
> index 5e54ef8..a50a1fd 100644
> --- a/src/radeon_drm_queue.c
> +++ b/src/radeon_drm_queue.c
> @@ -64,8 +64,12 @@ radeon_drm_queue_handler(int fd, unsigned int frame, 
> unsigned int sec,
> xorg_list_for_each_entry_safe(e, tmp, _drm_queue, list) {
> if (e == user_data) {
> xorg_list_del(>list);
> -   e->handler(e->scrn, frame,
> -  (uint64_t)sec * 100 + usec, e->data);
> +   if (e->handler)
> +   e->handler(e->scrn, frame,
> +  (uint64_t)sec * 100 + usec,
> +  e->data);
> +   else
> +   e->abort(e->scrn, e->data);
> free(e);
> break;
> }
> @@ -115,15 +119,19 @@ radeon_drm_abort_one(struct radeon_drm_queue_entry *e)
>
>  /*
>   * Abort drm queue entries for a client
> + *
> + * NOTE: This keeps the entries in the list until the DRM event arrives,
> + * but then it calls the abort functions instead of the handler
> + * functions.
>   */
>  void
>  radeon_drm_abort_client(ClientPtr client)
>  {
> -struct radeon_drm_queue_entry *e, *tmp;
> +struct radeon_drm_queue_entry *e;
>
> -xorg_list_for_each_entry_safe(e, tmp, _drm_queue, list) {
> +xorg_list_for_each_entry(e, _drm_queue, list) {
> if (e->client == client)
> -   radeon_drm_abort_one(e);
> +   e->handler = NULL;
>  }
>  }
>
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati] Remove radeon_scanout_flip_handler

2016-02-26 Thread Alex Deucher
On Thu, Feb 25, 2016 at 4:03 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> No longer necessary now that radeon_drm_queue_handler can handle
> e->handler == NULL.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/radeon_kms.c | 9 +
>  1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 38f5c4e..d93a4ce 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -486,12 +486,6 @@ radeon_scanout_flip_abort(ScrnInfoPtr scrn, void 
> *event_data)
>  }
>
>  static void
> -radeon_scanout_flip_handler(ScrnInfoPtr scrn, uint32_t frame, uint64_t usec, 
> void *event_data)
> -{
> -radeon_scanout_flip_abort(scrn, event_data);
> -}
> -
> -static void
>  radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
> xf86CrtcPtr xf86_crtc)
>  {
> @@ -510,8 +504,7 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
>  scrn = xf86_crtc->scrn;
>  drm_queue_entry = radeon_drm_queue_alloc(scrn, 
> RADEON_DRM_QUEUE_CLIENT_DEFAULT,
>  RADEON_DRM_QUEUE_ID_DEFAULT,
> -drmmode_crtc,
> -radeon_scanout_flip_handler,
> +drmmode_crtc, NULL,
>  radeon_scanout_flip_abort);
>  if (!drm_queue_entry) {
> xf86DrvMsg(scrn->scrnIndex, X_WARNING,
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 1/4] Add amdgpu_pixmap_get_handle helper

2016-02-26 Thread Alex Deucher
On Wed, Feb 24, 2016 at 4:49 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> (inspired by radeon commits dfad91fffb5bd013785223b42d78886df839eacf
>  and ccbda955ebae1d457d35293833f12791e0f9fb0b)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_bo_helper.c | 10 ++
>  src/amdgpu_bo_helper.h |  2 ++
>  2 files changed, 12 insertions(+)
>
> diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
> index 65f1ac6..ad56197 100644
> --- a/src/amdgpu_bo_helper.c
> +++ b/src/amdgpu_bo_helper.c
> @@ -131,6 +131,16 @@ Bool amdgpu_bo_get_handle(struct amdgpu_buffer *bo, 
> uint32_t *handle)
> handle) == 0;
>  }
>
> +Bool amdgpu_pixmap_get_handle(PixmapPtr pixmap, uint32_t *handle)
> +{
> +   struct amdgpu_buffer *bo = amdgpu_get_pixmap_bo(pixmap);
> +
> +   if (!bo)
> +   return FALSE;
> +
> +   return amdgpu_bo_get_handle(bo, handle);
> +}
> +
>  int amdgpu_bo_map(ScrnInfoPtr pScrn, struct amdgpu_buffer *bo)
>  {
> int ret = 0;
> diff --git a/src/amdgpu_bo_helper.h b/src/amdgpu_bo_helper.h
> index 4dae200..10e2db7 100644
> --- a/src/amdgpu_bo_helper.h
> +++ b/src/amdgpu_bo_helper.h
> @@ -31,6 +31,8 @@ extern struct amdgpu_buffer 
> *amdgpu_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width
>
>  extern Bool amdgpu_bo_get_handle(struct amdgpu_buffer *bo, uint32_t *handle);
>
> +extern Bool amdgpu_pixmap_get_handle(PixmapPtr pixmap, uint32_t *handle);
> +
>  extern int amdgpu_bo_map(ScrnInfoPtr pScrn, struct amdgpu_buffer *bo);
>
>  extern void amdgpu_bo_unmap(struct amdgpu_buffer *bo);
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-ati 6/6] glamor: Return NullPixmap on failure to create shareable pixmap

2016-02-16 Thread Alex Deucher
On Tue, Feb 16, 2016 at 3:29 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: jimqu <jim...@amd.com>
>
> If we were asked to create a shareable pixmap, it doesn't make sense
> to return a pixmap which isn't shareable. Doing so caused trouble down
> the line such as a crash with older versions of glamor when trying to
> use GLX pixmaps of bpp < 32 via DRI2.
>
> Signed-off-by: JimQu <jim...@amd.com>
> (ported from amdgpu commit 2fcb7dadd3c71cd405cbbaafc777697538ca9c29)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/radeon_glamor.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
> index 6a12b33..cc2b1f2 100644
> --- a/src/radeon_glamor.c
> +++ b/src/radeon_glamor.c
> @@ -262,7 +262,9 @@ fallback_glamor:
>  */
> xf86DrvMsg(scrn->scrnIndex, X_WARNING,
>"Failed to create textured DRI2/PRIME pixmap.");
> -   return pixmap;
> +
> +   radeon_glamor_destroy_pixmap(pixmap);
> +   return NullPixmap;
> }
> /* Create textured pixmap failed means glamor failed to
>  * create a texture from current BO for some reasons. We turn
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 3/3] HAS_DIRTYTRACKING_ROTATION also supports multiple CRTCs

2016-02-15 Thread Alex Deucher
On Mon, Feb 15, 2016 at 4:46 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> (ported from radeon commit ff9a6b6f079a8419f4e6fadfee778060618bf735)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 40a134c..896b9d2 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -905,7 +905,7 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, 
> PixmapPtr ppix)
> if (max_height < iter->mode.VDisplay)
> max_height = iter->mode.VDisplay;
> }
> -#ifndef HAS_DIRTYTRACKING2
> +#if !defined(HAS_DIRTYTRACKING_ROTATION) && !defined(HAS_DIRTYTRACKING2)
> if (iter != crtc) {
> ErrorF
> ("Cannot do multiple crtcs without X server dirty 
> tracking 2 interface\n");
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Set RADEON_GEM_NO_CPU_ACCESS flag for BOs which don't need CPU access

2016-01-28 Thread Alex Deucher
On Thu, Jan 28, 2016 at 4:34 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Failing to do this was resulting in the kernel driver unnecessarily
> leaving open the possibility of CPU access to those BOs.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c  | 6 --
>  src/radeon.h   | 4 
>  src/radeon_bo_helper.c | 7 +--
>  src/radeon_kms.c   | 3 ++-
>  4 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 0424dbd..14f6a55 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -549,7 +549,8 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc,
> size = RADEON_ALIGN(rotate_pitch * aligned_height, 
> RADEON_GPU_PAGE_SIZE);
>
> scanout->bo = radeon_bo_open(drmmode->bufmgr, 0, size, base_align,
> -RADEON_GEM_DOMAIN_VRAM, 0);
> +RADEON_GEM_DOMAIN_VRAM,
> +RADEON_GEM_NO_CPU_ACCESS);
> if (scanout->bo == NULL)
> return NULL;
>
> @@ -1917,7 +1918,8 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, 
> int height)
> info->front_bo = radeon_bo_open(info->bufmgr, 0, screen_size, 
> base_align,
> info->shadow_primary ?
> RADEON_GEM_DOMAIN_GTT :
> -   RADEON_GEM_DOMAIN_VRAM, 0);
> +   RADEON_GEM_DOMAIN_VRAM,
> +   tiling_flags ? 
> RADEON_GEM_NO_CPU_ACCESS : 0);
> if (!info->front_bo)
> goto fail;
>
> diff --git a/src/radeon.h b/src/radeon.h
> index 0ee6adc..5cec12b 100644
> --- a/src/radeon.h
> +++ b/src/radeon.h
> @@ -66,6 +66,10 @@
>  #include "xf86drm.h"
>  #include "radeon_drm.h"
>
> +#ifndef RADEON_GEM_NO_CPU_ACCESS
> +#define RADEON_GEM_NO_CPU_ACCESS   (1 << 4)
> +#endif
> +
>  #ifdef DAMAGE
>  #include "damage.h"
>  #include "globals.h"
> diff --git a/src/radeon_bo_helper.c b/src/radeon_bo_helper.c
> index ce964e0..531bc45 100644
> --- a/src/radeon_bo_helper.c
> +++ b/src/radeon_bo_helper.c
> @@ -74,7 +74,7 @@ radeon_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width, int 
> height, int depth,
>  int pitch, base_align;
>  uint32_t size, heighta;
>  int cpp = bitsPerPixel / 8;
> -uint32_t tiling = 0;
> +uint32_t tiling = 0, flags = 0;
>  struct radeon_surface surface;
>  struct radeon_bo *bo;
>  int domain = RADEON_GEM_DOMAIN_VRAM;
> @@ -181,8 +181,11 @@ radeon_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width, int 
> height, int depth,
> }
> }
>
> +if (tiling)
> +   flags |= RADEON_GEM_NO_CPU_ACCESS;
> +
>  bo = radeon_bo_open(info->bufmgr, 0, size, base_align,
> -   domain, 0);
> +   domain, flags);
>
>  if (bo && tiling && radeon_bo_set_tiling(bo, tiling, pitch) == 0)
> *new_tiling = tiling;
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 971f11c..38f5c4e 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -1981,7 +1981,8 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
>  base_align,
>  info->shadow_primary ?
>  RADEON_GEM_DOMAIN_GTT :
> -RADEON_GEM_DOMAIN_VRAM, 0);
> +RADEON_GEM_DOMAIN_VRAM,
> +tiling_flags ? 
> RADEON_GEM_NO_CPU_ACCESS : 0);
>  if (info->r600_shadow_fb == TRUE) {
>  if (radeon_bo_map(info->front_bo, 1)) {
>  ErrorF("Failed to map cursor buffer memory\n");
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Only map front buffer if glamor acceleration is disabled (v2)

2016-01-28 Thread Alex Deucher
On Thu, Jan 28, 2016 at 3:23 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Otherwise the front buffer may not be accessible by the CPU, because Mesa
> sets the AMDGPU_GEM_CREATE_NO_CPU_ACCESS flag for tiled buffers, because
> accessing tiled buffers with the CPU makes little sense.
>
> v2: Also handle Option "AccelMethod" "none"
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_kms.c  | 3 ++-
>  src/drmmode_display.c | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index e090c25..b9e4eb7 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -1431,7 +1431,8 @@ static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen)
> return FALSE;
> }
>
> -   if (amdgpu_bo_map(pScrn, info->front_buffer)) {
> +   if (!info->use_glamor &&
> +   amdgpu_bo_map(pScrn, info->front_buffer) != 0) {
> ErrorF("Failed to map front buffer memory\n");
> return FALSE;
> }
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 3f015f9..40a134c 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -1741,7 +1741,7 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, 
> int width, int height)
> goto fail;
> }
>
> -   if (amdgpu_bo_map(scrn, info->front_buffer)) {
> +   if (!info->use_glamor && amdgpu_bo_map(scrn, info->front_buffer) != 
> 0) {
> xf86DrvMsg(scrn->scrnIndex, X_ERROR,
>"Failed to map front buffer memory\n");
> goto fail;
> --
> 2.7.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Set the RandR primary output on startup if Xorg hasn't

2016-01-19 Thread Alex Deucher
On Tue, Jan 19, 2016 at 3:50 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes xrandr (XRRGetOutputPrimary) not reporting any output as primary
> after startup.
>
> (Ported from radeon commit b16856b25086ffb27365ac2249b8da921066ce62)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_kms.c | 15 +++
>  1 file changed, 15 insertions(+)
>
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index 30bce08..e090c25 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -167,6 +167,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr 
> pScreen)
>  {
> ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
> AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
> +   rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
> PixmapPtr pixmap;
>
> pScreen->CreateScreenResources = info->CreateScreenResources;
> @@ -174,6 +175,20 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr 
> pScreen)
> return FALSE;
> pScreen->CreateScreenResources = AMDGPUCreateScreenResources_KMS;
>
> +   /* Set the RandR primary output if Xorg hasn't */
> +   if (
> +#ifdef AMDGPU_PIXMAP_SHARING
> +   !pScreen->isGPU &&
> +#endif
> +   !rrScrPriv->primaryOutput)
> +   {
> +   xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
> +
> +   rrScrPriv->primaryOutput = 
> xf86_config->output[0]->randr_output;
> +   RROutputChanged(rrScrPriv->primaryOutput, FALSE);
> +   rrScrPriv->layoutChanged = TRUE;
> +   }
> +
> if (!drmmode_set_desired_modes(pScrn, >drmmode, pScrn->is_gpu))
> return FALSE;
>
> --
> 2.7.0.rc3
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Fix RandR CRTC transforms

2016-01-15 Thread Alex Deucher
On Fri, Jan 15, 2016 at 2:51 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Currently, Xorg will only transform the cursor as of the first time the
> cursor image changes after a transform is set.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80678
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 17 -
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 9880ee3..0424dbd 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -673,7 +673,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
> crtc->x = x;
> crtc->y = y;
> crtc->rotation = rotation;
> -   crtc->transformPresent = FALSE;
>
> output_ids = calloc(sizeof(uint32_t), 
> xf86_config->num_output);
> if (!output_ids) {
> @@ -839,6 +838,19 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 
> *image)
> ptr[i] = cpu_to_le32(image[i]);
>  }
>
> +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,903,0)
> +
> +static Bool drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 * image)
> +{
> +   /* Fall back to SW cursor if the CRTC is transformed */
> +   if (crtc->transformPresent)
> +   return FALSE;
> +
> +   drmmode_load_cursor_argb(crtc, image);
> +   return TRUE;
> +}
> +
> +#endif
>
>  static void
>  drmmode_hide_cursor (xf86CrtcPtr crtc)
> @@ -995,6 +1007,9 @@ static xf86CrtcFuncsRec drmmode_crtc_funcs = {
>  .show_cursor = drmmode_show_cursor,
>  .hide_cursor = drmmode_hide_cursor,
>  .load_cursor_argb = drmmode_load_cursor_argb,
> +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,903,0)
> +.load_cursor_argb_check = drmmode_load_cursor_argb_check,
> +#endif
>
>  .gamma_set = drmmode_crtc_gamma_set,
>  .shadow_create = drmmode_crtc_shadow_create,
> --
> 2.6.2
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Set the RandR primary output on startup if Xorg hasn't

2016-01-14 Thread Alex Deucher
On Thu, Jan 14, 2016 at 3:43 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes xrandr (XRRGetOutputPrimary) not reporting any output as primary
> after startup.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/radeon_kms.c | 15 +++
>  1 file changed, 15 insertions(+)
>
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index d459740..971f11c 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -241,6 +241,7 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr 
> pScreen)
>  {
>  ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
>  RADEONInfoPtr  info   = RADEONPTR(pScrn);
> +rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
>  PixmapPtr pixmap;
>  struct radeon_surface *surface;
>
> @@ -249,6 +250,20 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr 
> pScreen)
> return FALSE;
>  pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS;
>
> +/* Set the RandR primary output if Xorg hasn't */
> +if (
> +#ifdef RADEON_PIXMAP_SHARING
> +   !pScreen->isGPU &&
> +#endif
> +   !rrScrPriv->primaryOutput)
> +{
> +   xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
> +
> +   rrScrPriv->primaryOutput = xf86_config->output[0]->randr_output;
> +   RROutputChanged(rrScrPriv->primaryOutput, FALSE);
> +   rrScrPriv->layoutChanged = TRUE;
> +}
> +
>  if (!drmmode_set_desired_modes(pScrn, >drmmode, FALSE))
> return FALSE;
>
> --
> 2.6.2
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 3/3] Only call amdgpu_bus_id once in each probe path

2016-01-08 Thread Alex Deucher
On Fri, Jan 8, 2016 at 4:04 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Instead of up to twice as before.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Series is:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_probe.c | 52 +---
>  1 file changed, 25 insertions(+), 27 deletions(-)
>
> diff --git a/src/amdgpu_probe.c b/src/amdgpu_probe.c
> index f74eb29..ea9ffa7 100644
> --- a/src/amdgpu_probe.c
> +++ b/src/amdgpu_probe.c
> @@ -99,16 +99,10 @@ static char *amdgpu_bus_id(ScrnInfoPtr pScrn, struct 
> pci_device *dev)
> return busid;
>  }
>
> -static Bool amdgpu_kernel_mode_enabled(ScrnInfoPtr pScrn,
> -  struct pci_device *pci_dev)
> +static Bool amdgpu_kernel_mode_enabled(ScrnInfoPtr pScrn, char *busIdString)
>  {
> -   char *busIdString = amdgpu_bus_id(pScrn, pci_dev);
> -   int ret;
> +   int ret = drmCheckModesettingSupported(busIdString);
>
> -   if (!busIdString)
> -   return FALSE;
> -
> -   ret = drmCheckModesettingSupported(busIdString);
>  #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> if (ret) {
> if (xf86LoadKernelModule("amdgpukms"))
> @@ -127,10 +121,9 @@ static Bool amdgpu_kernel_mode_enabled(ScrnInfoPtr pScrn,
> return TRUE;
>  }
>
> -static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn, struct pci_device *dev,
> +static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn, char *busid,
>  struct xf86_platform_device *platform_dev)
>  {
> -   char *busid;
> int fd;
>
>  #ifdef XF86_PDEV_SERVER_FD
> @@ -142,29 +135,21 @@ static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn, 
> struct pci_device *dev,
> }
>  #endif
>
> -   busid = amdgpu_bus_id(pScrn, dev);
> -   if (!busid)
> -   return -1;
> -
> fd = drmOpen(NULL, busid);
> -   if (fd == -1) {
> +   if (fd == -1)
> xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
>"[drm] Failed to open DRM device for %s: %s\n",
>busid, strerror(errno));
> -   free(busid);
> -   return fd;
> -   }
> -   free(busid);
> return fd;
>  }
>
>  static Bool amdgpu_open_drm_master(ScrnInfoPtr pScrn, AMDGPUEntPtr 
> pAMDGPUEnt,
> -  struct pci_device *pci_dev)
> +  char *busid)
>  {
> drmSetVersion sv;
> int err;
>
> -   pAMDGPUEnt->fd = amdgpu_kernel_open_fd(pScrn, pci_dev, NULL);
> +   pAMDGPUEnt->fd = amdgpu_kernel_open_fd(pScrn, busid, NULL);
> if (pAMDGPUEnt->fd == -1)
> return FALSE;
>
> @@ -190,6 +175,7 @@ static Bool amdgpu_open_drm_master(ScrnInfoPtr pScrn, 
> AMDGPUEntPtr pAMDGPUEnt,
>  static Bool amdgpu_get_scrninfo(int entity_num, struct pci_device *pci_dev)
>  {
> ScrnInfoPtr pScrn = NULL;
> +   char *busid;
> EntityInfoPtr pEnt;
> DevUnion *pPriv;
> AMDGPUEntPtr pAMDGPUEnt;
> @@ -200,8 +186,9 @@ static Bool amdgpu_get_scrninfo(int entity_num, struct 
> pci_device *pci_dev)
> if (!pScrn)
> return FALSE;
>
> -   if (!amdgpu_kernel_mode_enabled(pScrn, pci_dev))
> -   return FALSE;
> +   busid = amdgpu_bus_id(pScrn, pci_dev);
> +   if (!amdgpu_kernel_mode_enabled(pScrn, busid))
> +   goto error;
>
> pScrn->driverVersion = AMDGPU_VERSION_CURRENT;
> pScrn->driverName = AMDGPU_DRIVER_NAME;
> @@ -235,10 +222,10 @@ static Bool amdgpu_get_scrninfo(int entity_num, struct 
> pci_device *pci_dev)
>
> pPriv->ptr = xnfcalloc(sizeof(AMDGPUEntRec), 1);
> if (!pPriv->ptr)
> -   return FALSE;
> +   goto error;
>
> pAMDGPUEnt = pPriv->ptr;
> -   if (!amdgpu_open_drm_master(pScrn, pAMDGPUEnt, pci_dev))
> +   if (!amdgpu_open_drm_master(pScrn, pAMDGPUEnt, busid))
> goto error_fd;
>
> pAMDGPUEnt->fd_ref = 1;
> @@ -261,6 +248,7 @@ static Bool amdgpu_get_scrninfo(int entity_num, struct 
> pci_device *pci_dev)
>  index)
>- 1);
> free(pEnt);
> +   free(busid);
>
> return TRUE;
>
> @@ -268,6 +256,8 @@ error_

Re: [PATCH 2/2] Build RandR 1.4 provider name from chipset name and bus ID

2015-12-24 Thread Alex Deucher
On Wed, Dec 23, 2015 at 8:40 PM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Instead of just "radeon", it's now e.g. "KAVERI @ pci::00:01.0".
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Nice!  For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index fa46d56..9880ee3 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -40,6 +40,10 @@
>  #include "radeon_glamor.h"
>  #include "radeon_reg.h"
>
> +#ifdef RADEON_PIXMAP_SHARING
> +#include 
> +#endif
> +
>  #include "drmmode_display.h"
>
>  /* DPMS */
> @@ -2070,6 +2074,9 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr 
> drmmode, int cpp)
> int i, num_dvi = 0, num_hdmi = 0;
> drmModeResPtr mode_res;
> unsigned int crtcs_needed = 0;
> +#ifdef RADEON_PIXMAP_SHARING
> +   char *bus_id_string, *provider_name;
> +#endif
>
> xf86CrtcConfigInit(pScrn, _xf86crtc_config_funcs);
>
> @@ -2112,7 +2119,11 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr 
> drmmode, int cpp)
> drmmode_clones_init(pScrn, drmmode, mode_res);
>
>  #ifdef RADEON_PIXMAP_SHARING
> -   xf86ProviderSetup(pScrn, NULL, "radeon");
> +   bus_id_string = DRICreatePCIBusID(info->PciInfo);
> +   XNFasprintf(_name, "%s @ %s", pScrn->chipset, bus_id_string);
> +   free(bus_id_string);
> +   xf86ProviderSetup(pScrn, NULL, provider_name);
> +   free(provider_name);
>  #endif
>
> xf86InitialConfiguration(pScrn, TRUE);
> --
> 2.6.2
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] sync: Check if miSyncShmScreenInit symbol is resolved at runtime

2015-12-10 Thread Alex Deucher
On Thu, Dec 10, 2015 at 4:51 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> It may be disabled in the Xorg build, either explicitly or because the
> xshmfence library isn't available.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_sync.c | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/amdgpu_sync.c b/src/amdgpu_sync.c
> index baade0e..e92f658 100644
> --- a/src/amdgpu_sync.c
> +++ b/src/amdgpu_sync.c
> @@ -87,6 +87,13 @@ amdgpu_sync_init(ScreenPtr screen)
> AMDGPUInfoPtr info = AMDGPUPTR(scrn);
> SyncScreenFuncsPtr screen_funcs;
>
> +   if (!xf86LoaderCheckSymbol("miSyncShmScreenInit")) {
> +   xf86DrvMsg(scrn->scrnIndex, X_WARNING,
> +  "SYNC extension fences disabled because "
> +  "miSyncShmScreenInit symbol unresolved\n");
> +   return FALSE;
> +   }
> +
> if (!miSyncShmScreenInit(screen)) {
> xf86DrvMsg(scrn->scrnIndex, X_WARNING,
>"SYNC extension fences disabled because "
> --
> 2.6.2
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Load fb module before glamoregl/shadow modules

2015-12-03 Thread Alex Deucher
On Wed, Dec 2, 2015 at 10:16 PM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes unresolved symbols on some systems.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93105
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/radeon_kms.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 8f84df2..d459740 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -1136,6 +1136,10 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
> goto fail;
>  }
>
> +/* Get ScreenInit function */
> +if (!xf86LoadSubModule(pScrn, "fb"))
> +   return FALSE;
> +
>  if (!RADEONPreInitAccel_KMS(pScrn))  goto fail;
>
>  radeon_drm_queue_init();
> @@ -1314,9 +1318,6 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
>  /* Set display resolution */
>  xf86SetDpi(pScrn, 0, 0);
>
> -   /* Get ScreenInit function */
> -if (!xf86LoadSubModule(pScrn, "fb")) return FALSE;
> -
>  if (!xf86SetGamma(pScrn, zeros)) return FALSE;
>
>  if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
> --
> 2.6.2
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Don't advertise any PRIME offloading capabilities without acceleration

2015-11-20 Thread Alex Deucher
On Fri, Nov 20, 2015 at 4:49 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Acceleration is required even for display offloading. Trying to enable
> display offloading without acceleration resulted in a crash.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

I thought we had fixed this before.  Maybe I was thinking of something else.
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/radeon_kms.c | 19 +--
>  1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 49b922d..8f84df2 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -1017,18 +1017,17 @@ static void RADEONSetupCapabilities(ScrnInfoPtr pScrn)
>  int ret;
>
>  pScrn->capabilities = 0;
> +
> +/* PRIME offloading requires acceleration */
> +if (info->r600_shadow_fb)
> +   return;
> +
>  ret = drmGetCap(info->dri2.drm_fd, DRM_CAP_PRIME, );
>  if (ret == 0) {
> -   if (value & DRM_PRIME_CAP_EXPORT) {
> -   pScrn->capabilities |= RR_Capability_SourceOutput;
> -   if (!info->r600_shadow_fb && info->dri2.available)
> -   pScrn->capabilities |= RR_Capability_SinkOffload;
> -   }
> -   if (value & DRM_PRIME_CAP_IMPORT) {
> -   pScrn->capabilities |= RR_Capability_SinkOutput;
> -   if (!info->r600_shadow_fb && info->dri2.available)
> -   pScrn->capabilities |= RR_Capability_SourceOffload;
> -   }
> +   if (value & DRM_PRIME_CAP_EXPORT)
> +   pScrn->capabilities |= RR_Capability_SourceOutput | 
> RR_Capability_SinkOffload;
> +   if (value & DRM_PRIME_CAP_IMPORT)
> +   pScrn->capabilities |= RR_Capability_SinkOutput | 
> RR_Capability_SourceOffload;
>  }
>  #endif
>  }
> --
> 2.6.2
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 1/2] glamor: Restore all ScreenRec hooks during CloseScreen

2015-11-19 Thread Alex Deucher
On Thu, Nov 19, 2015 at 4:05 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> (ported from radeon commit 535e5438b2c32f774b9c8c27ee0289b4749548ef)
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_drv.h |  8 
>  src/amdgpu_glamor.c  | 20 
>  src/amdgpu_glamor.h  |  1 +
>  src/amdgpu_glamor_wrappers.c |  5 -
>  src/amdgpu_kms.c |  1 +
>  src/amdgpu_pixmap.h  |  4 
>  6 files changed, 30 insertions(+), 9 deletions(-)
>
> diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
> index 9acd202..0e7b3b5 100644
> --- a/src/amdgpu_drv.h
> +++ b/src/amdgpu_drv.h
> @@ -148,6 +148,10 @@ typedef enum {
> OPTION_DELETE_DP12,
>  } AMDGPUOpts;
>
> +#if XF86_CRTC_VERSION >= 5
> +#define AMDGPU_PIXMAP_SHARING 1
> +#endif
> +
>  #define AMDGPU_VSYNC_TIMEOUT   2   /* Maximum wait for VSYNC (in usecs) 
> */
>
>  /* Buffer are aligned on 4096 byte boundaries */
> @@ -265,6 +269,10 @@ typedef struct {
> AddTrapsProcPtr SavedAddTraps;
> UnrealizeGlyphProcPtr SavedUnrealizeGlyph;
>  #endif
> +#ifdef AMDGPU_PIXMAP_SHARING
> +   SharePixmapBackingProcPtr SavedSharePixmapBacking;
> +   SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
> +#endif
> } glamor;
>
>  } AMDGPUInfoRec, *AMDGPUInfoPtr;
> diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
> index c979561..a74 100644
> --- a/src/amdgpu_glamor.c
> +++ b/src/amdgpu_glamor.c
> @@ -353,10 +353,14 @@ Bool amdgpu_glamor_init(ScreenPtr screen)
> ps->UnrealizeGlyph = SavedUnrealizeGlyph;
>  #endif
>
> +   info->glamor.SavedCreatePixmap = screen->CreatePixmap;
> screen->CreatePixmap = amdgpu_glamor_create_pixmap;
> +   info->glamor.SavedDestroyPixmap = screen->DestroyPixmap;
> screen->DestroyPixmap = amdgpu_glamor_destroy_pixmap;
>  #ifdef AMDGPU_PIXMAP_SHARING
> +   info->glamor.SavedSharePixmapBacking = screen->SharePixmapBacking;
> screen->SharePixmapBacking = amdgpu_glamor_share_pixmap_backing;
> +   info->glamor.SavedSetSharedPixmapBacking = 
> screen->SetSharedPixmapBacking;
> screen->SetSharedPixmapBacking =
> amdgpu_glamor_set_shared_pixmap_backing;
>  #endif
> @@ -385,6 +389,22 @@ void amdgpu_glamor_finish(ScrnInfoPtr pScrn)
> }
>  }
>
> +void
> +amdgpu_glamor_fini(ScreenPtr screen)
> +{
> +   AMDGPUInfoPtr info = AMDGPUPTR(xf86ScreenToScrn(screen));
> +
> +   if (!info->use_glamor)
> +   return;
> +
> +   screen->CreatePixmap = info->glamor.SavedCreatePixmap;
> +   screen->DestroyPixmap = info->glamor.SavedDestroyPixmap;
> +#ifdef AMDGPU_PIXMAP_SHARING
> +   screen->SharePixmapBacking = info->glamor.SavedSharePixmapBacking;
> +   screen->SetSharedPixmapBacking = 
> info->glamor.SavedSetSharedPixmapBacking;
> +#endif
> +}
> +
>  XF86VideoAdaptorPtr amdgpu_glamor_xv_init(ScreenPtr pScreen, int num_adapt)
>  {
> return glamor_xv_init(pScreen, num_adapt);
> diff --git a/src/amdgpu_glamor.h b/src/amdgpu_glamor.h
> index de63005..77e0c21 100644
> --- a/src/amdgpu_glamor.h
> +++ b/src/amdgpu_glamor.h
> @@ -60,6 +60,7 @@ struct amdgpu_pixmap;
>
>  Bool amdgpu_glamor_pre_init(ScrnInfoPtr scrn);
>  Bool amdgpu_glamor_init(ScreenPtr screen);
> +void amdgpu_glamor_fini(ScreenPtr screen);
>  void amdgpu_glamor_screen_init(ScreenPtr screen);
>  Bool amdgpu_glamor_create_screen_resources(ScreenPtr screen);
>  void amdgpu_glamor_free_screen(int scrnIndex, int flags);
> diff --git a/src/amdgpu_glamor_wrappers.c b/src/amdgpu_glamor_wrappers.c
> index 7ff2f30..6700851 100644
> --- a/src/amdgpu_glamor_wrappers.c
> +++ b/src/amdgpu_glamor_wrappers.c
> @@ -924,8 +924,6 @@ amdgpu_glamor_close_screen(CLOSE_SCREEN_ARGS_DECL)
> pScreen->CloseScreen = info->glamor.SavedCloseScreen;
> pScreen->GetImage = info->glamor.SavedGetImage;
> pScreen->GetSpans = info->glamor.SavedGetSpans;
> -   pScreen->CreatePixmap = info->glamor.SavedCreatePixmap;
> -   pScreen->DestroyPixmap = info->glamor.SavedDestroyPixmap;
> pScreen->CopyWindow = info->glamor.SavedCopyWindow;
> pScreen->ChangeWindowAttributes =
> info->glamor.SavedChangeWindowAttributes;
> @@ -969,9 +967,6 @@ amdgpu_glamor_screen_init(ScreenPtr screen)
> info->glamor.Saved

Re: [PATCH xf86-video-amdgpu 1/9] Fixes ported from radeon

2015-11-11 Thread Alex Deucher
On Wed, Nov 11, 2015 at 4:30 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> These are the remaining fixes from radeon which hadn't been ported to
> xf86-video-amdgpu yet.
>
> Once these are applied, we can cut a release.

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

>
> [PATCH xf86-video-amdgpu 1/9] dri2: Handle PRIME for source buffer as
> [PATCH xf86-video-amdgpu 2/9] Use own thunk function instead of
> [PATCH xf86-video-amdgpu 3/9] Rename Option "NoAccel" to "Accel"
> [PATCH xf86-video-amdgpu 4/9] PRIME: Don't advertise offload
> [PATCH xf86-video-amdgpu 5/9] Prefer drmModeSetCursor2 over
> [PATCH xf86-video-amdgpu 6/9] Skip disabled CRTCs in
> [PATCH xf86-video-amdgpu 7/9] Do not link amdgpu_drv.so against
> [PATCH xf86-video-amdgpu 8/9] Call xf86CrtcRotate from initial
> [PATCH xf86-video-amdgpu 9/9] Handle failures in setting a CRTC to a
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 0/8] Fixes ported from xf86-video-amdgpu

2015-11-11 Thread Alex Deucher
On Wed, Nov 11, 2015 at 2:15 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> These are the remaining fixes from xf86-video-amdgpu which hadn't been
> ported to radeon yet.
>
> Once these are applied, we can cut a release.

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

>
> [PATCH 1/8] dri2: Avoid calculation with undefined msc value
> [PATCH 2/8] Simplify pick best crtc to fold two loops into one
> [PATCH 3/8] Clean up allocation in RADEONInitVideo()
> [PATCH 4/8] Simplify drmmode_set_mode_major() and avoid leaking
> [PATCH 5/8] Don't advertise rotation support without hardware
> [PATCH 6/8] Eliminate redundant data parameter from
> [PATCH 7/8] Properly handle drmModeAddFB failure in
> [PATCH 8/8] Clean up radeon_dri2_create_buffer2()
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 1/2] glamor: Restore ScreenRec hooks during CloseScreen

2015-11-11 Thread Alex Deucher
On Tue, Nov 10, 2015 at 3:41 AM, Michel Dänzer  wrote:
> From: Michel Dänzer 
>
> Signed-off-by: Michel Dänzer 

For the series:
Reviewed-by: 

> ---
>  src/radeon.h | 12 
>  src/radeon_glamor.c  | 20 
>  src/radeon_glamor.h  |  2 ++
>  src/radeon_glamor_wrappers.c |  5 -
>  src/radeon_kms.c |  2 ++
>  5 files changed, 32 insertions(+), 9 deletions(-)
>
> diff --git a/src/radeon.h b/src/radeon.h
> index e2fd41c..0ee6adc 100644
> --- a/src/radeon.h
> +++ b/src/radeon.h
> @@ -157,6 +157,10 @@ typedef enum {
>  } RADEONOpts;
>
>
> +#if XF86_CRTC_VERSION >= 5
> +#define RADEON_PIXMAP_SHARING 1
> +#endif
> +
>  #define RADEON_VSYNC_TIMEOUT   2 /* Maximum wait for VSYNC (in usecs) */
>
>  /* Buffer are aligned on 4096 byte boundaries */
> @@ -561,6 +565,10 @@ typedef struct {
> AddTrapsProcPtr SavedAddTraps;
> UnrealizeGlyphProcPtr SavedUnrealizeGlyph;
>  #endif
> +#ifdef RADEON_PIXMAP_SHARING
> +   SharePixmapBackingProcPtr SavedSharePixmapBacking;
> +   SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
> +#endif
>  } glamor;
>  #endif /* USE_GLAMOR */
>  } RADEONInfoRec, *RADEONInfoPtr;
> @@ -623,10 +631,6 @@ extern RADEONEntPtr RADEONEntPriv(ScrnInfoPtr pScrn);
>
>  drmVBlankSeqType radeon_populate_vbl_request_type(xf86CrtcPtr crtc);
>
> -#if XF86_CRTC_VERSION >= 5
> -#define RADEON_PIXMAP_SHARING 1
> -#endif
> -
>  static inline struct radeon_surface *radeon_get_pixmap_surface(PixmapPtr 
> pPix)
>  {
>  #ifdef USE_GLAMOR
> diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
> index fdd5aea..8fb3a1e 100644
> --- a/src/radeon_glamor.c
> +++ b/src/radeon_glamor.c
> @@ -368,10 +368,14 @@ radeon_glamor_init(ScreenPtr screen)
> ps->UnrealizeGlyph = SavedUnrealizeGlyph;
>  #endif
>
> +   info->glamor.SavedCreatePixmap = screen->CreatePixmap;
> screen->CreatePixmap = radeon_glamor_create_pixmap;
> +   info->glamor.SavedDestroyPixmap = screen->DestroyPixmap;
> screen->DestroyPixmap = radeon_glamor_destroy_pixmap;
>  #ifdef RADEON_PIXMAP_SHARING
> +   info->glamor.SavedSharePixmapBacking = screen->SharePixmapBacking;
> screen->SharePixmapBacking = radeon_glamor_share_pixmap_backing;
> +   info->glamor.SavedSetSharedPixmapBacking = 
> screen->SetSharedPixmapBacking;
> screen->SetSharedPixmapBacking = 
> radeon_glamor_set_shared_pixmap_backing;
>  #endif
>
> @@ -380,6 +384,22 @@ radeon_glamor_init(ScreenPtr screen)
> return TRUE;
>  }
>
> +void
> +radeon_glamor_fini(ScreenPtr screen)
> +{
> +   RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(screen));
> +
> +   if (!info->use_glamor)
> +   return;
> +
> +   screen->CreatePixmap = info->glamor.SavedCreatePixmap;
> +   screen->DestroyPixmap = info->glamor.SavedDestroyPixmap;
> +#ifdef RADEON_PIXMAP_SHARING
> +   screen->SharePixmapBacking = info->glamor.SavedSharePixmapBacking;
> +   screen->SetSharedPixmapBacking = 
> info->glamor.SavedSetSharedPixmapBacking;
> +#endif
> +}
> +
>  XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt)
>  {
> return glamor_xv_init(pScreen, num_adapt);
> diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h
> index 246336b..75129f8 100644
> --- a/src/radeon_glamor.h
> +++ b/src/radeon_glamor.h
> @@ -64,6 +64,7 @@ struct radeon_pixmap;
>
>  Bool radeon_glamor_pre_init(ScrnInfoPtr scrn);
>  Bool radeon_glamor_init(ScreenPtr screen);
> +void radeon_glamor_fini(ScreenPtr screen);
>  void radeon_glamor_screen_init(ScreenPtr screen);
>  Bool radeon_glamor_create_screen_resources(ScreenPtr screen);
>  void radeon_glamor_free_screen(int scrnIndex, int flags);
> @@ -77,6 +78,7 @@ XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr 
> pScreen, int num_adapt);
>
>  static inline Bool radeon_glamor_pre_init(ScrnInfoPtr scrn) { return FALSE; }
>  static inline Bool radeon_glamor_init(ScreenPtr screen) { return FALSE; }
> +static inline void radeon_glamor_fini(ScreenPtr screen) { }
>  static inline Bool radeon_glamor_create_screen_resources(ScreenPtr screen) { 
> return FALSE; }
>  static inline void radeon_glamor_free_screen(int scrnIndex, int flags) { }
>
> diff --git a/src/radeon_glamor_wrappers.c b/src/radeon_glamor_wrappers.c
> index ec81560..cd02b06 100644
> --- a/src/radeon_glamor_wrappers.c
> +++ b/src/radeon_glamor_wrappers.c
> @@ -917,8 +917,6 @@ radeon_glamor_close_screen(CLOSE_SCREEN_ARGS_DECL)
> pScreen->CloseScreen = info->glamor.SavedCloseScreen;
> pScreen->GetImage = info->glamor.SavedGetImage;
> pScreen->GetSpans = info->glamor.SavedGetSpans;
> -   pScreen->CreatePixmap = info->glamor.SavedCreatePixmap;
> -   pScreen->DestroyPixmap = info->glamor.SavedDestroyPixmap;
> pScreen->CopyWindow = info->glamor.SavedCopyWindow;
> 

Re: [PATCH xf86-video-amdgpu 3/3] Move scrn/info declaration inside USE_GLAMOR in amdgpu_dri3_fd_from_pixmap

2015-11-02 Thread Alex Deucher
On Mon, Nov 2, 2015 at 4:30 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes warning when building with --disable-glamor:
>
> ../../src/amdgpu_dri3.c: In function 'amdgpu_dri3_fd_from_pixmap':
> ../../src/amdgpu_dri3.c:135:16: warning: unused variable 'info' 
> [-Wunused-variable]
>   AMDGPUInfoPtr info = AMDGPUPTR(scrn);
> ^
>
> Reported-by: Jammy Zhou <jammy.z...@amd.com>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_dri3.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/amdgpu_dri3.c b/src/amdgpu_dri3.c
> index 53871be..73a79ac 100644
> --- a/src/amdgpu_dri3.c
> +++ b/src/amdgpu_dri3.c
> @@ -131,13 +131,13 @@ static int amdgpu_dri3_fd_from_pixmap(ScreenPtr screen,
>   CARD16 *stride,
>   CARD32 *size)
>  {
> -   ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> -   AMDGPUInfoPtr info = AMDGPUPTR(scrn);
> struct amdgpu_buffer *bo;
> struct amdgpu_bo_info bo_info;
> uint32_t fd;
> -
>  #ifdef USE_GLAMOR
> +   ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> +   AMDGPUInfoPtr info = AMDGPUPTR(scrn);
> +
> if (info->use_glamor)
> return glamor_fd_from_pixmap(screen, pixmap, stride, size);
>  #endif
> --
> 2.6.2
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 2/2] Fix warnings for unused variables

2015-10-28 Thread Alex Deucher
On Wed, Oct 28, 2015 at 9:24 AM, Jammy Zhou <jammy.z...@amd.com> wrote:
> Remove some unused variables to fix the compiling warnings.
>
> Signed-off-by: Jammy Zhou <jammy.z...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/amdgpu_dri3.c   | 2 --
>  src/amdgpu_glamor.c | 2 --
>  src/amdgpu_kms.c| 6 --
>  3 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/src/amdgpu_dri3.c b/src/amdgpu_dri3.c
> index a89421e..ad5734f 100644
> --- a/src/amdgpu_dri3.c
> +++ b/src/amdgpu_dri3.c
> @@ -130,8 +130,6 @@ static int amdgpu_dri3_fd_from_pixmap(ScreenPtr screen,
>   CARD16 *stride,
>   CARD32 *size)
>  {
> -   ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> -   AMDGPUInfoPtr info = AMDGPUPTR(scrn);
> struct amdgpu_buffer *bo;
> struct amdgpu_bo_info bo_info;
> uint32_t fd;
> diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
> index f994df4..fb0f8ff 100644
> --- a/src/amdgpu_glamor.c
> +++ b/src/amdgpu_glamor.c
> @@ -81,8 +81,6 @@ Bool amdgpu_glamor_create_screen_resources(ScreenPtr screen)
>  Bool amdgpu_glamor_pre_init(ScrnInfoPtr scrn)
>  {
> AMDGPUInfoPtr info = AMDGPUPTR(scrn);
> -   pointer glamor_module;
> -   CARD32 version;
>
> if (!info->dri2.available)
> return FALSE;
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index 32a34cb..91aba2f 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -944,10 +944,11 @@ void AMDGPUUnblank(ScrnInfoPtr pScrn)
>  static Bool amdgpu_set_drm_master(ScrnInfoPtr pScrn)
>  {
> AMDGPUInfoPtr info  = AMDGPUPTR(pScrn);
> -   AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
> int err;
>
>  #ifdef XF86_PDEV_SERVER_FD
> +   AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
> +
> if (pAMDGPUEnt->platform_dev &&
> (pAMDGPUEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
> return TRUE;
> @@ -963,9 +964,10 @@ static Bool amdgpu_set_drm_master(ScrnInfoPtr pScrn)
>  static void amdgpu_drop_drm_master(ScrnInfoPtr pScrn)
>  {
> AMDGPUInfoPtr  info  = AMDGPUPTR(pScrn);
> -   AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
>
>  #ifdef XF86_PDEV_SERVER_FD
> +   AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
> +
> if (pAMDGPUEnt->platform_dev &&
> (pAMDGPUEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
> return;
> --
> 1.9.1
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


[PATCH xf86-video-amdgpu] Add Stoney support

2015-10-22 Thread Alex Deucher
From: Samuel Li 

(agd): rebase

Signed-off-by: Samuel Li 
---
 src/amdgpu_chipinfo_gen.h | 1 +
 src/amdgpu_chipset_gen.h  | 1 +
 src/amdgpu_pci_chipset_gen.h  | 1 +
 src/amdgpu_pci_device_match_gen.h | 1 +
 src/amdgpu_probe.h| 1 +
 src/ati_pciids_gen.h  | 1 +
 src/pcidb/ati_pciids.csv  | 1 +
 7 files changed, 7 insertions(+)

diff --git a/src/amdgpu_chipinfo_gen.h b/src/amdgpu_chipinfo_gen.h
index 6969e1e..dab8746 100644
--- a/src/amdgpu_chipinfo_gen.h
+++ b/src/amdgpu_chipinfo_gen.h
@@ -78,4 +78,5 @@ static AMDGPUCardInfo AMDGPUCards[] = {
  { 0x9876, CHIP_FAMILY_CARRIZO },
  { 0x9877, CHIP_FAMILY_CARRIZO },
  { 0x7300, CHIP_FAMILY_FIJI },
+ { 0x98E4, CHIP_FAMILY_STONEY },
 };
diff --git a/src/amdgpu_chipset_gen.h b/src/amdgpu_chipset_gen.h
index 94d2df5..a8683e0 100644
--- a/src/amdgpu_chipset_gen.h
+++ b/src/amdgpu_chipset_gen.h
@@ -78,5 +78,6 @@ SymTabRec AMDGPUChipsets[] = {
   { PCI_CHIP_CARRIZO_9876, "CARRIZO" },
   { PCI_CHIP_CARRIZO_9877, "CARRIZO" },
   { PCI_CHIP_FIJI_7300, "FIJI" },
+  { PCI_CHIP_STONEY_98E4, "STONEY" },
   { -1, NULL }
 };
diff --git a/src/amdgpu_pci_chipset_gen.h b/src/amdgpu_pci_chipset_gen.h
index 6ffb7db..fc16b62 100644
--- a/src/amdgpu_pci_chipset_gen.h
+++ b/src/amdgpu_pci_chipset_gen.h
@@ -78,5 +78,6 @@ static PciChipsets AMDGPUPciChipsets[] = {
  { PCI_CHIP_CARRIZO_9876, PCI_CHIP_CARRIZO_9876, RES_SHARED_VGA },
  { PCI_CHIP_CARRIZO_9877, PCI_CHIP_CARRIZO_9877, RES_SHARED_VGA },
  { PCI_CHIP_FIJI_7300, PCI_CHIP_FIJI_7300, RES_SHARED_VGA },
+ { PCI_CHIP_STONEY_98E4, PCI_CHIP_STONEY_98E4, RES_SHARED_VGA },
  { -1, -1, RES_UNDEFINED }
 };
diff --git a/src/amdgpu_pci_device_match_gen.h 
b/src/amdgpu_pci_device_match_gen.h
index 4a198ac..1c00759 100644
--- a/src/amdgpu_pci_device_match_gen.h
+++ b/src/amdgpu_pci_device_match_gen.h
@@ -78,5 +78,6 @@ static const struct pci_id_match amdgpu_device_match[] = {
  ATI_DEVICE_MATCH( PCI_CHIP_CARRIZO_9876, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_CARRIZO_9877, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_FIJI_7300, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_STONEY_98E4, 0 ),
  { 0, 0, 0 }
 };
diff --git a/src/amdgpu_probe.h b/src/amdgpu_probe.h
index 4b4fefb..5194f4c 100644
--- a/src/amdgpu_probe.h
+++ b/src/amdgpu_probe.h
@@ -66,6 +66,7 @@ typedef enum {
CHIP_FAMILY_TONGA,
CHIP_FAMILY_CARRIZO,
CHIP_FAMILY_FIJI,
+   CHIP_FAMILY_STONEY,
CHIP_FAMILY_LAST
 } AMDGPUChipFamily;
 
diff --git a/src/ati_pciids_gen.h b/src/ati_pciids_gen.h
index 933d727..76d161c 100644
--- a/src/ati_pciids_gen.h
+++ b/src/ati_pciids_gen.h
@@ -76,3 +76,4 @@
 #define PCI_CHIP_CARRIZO_9876 0x9876
 #define PCI_CHIP_CARRIZO_9877 0x9877
 #define PCI_CHIP_FIJI_7300 0x7300
+#define PCI_CHIP_STONEY_98E4 0x98E4
diff --git a/src/pcidb/ati_pciids.csv b/src/pcidb/ati_pciids.csv
index 0f18611..21de3a9 100644
--- a/src/pcidb/ati_pciids.csv
+++ b/src/pcidb/ati_pciids.csv
@@ -77,3 +77,4 @@
 "0x9876","CARRIZO_9876","CARRIZO","CARRIZO"
 "0x9877","CARRIZO_9877","CARRIZO","CARRIZO"
 "0x7300","FIJI_7300","FIJI","FIJI"
+"0x98E4","STONEY_98E4","STONEY","STONEY"
-- 
1.8.3.1

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: dual Radeon graphics cards and Xrandr 1.4

2015-10-18 Thread Alex Deucher
On Sat, Oct 17, 2015 at 8:18 PM, J. Hart  wrote:
> I have two old Radeon HD 4850 graphics cards in a 4 head monitor
> configuration I'd like to get working with Xrandr 1.4 if possible. I built
> my linux system entirely from source code, so I am not using any particular
> premade linux distribution. I am presently running linux kernel 3.14. The
> X11 system (Xorg) is also built entirely from the latest release source code
> (no prerelease), and so is post-"xorg 7.7". (Xorg 7.7 is the latest Katamari
> release - June 6, 2012).
>
> I am using the following :
> Mesa 10.6.5
> randrproto 1.5.0
> libXrandr 1.5.0
> xrandr 1.4.3
> xf86-video-ati 7.5.0
>
> The two Radeon cards have a crossfire cable connected between them. They are
> presently working well in a 4 head Xinerama configuration using the open
> source driver listed above (xf86-video-ati 7.5.0)
>
> I have tried starting X without any xorg.config files so that Xinerama is
> not in
> effect. After starting the X server, I did the following:
>
> xrandr --listproviders # saw two providers
> xrandr --setprovideroutputsource 1 0
> clear;xrandr | grep DVI # saw only DVI-0 and DVI-1
>
> The others should have been DVI-2 and DVI-3, but they do not appear in the
> report. Any ideas would be most appreciated.
>

Please attach your xorg log and dmesg output.  Also, what desktop
environment are you using?  IIRC, you need to be using a compositor.

Alex
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Call xf86CrtcRotate from initial drmmode_set_desired_modes call

2015-10-16 Thread Alex Deucher
On Fri, Oct 16, 2015 at 3:31 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Fixes various problems when rotation is specified in xorg.conf.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92475
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 623124e..64e79d4 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -2240,6 +2240,8 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, 
> drmmode_ptr drmmode,
> crtc->rotation = crtc->desiredRotation;
> crtc->x = crtc->desiredX;
> crtc->y = crtc->desiredY;
> +   if (!xf86CrtcRotate(crtc))
> +   return FALSE;
> }
> }
> return TRUE;
> --
> 2.6.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 2/2] Properly handle drmModeAddFB failure in drmmode_crtc_scanout_allocate

2015-10-13 Thread Alex Deucher
On Tue, Oct 13, 2015 at 5:59 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> We were printing an error message, but not propagating the failure. That
> would probably lead to trouble down the road.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index f010919..4193be4 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -503,6 +503,9 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc,
>bo_handle.u32, >fb_id);
> if (ret) {
> ErrorF("failed to add rotate fb\n");
> +   amdgpu_bo_unref(>bo);
> +   scanout->bo = NULL;
> +   return NULL;
> }
>
> scanout->width = width;
> --
> 2.6.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Don't advertise rotation support without hardware acceleration

2015-10-07 Thread Alex Deucher
On Wed, Oct 7, 2015 at 3:25 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Rotation currently doesn't work without acceleration (doesn't actually
> rotate with Option "NoAccel", crashes with Option "AccelMethod" "none"
> or when glamor fails to initialize) and would probably be too slow
> anyway.
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 10 +-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index d75a629..b9fa366 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -918,7 +918,7 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, 
> PixmapPtr ppix)
>  }
>  #endif
>
> -static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
> +static xf86CrtcFuncsRec drmmode_crtc_funcs = {
> .dpms = drmmode_crtc_dpms,
> .set_mode_major = drmmode_set_mode_major,
> .set_cursor_colors = drmmode_set_cursor_colors,
> @@ -1872,6 +1872,7 @@ static void drm_wakeup_handler(pointer data, int err, 
> pointer p)
>  Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
>  {
> AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
> +   AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
> int i, num_dvi = 0, num_hdmi = 0;
> unsigned int crtcs_needed = 0;
> drmModeResPtr mode_res;
> @@ -1896,6 +1897,13 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr 
> drmmode, int cpp)
> xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
>"%d crtcs needed for screen.\n", crtcs_needed);
>
> +   if (!info->use_glamor) {
> +   /* Rotation requires hardware acceleration */
> +   drmmode_crtc_funcs.shadow_allocate = NULL;
> +   drmmode_crtc_funcs.shadow_create = NULL;
> +   drmmode_crtc_funcs.shadow_destroy = NULL;
> +   }
> +
> for (i = 0; i < mode_res->count_crtcs; i++)
> if (!xf86IsEntityShared(pScrn->entityList[0]) ||
> (crtcs_needed && !(pAMDGPUEnt->assigned_crtcs & (1 << 
> i
> --
> 2.6.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Don't advertise rotation support without hardware acceleration v2

2015-10-07 Thread Alex Deucher
On Wed, Oct 7, 2015 at 3:45 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> Rotation currently doesn't work without acceleration (doesn't actually
> rotate with Option "NoAccel", crashes with Option "AccelMethod" "none"
> or when glamor fails to initialize) and would probably be too slow
> anyway.
>
> v2: Also remove now dead code checking for ShadowFB from
> drmmode_crtc_scanout_allocate().
>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
>  src/drmmode_display.c | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index d75a629..42c4d8e 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -475,20 +475,12 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc,
>   int width, int height)
>  {
> ScrnInfoPtr pScrn = crtc->scrn;
> -   AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
> drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> drmmode_ptr drmmode = drmmode_crtc->drmmode;
> int ret;
> int pitch;
> union gbm_bo_handle bo_handle;
>
> -   /* rotation requires acceleration */
> -   if (info->shadow_fb) {
> -   xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> -  "Rotation requires acceleration!\n");
> -   return NULL;
> -   }
> -
> if (scanout->bo) {
> if (scanout->width == width && scanout->height == height)
> return scanout->bo;
> @@ -918,7 +910,7 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, 
> PixmapPtr ppix)
>  }
>  #endif
>
> -static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
> +static xf86CrtcFuncsRec drmmode_crtc_funcs = {
> .dpms = drmmode_crtc_dpms,
> .set_mode_major = drmmode_set_mode_major,
> .set_cursor_colors = drmmode_set_cursor_colors,
> @@ -1872,6 +1864,7 @@ static void drm_wakeup_handler(pointer data, int err, 
> pointer p)
>  Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
>  {
> AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
> +   AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
> int i, num_dvi = 0, num_hdmi = 0;
> unsigned int crtcs_needed = 0;
> drmModeResPtr mode_res;
> @@ -1896,6 +1889,13 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr 
> drmmode, int cpp)
> xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
>"%d crtcs needed for screen.\n", crtcs_needed);
>
> +   if (!info->use_glamor) {
> +   /* Rotation requires hardware acceleration */
> +   drmmode_crtc_funcs.shadow_allocate = NULL;
> +   drmmode_crtc_funcs.shadow_create = NULL;
> +   drmmode_crtc_funcs.shadow_destroy = NULL;
> +   }
> +
> for (i = 0; i < mode_res->count_crtcs; i++)
> if (!xf86IsEntityShared(pScrn->entityList[0]) ||
> (crtcs_needed && !(pAMDGPUEnt->assigned_crtcs & (1 << 
> i
> --
> 2.6.0
>
> ___
> xorg-driver-ati mailing list
> xorg-driver-ati@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Only align screen / scanout pixmap height where necessary

2015-10-02 Thread Alex Deucher
On Fri, Oct 2, 2015 at 5:11 AM, Michel Dänzer <mic...@daenzer.net> wrote:
> From: Michel Dänzer <michel.daen...@amd.com>
>
> When using glamor acceleration, the pixmap's header has to have a height
> that matches exactly what the actual height is minus the GPU memory
> alignment. Otherwise CRTCs scanning out from the main scanout buffer
> (e.g. every CRTC that isn't rotated or transformed in some way) won't
> always work. This results in a bug where rotating one monitor in a
> multi-monitor setup won't always work properly. Easiest way to reproduce
> this:
>
> - Have two monitors (I've gotten this working with a 1920x1080 and
>   1280x1024, along with two 1920x1080s)
> - Rotate one of them from 0° to 90°, then rotate the same monitor from
>   90° to 180°. The monitor that hasn't been rotated won't properly
>   update, and will stay on a blank screen
>
> This doesn't seem to make any difference when using EXA for
> acceleration.
>
> Compared to Stephen Chandler's patch, this drops the height alignment
> in most places and only keeps it where it's really necessary.
>
> Reported-by: Stephen Chandler Paul <cp...@redhat.com>
> Signed-off-by: Michel Dänzer <michel.daen...@amd.com>

Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

Anyone want to port this to amdgpu?

Alex

> ---
>
> Stephen Chandler,
>
> thanks for the good catch, but I think we can take this even further.
> Does this fix the problem for you as well?
>
>  src/drmmode_display.c | 18 --
>  1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index efc35f0..623124e 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -525,6 +525,7 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc,
> RADEONInfoPtr info = RADEONPTR(pScrn);
> drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> drmmode_ptr drmmode = drmmode_crtc->drmmode;
> +   int aligned_height;
> int size;
> int ret;
> unsigned long rotate_pitch;
> @@ -547,9 +548,9 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc,
> rotate_pitch =
> RADEON_ALIGN(width, drmmode_get_pitch_align(pScrn, 
> drmmode->cpp, 0))
> * drmmode->cpp;
> -   height = RADEON_ALIGN(height, drmmode_get_height_align(pScrn, 0));
> +   aligned_height = RADEON_ALIGN(height, drmmode_get_height_align(pScrn, 
> 0));
> base_align = drmmode_get_base_align(pScrn, drmmode->cpp, 0);
> -   size = RADEON_ALIGN(rotate_pitch * height, RADEON_GPU_PAGE_SIZE);
> +   size = RADEON_ALIGN(rotate_pitch * aligned_height, 
> RADEON_GPU_PAGE_SIZE);
>
> scanout->bo = radeon_bo_open(drmmode->bufmgr, 0, size, base_align,
>  RADEON_GEM_DOMAIN_VRAM, 0);
> @@ -633,7 +634,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
> drmModeModeInfo kmode;
> int pitch;
> uint32_t tiling_flags = 0;
> -   int height;
>
> if (info->allowColorTiling) {
> if (info->ChipFamily >= CHIP_FAMILY_R600)
> @@ -644,14 +644,13 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
> mode,
>
> pitch = RADEON_ALIGN(pScrn->displayWidth, 
> drmmode_get_pitch_align(pScrn, info->pixel_bytes, tiling_flags)) *
> info->pixel_bytes;
> -   height = RADEON_ALIGN(pScrn->virtualY, 
> drmmode_get_height_align(pScrn, tiling_flags));
> if (info->ChipFamily >= CHIP_FAMILY_R600) {
> pitch = info->front_surface.level[0].pitch_bytes;
> }
>
> if (drmmode->fb_id == 0) {
> ret = drmModeAddFB(drmmode->fd,
> -  pScrn->virtualX, height,
> +  pScrn->virtualX, pScrn->virtualY,
> pScrn->depth, pScrn->bitsPerPixel,
>pitch,
>info->front_bo->handle,
> @@ -1789,6 +1788,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, 
> int height)
> ScreenPtr   screen = xf86ScrnToScreen(scrn);
> uint32_told_fb_id;
> int i, pitch, old_width, old_height, old_pitch;
> +   int aligned_height;
> uint32_t screen_size;
> int cpp = info->pixel_bytes;
> struct radeon_bo *front_bo;
> @@ -1822,8 +1822,8 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, 
> int height)
> }
>
> pitch = RADEON_ALIGN(width, drmmode_get_pitch_align(scrn, cpp, 
&g

Re: broken OpenGL support in rv370/rv380? (crashes Plasmashell5)

2015-08-27 Thread Alex Deucher
On Thu, Aug 27, 2015 at 10:49 PM, Felix Miata mrma...@earthlink.net wrote:
 $SUBJECT was suggested in fedora mailing list thread:
 https://lists.fedoraproject.org/pipermail/kde/2015-August/015633.html

 Respondent suggested workaround/test to do unconditionally:

 QT_XCB_FORCE_SOFTWARE_OPENGL=1
 export QT_XCB_FORCE_SOFTWARE_OPENGL

 That avoids the corruption and crashing that happens in Plasma but not IceWM.

 Could he be right? I looked for an already filed mesa bug in
 bugs.freedesktop.org and found nothing similar.

https://bugs.freedesktop.org/show_bug.cgi?id=91534

Alex
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 2/2] DRI2: Keep MSC monotonic when moving window between CRTCs

2015-08-19 Thread Alex Deucher
On Wed, Aug 19, 2015 at 5:17 AM, Michel Dänzer mic...@daenzer.net wrote:
 From: Michel Dänzer michel.daen...@amd.com

 This mirrors the DRI3 implementation in xserver. Fixes VDPAU video
 playback hanging when moving the window between CRTCs.

 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66384

 (Ported from amdgpu commit 63948ea091a9b324327ade7ec4fc5d67ca7e6f6f)

 Signed-off-by: Michel Dänzer michel.daen...@amd.com

For the series:
Reviewed-by: Alex Deucher alexander.deuc...@amd.com


 ---
  src/radeon_dri2.c  | 199 
 +++--
  src/radeon_video.c |   6 --
  src/radeon_video.h |   1 -
  3 files changed, 133 insertions(+), 73 deletions(-)

 diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
 index 09a84b5..b29d88b 100644
 --- a/src/radeon_dri2.c
 +++ b/src/radeon_dri2.c
 @@ -65,6 +65,28 @@ struct dri2_buffer_priv {
  };


 +struct dri2_window_priv {
 +xf86CrtcPtr crtc;
 +int vblank_delta;
 +};
 +
 +#if HAS_DEVPRIVATEKEYREC
 +
 +static DevPrivateKeyRec dri2_window_private_key_rec;
 +#define dri2_window_private_key (dri2_window_private_key_rec)
 +
 +#else
 +
 +static int dri2_window_private_key_index;
 +DevPrivateKey dri2_window_private_key = dri2_window_private_key_index;
 +
 +#endif /* HAS_DEVPRIVATEKEYREC */
 +
 +#define get_dri2_window_priv(window) \
 +((struct dri2_window_priv*) \
 + dixLookupPrivate((window)-devPrivates, dri2_window_private_key))
 +
 +
  static PixmapPtr get_drawable_pixmap(DrawablePtr drawable)
  {
  if (drawable-type == DRAWABLE_PIXMAP)
 @@ -554,17 +576,80 @@ radeon_dri2_client_state_changed(CallbackListPtr 
 *ClientStateCallback, pointer d
  }
  }

 +/*
 + * Get current frame count delta for the specified drawable and CRTC
 + */
 +static uint32_t radeon_get_msc_delta(DrawablePtr pDraw, xf86CrtcPtr crtc)
 +{
 +drmmode_crtc_private_ptr drmmode_crtc = crtc-driver_private;
 +
 +if (pDraw  pDraw-type == DRAWABLE_WINDOW)
 +   return drmmode_crtc-interpolated_vblanks +
 +   get_dri2_window_priv((WindowPtr)pDraw)-vblank_delta;
 +
 +return drmmode_crtc-interpolated_vblanks;
 +}
 +
 +/*
 + * Get current frame count and timestamp of the specified CRTC
 + */
 +static Bool radeon_dri2_get_crtc_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 
 *msc)
 +{
 +if (!radeon_crtc_is_enabled(crtc) ||
 +drmmode_crtc_get_ust_msc(crtc, ust, msc) != Success) {
 +   /* CRTC is not running, extrapolate MSC and timestamp */
 +   drmmode_crtc_private_ptr drmmode_crtc = crtc-driver_private;
 +   ScrnInfoPtr scrn = crtc-scrn;
 +   RADEONInfoPtr info = RADEONPTR(scrn);
 +   CARD64 now, delta_t, delta_seq;
 +
 +   if (!drmmode_crtc-dpms_last_ust)
 +   return FALSE;
 +
 +   if (drmmode_get_current_ust(info-dri2.drm_fd, now) != 0) {
 +   xf86DrvMsg(scrn-scrnIndex, X_ERROR,
 +  %s cannot get current time\n, __func__);
 +   return FALSE;
 +   }
 +
 +   delta_t = now - drmmode_crtc-dpms_last_ust;
 +   delta_seq = delta_t * drmmode_crtc-dpms_last_fps;
 +   delta_seq /= 100;
 +   *ust = drmmode_crtc-dpms_last_ust;
 +   delta_t = delta_seq * 100;
 +   delta_t /= drmmode_crtc-dpms_last_fps;
 +   *ust += delta_t;
 +   *msc = drmmode_crtc-dpms_last_seq;
 +   *msc += delta_seq;
 +}
 +
 +return TRUE;
 +}
 +
  static
  xf86CrtcPtr radeon_dri2_drawable_crtc(DrawablePtr pDraw, Bool 
 consider_disabled)
  {
  ScreenPtr pScreen = pDraw-pScreen;
  ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 +xf86CrtcPtr crtc = radeon_pick_best_crtc(pScrn, consider_disabled,
 + pDraw-x, pDraw-x + 
 pDraw-width,
 + pDraw-y, pDraw-y + 
 pDraw-height);
 +
 +if (crtc  pDraw-type == DRAWABLE_WINDOW) {
 +   struct dri2_window_priv *priv = 
 get_dri2_window_priv((WindowPtr)pDraw);
 +
 +   if (priv-crtc  priv-crtc != crtc) {
 +   CARD64 ust, mscold, mscnew;

 -return radeon_pick_best_crtc(pScrn, consider_disabled,
 -pDraw-x,
 -pDraw-x + pDraw-width,
 -pDraw-y,
 -pDraw-y + pDraw-height);
 +   radeon_dri2_get_crtc_msc(priv-crtc, ust, mscold);
 +   radeon_dri2_get_crtc_msc(crtc, ust, mscnew);
 +   priv-vblank_delta += mscold - mscnew;
 +   }
 +
 +   priv-crtc = crtc;
 +}
 +
 +return crtc;
  }

  static void
 @@ -592,7 +677,7 @@ radeon_dri2_flip_event_handler(ScrnInfoPtr scrn, uint32_t 
 frame, uint64_t usec,

  if (!flip-crtc)
 goto abort;
 -frame += radeon_get_interpolated_vblanks(flip-crtc);
 +frame += radeon_get_msc_delta(drawable, flip-crtc);

  screen = scrn-pScreen;
  pixmap = screen-GetScreenPixmap(screen);
 @@ -825,7 +910,7 @@ static void radeon_dri2_frame_event_handler(ScrnInfoPtr 
 scrn, uint32_t seq

Re: [PATCH xf86-video-amdgpu] DRI2: Keep MSC monotonic when moving window between CRTCs

2015-08-14 Thread Alex Deucher
On Fri, Aug 14, 2015 at 5:44 AM, Michel Dänzer mic...@daenzer.net wrote:
 From: Michel Dänzer michel.daen...@amd.com

 This mirrors the DRI3 implementation in xserver. Fixes VDPAU video
 playback hanging when moving the window between CRTCs.

 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66384
 Signed-off-by: Michel Dänzer michel.daen...@amd.com

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/amdgpu_dri2.c  | 202 
 +++--
  src/amdgpu_video.c |   6 --
  src/amdgpu_video.h |   1 -
  3 files changed, 134 insertions(+), 75 deletions(-)

 diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
 index bbf286c..cdef3f2 100644
 --- a/src/amdgpu_dri2.c
 +++ b/src/amdgpu_dri2.c
 @@ -65,6 +65,28 @@ struct dri2_buffer_priv {
 unsigned int refcnt;
  };

 +struct dri2_window_priv {
 +   xf86CrtcPtr crtc;
 +   int vblank_delta;
 +};
 +
 +#if HAS_DEVPRIVATEKEYREC
 +
 +static DevPrivateKeyRec dri2_window_private_key_rec;
 +#define dri2_window_private_key (dri2_window_private_key_rec)
 +
 +#else
 +
 +static int dri2_window_private_key_index;
 +DevPrivateKey dri2_window_private_key = dri2_window_private_key_index;
 +
 +#endif /* HAS_DEVPRIVATEKEYREC */
 +
 +#define get_dri2_window_priv(window) \
 +   ((struct dri2_window_priv*) \
 +dixLookupPrivate((window)-devPrivates, dri2_window_private_key))
 +
 +
  static PixmapPtr get_drawable_pixmap(DrawablePtr drawable)
  {
 if (drawable-type == DRAWABLE_PIXMAP)
 @@ -420,16 +442,80 @@ amdgpu_dri2_client_state_changed(CallbackListPtr * 
 ClientStateCallback,
 }
  }

 +/*
 + * Get current frame count delta for the specified drawable and CRTC
 + */
 +static uint32_t amdgpu_get_msc_delta(DrawablePtr pDraw, xf86CrtcPtr crtc)
 +{
 +   drmmode_crtc_private_ptr drmmode_crtc = crtc-driver_private;
 +
 +   if (pDraw  pDraw-type == DRAWABLE_WINDOW)
 +   return drmmode_crtc-interpolated_vblanks +
 +   get_dri2_window_priv((WindowPtr)pDraw)-vblank_delta;
 +
 +   return drmmode_crtc-interpolated_vblanks;
 +}
 +
 +/*
 + * Get current frame count and timestamp of the specified CRTC
 + */
 +static Bool amdgpu_dri2_get_crtc_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 
 *msc)
 +{
 +   if (!amdgpu_crtc_is_enabled(crtc) ||
 +   drmmode_crtc_get_ust_msc(crtc, ust, msc) != Success) {
 +   /* CRTC is not running, extrapolate MSC and timestamp */
 +   drmmode_crtc_private_ptr drmmode_crtc = crtc-driver_private;
 +   ScrnInfoPtr scrn = crtc-scrn;
 +   AMDGPUInfoPtr info = AMDGPUPTR(scrn);
 +   CARD64 now, delta_t, delta_seq;
 +
 +   if (!drmmode_crtc-dpms_last_ust)
 +   return FALSE;
 +
 +   if (drmmode_get_current_ust(info-dri2.drm_fd, now) != 0) {
 +   xf86DrvMsg(scrn-scrnIndex, X_ERROR,
 +  %s cannot get current time\n, __func__);
 +   return FALSE;
 +   }
 +
 +   delta_t = now - drmmode_crtc-dpms_last_ust;
 +   delta_seq = delta_t * drmmode_crtc-dpms_last_fps;
 +   delta_seq /= 100;
 +   *ust = drmmode_crtc-dpms_last_ust;
 +   delta_t = delta_seq * 100;
 +   delta_t /= drmmode_crtc-dpms_last_fps;
 +   *ust += delta_t;
 +   *msc = drmmode_crtc-dpms_last_seq;
 +   *msc += delta_seq;
 +   }
 +
 +   return TRUE;
 +}
 +
  static
  xf86CrtcPtr amdgpu_dri2_drawable_crtc(DrawablePtr pDraw, Bool 
 consider_disabled)
  {
 ScreenPtr pScreen = pDraw-pScreen;
 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 +   xf86CrtcPtr crtc = amdgpu_pick_best_crtc(pScrn, consider_disabled,
 +pDraw-x, pDraw-x + 
 pDraw-width,
 +pDraw-y, pDraw-y + 
 pDraw-height);
 +
 +   if (crtc  pDraw-type == DRAWABLE_WINDOW) {
 +   struct dri2_window_priv *priv = 
 get_dri2_window_priv((WindowPtr)pDraw);
 +
 +   if (priv-crtc  priv-crtc != crtc) {
 +   CARD64 ust, mscold, mscnew;

 -   return amdgpu_pick_best_crtc(pScrn, consider_disabled,
 -pDraw-x,
 -pDraw-x + pDraw-width,
 -pDraw-y, pDraw-y + pDraw-height);
 +   amdgpu_dri2_get_crtc_msc(priv-crtc, ust, mscold);
 +   amdgpu_dri2_get_crtc_msc(crtc, ust, mscnew);
 +   priv-vblank_delta += mscold - mscnew;
 +   }
 +
 +   priv-crtc = crtc;
 +   }
 +
 +   return crtc;
  }

  static void
 @@ -456,7 +542,7 @@ amdgpu_dri2_flip_event_handler(ScrnInfoPtr scrn, uint32_t 
 frame, uint64_t usec,

 if (!flip-crtc)
 goto abort;
 -   frame

[PATCH] add new OLAND pci id

2015-08-10 Thread Alex Deucher
Signed-off-by: Alex Deucher alexander.deuc...@amd.com
---
 src/ati_pciids_gen.h  | 1 +
 src/pcidb/ati_pciids.csv  | 1 +
 src/radeon_chipinfo_gen.h | 1 +
 src/radeon_chipset_gen.h  | 1 +
 src/radeon_pci_chipset_gen.h  | 1 +
 src/radeon_pci_device_match_gen.h | 1 +
 6 files changed, 6 insertions(+)

diff --git a/src/ati_pciids_gen.h b/src/ati_pciids_gen.h
index 1055dce..c6216a5 100644
--- a/src/ati_pciids_gen.h
+++ b/src/ati_pciids_gen.h
@@ -692,6 +692,7 @@
 #define PCI_CHIP_OLAND_6610 0x6610
 #define PCI_CHIP_OLAND_6611 0x6611
 #define PCI_CHIP_OLAND_6613 0x6613
+#define PCI_CHIP_OLAND_6617 0x6617
 #define PCI_CHIP_OLAND_6620 0x6620
 #define PCI_CHIP_OLAND_6621 0x6621
 #define PCI_CHIP_OLAND_6623 0x6623
diff --git a/src/pcidb/ati_pciids.csv b/src/pcidb/ati_pciids.csv
index c2a52fc..55d7b1d 100644
--- a/src/pcidb/ati_pciids.csv
+++ b/src/pcidb/ati_pciids.csv
@@ -693,6 +693,7 @@
 0x6610,OLAND_6610,OLAND,,OLAND
 0x6611,OLAND_6611,OLAND,,OLAND
 0x6613,OLAND_6613,OLAND,,OLAND
+0x6617,OLAND_6617,OLAND,1,OLAND
 0x6620,OLAND_6620,OLAND,1,OLAND
 0x6621,OLAND_6621,OLAND,1,OLAND
 0x6623,OLAND_6623,OLAND,1,OLAND
diff --git a/src/radeon_chipinfo_gen.h b/src/radeon_chipinfo_gen.h
index 0673f9a..91ef8df 100644
--- a/src/radeon_chipinfo_gen.h
+++ b/src/radeon_chipinfo_gen.h
@@ -612,6 +612,7 @@ static RADEONCardInfo RADEONCards[] = {
  { 0x6610, CHIP_FAMILY_OLAND, 0, 0, 0, 0, 0 },
  { 0x6611, CHIP_FAMILY_OLAND, 0, 0, 0, 0, 0 },
  { 0x6613, CHIP_FAMILY_OLAND, 0, 0, 0, 0, 0 },
+ { 0x6617, CHIP_FAMILY_OLAND, 1, 0, 0, 0, 0 },
  { 0x6620, CHIP_FAMILY_OLAND, 1, 0, 0, 0, 0 },
  { 0x6621, CHIP_FAMILY_OLAND, 1, 0, 0, 0, 0 },
  { 0x6623, CHIP_FAMILY_OLAND, 1, 0, 0, 0, 0 },
diff --git a/src/radeon_chipset_gen.h b/src/radeon_chipset_gen.h
index 6b56eb6..5d6d233 100644
--- a/src/radeon_chipset_gen.h
+++ b/src/radeon_chipset_gen.h
@@ -612,6 +612,7 @@ SymTabRec RADEONChipsets[] = {
   { PCI_CHIP_OLAND_6610, OLAND },
   { PCI_CHIP_OLAND_6611, OLAND },
   { PCI_CHIP_OLAND_6613, OLAND },
+  { PCI_CHIP_OLAND_6617, OLAND },
   { PCI_CHIP_OLAND_6620, OLAND },
   { PCI_CHIP_OLAND_6621, OLAND },
   { PCI_CHIP_OLAND_6623, OLAND },
diff --git a/src/radeon_pci_chipset_gen.h b/src/radeon_pci_chipset_gen.h
index 61cc50c..4b4b8e4 100644
--- a/src/radeon_pci_chipset_gen.h
+++ b/src/radeon_pci_chipset_gen.h
@@ -612,6 +612,7 @@ static PciChipsets RADEONPciChipsets[] = {
  { PCI_CHIP_OLAND_6610, PCI_CHIP_OLAND_6610, RES_SHARED_VGA },
  { PCI_CHIP_OLAND_6611, PCI_CHIP_OLAND_6611, RES_SHARED_VGA },
  { PCI_CHIP_OLAND_6613, PCI_CHIP_OLAND_6613, RES_SHARED_VGA },
+ { PCI_CHIP_OLAND_6617, PCI_CHIP_OLAND_6617, RES_SHARED_VGA },
  { PCI_CHIP_OLAND_6620, PCI_CHIP_OLAND_6620, RES_SHARED_VGA },
  { PCI_CHIP_OLAND_6621, PCI_CHIP_OLAND_6621, RES_SHARED_VGA },
  { PCI_CHIP_OLAND_6623, PCI_CHIP_OLAND_6623, RES_SHARED_VGA },
diff --git a/src/radeon_pci_device_match_gen.h 
b/src/radeon_pci_device_match_gen.h
index 0b821b2..6dfe1e4 100644
--- a/src/radeon_pci_device_match_gen.h
+++ b/src/radeon_pci_device_match_gen.h
@@ -612,6 +612,7 @@ static const struct pci_id_match radeon_device_match[] = {
  ATI_DEVICE_MATCH( PCI_CHIP_OLAND_6610, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_OLAND_6611, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_OLAND_6613, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_OLAND_6617, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_OLAND_6620, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_OLAND_6621, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_OLAND_6623, 0 ),
-- 
1.8.3.1

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 6/6] On screen resize, clear the new buffer before displaying it

2015-08-06 Thread Alex Deucher
On Thu, Aug 6, 2015 at 5:59 AM, Michel Dänzer mic...@daenzer.net wrote:
 From: Michel Dänzer michel.daen...@amd.com

 Fixes garbage being intermittently visible during a screen resize.

 (Ported from radeon commit 80f3d727f93cb6efedd2b39338d2301035965fe2)

 Signed-off-by: Michel Dänzer michel.daen...@amd.com

For the series:
Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/amdgpu_drv.h |  1 +
  src/amdgpu_glamor_wrappers.c |  9 +
  src/drmmode_display.c| 21 ++---
  3 files changed, 28 insertions(+), 3 deletions(-)

 diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
 index 7194a48..3a8144f 100644
 --- a/src/amdgpu_drv.h
 +++ b/src/amdgpu_drv.h
 @@ -206,6 +206,7 @@ typedef struct {
 uint_fast32_t gpu_flushed;
 uint_fast32_t gpu_synced;
 Bool use_glamor;
 +   Bool force_accel;
 Bool shadow_primary;
 Bool tear_free;

 diff --git a/src/amdgpu_glamor_wrappers.c b/src/amdgpu_glamor_wrappers.c
 index 8edfde0..7ff2f30 100644
 --- a/src/amdgpu_glamor_wrappers.c
 +++ b/src/amdgpu_glamor_wrappers.c
 @@ -428,9 +428,17 @@ amdgpu_glamor_poly_fill_rect(DrawablePtr pDrawable, 
 GCPtr pGC,
  int nrect, xRectangle *prect)
  {
 ScrnInfoPtr scrn = xf86ScreenToScrn(pDrawable-pScreen);
 +   AMDGPUInfoPtr info = AMDGPUPTR(scrn);
 PixmapPtr pixmap = get_drawable_pixmap(pDrawable);
 struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);

 +   if ((info-force_accel || amdgpu_glamor_use_gpu(pixmap)) 
 +   amdgpu_glamor_prepare_access_gpu(priv)) {
 +   info-glamor.SavedPolyFillRect(pDrawable, pGC, nrect, prect);
 +   amdgpu_glamor_finish_access_gpu_rw(info, priv);
 +   return;
 +   }
 +
 if (amdgpu_glamor_prepare_access_cpu_rw(scrn, pixmap, priv)) {
 if (amdgpu_glamor_prepare_access_gc(scrn, pGC)) {
 fbPolyFillRect(pDrawable, pGC, nrect, prect);
 @@ -629,6 +637,7 @@ amdgpu_glamor_validate_gc(GCPtr pGC, unsigned long 
 changes, DrawablePtr pDrawabl

 glamor_validate_gc(pGC, changes, pDrawable);
 info-glamor.SavedCopyArea = pGC-ops-CopyArea;
 +   info-glamor.SavedPolyFillRect = pGC-ops-PolyFillRect;

 if (amdgpu_get_pixmap_private(get_drawable_pixmap(pDrawable)) ||
 (pGC-stipple  amdgpu_get_pixmap_private(pGC-stipple)) ||
 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
 index 161c2ca..98dd3b1 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -1541,6 +1541,8 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, 
 int width, int height)
 uint32_t bo_handle;
 void *fb_shadow;
 int hint = 0;
 +   xRectangle rect;
 +   GCPtr gc;

 if (scrn-virtualX == width  scrn-virtualY == height)
 return TRUE;
 @@ -1614,6 +1616,22 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, 
 int width, int height)
 scrn-pixmapPrivate.ptr = ppix-devPrivate.ptr;
  #endif

 +   if (info-use_glamor)
 +   amdgpu_glamor_create_screen_resources(scrn-pScreen);
 +
 +   /* Clear new buffer */
 +   gc = GetScratchGC(ppix-drawable.depth, scrn-pScreen);
 +   ValidateGC(ppix-drawable, gc);
 +   rect.x = 0;
 +   rect.y = 0;
 +   rect.width = width;
 +   rect.height = height;
 +   info-force_accel = TRUE;
 +   (*gc-ops-PolyFillRect)(ppix-drawable, gc, 1, rect);
 +   info-force_accel = FALSE;
 +   FreeScratchGC(gc);
 +   amdgpu_glamor_flush(scrn);
 +
 for (i = 0; i  xf86_config-num_crtc; i++) {
 xf86CrtcPtr crtc = xf86_config-crtc[i];

 @@ -1624,9 +1642,6 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, 
 int width, int height)
crtc-rotation, crtc-x, crtc-y);
 }

 -   if (info-use_glamor)
 -   amdgpu_glamor_create_screen_resources(scrn-pScreen);
 -
 if (old_fb_id)
 drmModeRmFB(drmmode-fd, old_fb_id);
 if (old_front) {
 --
 2.5.0

 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


[PATCH xf86-video-amdgpu 2/2] add fiji pci id

2015-08-03 Thread Alex Deucher
Signed-off-by: Alex Deucher alexander.deuc...@amd.com
---
 src/amdgpu_chipinfo_gen.h | 1 +
 src/amdgpu_chipset_gen.h  | 1 +
 src/amdgpu_pci_chipset_gen.h  | 1 +
 src/amdgpu_pci_device_match_gen.h | 1 +
 src/ati_pciids_gen.h  | 1 +
 src/pcidb/ati_pciids.csv  | 1 +
 6 files changed, 6 insertions(+)

diff --git a/src/amdgpu_chipinfo_gen.h b/src/amdgpu_chipinfo_gen.h
index 5d1b29b..6969e1e 100644
--- a/src/amdgpu_chipinfo_gen.h
+++ b/src/amdgpu_chipinfo_gen.h
@@ -77,4 +77,5 @@ static AMDGPUCardInfo AMDGPUCards[] = {
  { 0x9875, CHIP_FAMILY_CARRIZO },
  { 0x9876, CHIP_FAMILY_CARRIZO },
  { 0x9877, CHIP_FAMILY_CARRIZO },
+ { 0x7300, CHIP_FAMILY_FIJI },
 };
diff --git a/src/amdgpu_chipset_gen.h b/src/amdgpu_chipset_gen.h
index d17589b..94d2df5 100644
--- a/src/amdgpu_chipset_gen.h
+++ b/src/amdgpu_chipset_gen.h
@@ -77,5 +77,6 @@ SymTabRec AMDGPUChipsets[] = {
   { PCI_CHIP_CARRIZO_9875, CARRIZO },
   { PCI_CHIP_CARRIZO_9876, CARRIZO },
   { PCI_CHIP_CARRIZO_9877, CARRIZO },
+  { PCI_CHIP_FIJI_7300, FIJI },
   { -1, NULL }
 };
diff --git a/src/amdgpu_pci_chipset_gen.h b/src/amdgpu_pci_chipset_gen.h
index 4d37f51..6ffb7db 100644
--- a/src/amdgpu_pci_chipset_gen.h
+++ b/src/amdgpu_pci_chipset_gen.h
@@ -77,5 +77,6 @@ static PciChipsets AMDGPUPciChipsets[] = {
  { PCI_CHIP_CARRIZO_9875, PCI_CHIP_CARRIZO_9875, RES_SHARED_VGA },
  { PCI_CHIP_CARRIZO_9876, PCI_CHIP_CARRIZO_9876, RES_SHARED_VGA },
  { PCI_CHIP_CARRIZO_9877, PCI_CHIP_CARRIZO_9877, RES_SHARED_VGA },
+ { PCI_CHIP_FIJI_7300, PCI_CHIP_FIJI_7300, RES_SHARED_VGA },
  { -1, -1, RES_UNDEFINED }
 };
diff --git a/src/amdgpu_pci_device_match_gen.h 
b/src/amdgpu_pci_device_match_gen.h
index 432059e..4a198ac 100644
--- a/src/amdgpu_pci_device_match_gen.h
+++ b/src/amdgpu_pci_device_match_gen.h
@@ -77,5 +77,6 @@ static const struct pci_id_match amdgpu_device_match[] = {
  ATI_DEVICE_MATCH( PCI_CHIP_CARRIZO_9875, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_CARRIZO_9876, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_CARRIZO_9877, 0 ),
+ ATI_DEVICE_MATCH( PCI_CHIP_FIJI_7300, 0 ),
  { 0, 0, 0 }
 };
diff --git a/src/ati_pciids_gen.h b/src/ati_pciids_gen.h
index a34246f..933d727 100644
--- a/src/ati_pciids_gen.h
+++ b/src/ati_pciids_gen.h
@@ -75,3 +75,4 @@
 #define PCI_CHIP_CARRIZO_9875 0x9875
 #define PCI_CHIP_CARRIZO_9876 0x9876
 #define PCI_CHIP_CARRIZO_9877 0x9877
+#define PCI_CHIP_FIJI_7300 0x7300
diff --git a/src/pcidb/ati_pciids.csv b/src/pcidb/ati_pciids.csv
index f9500da..0f18611 100644
--- a/src/pcidb/ati_pciids.csv
+++ b/src/pcidb/ati_pciids.csv
@@ -76,3 +76,4 @@
 0x9875,CARRIZO_9875,CARRIZO,CARRIZO
 0x9876,CARRIZO_9876,CARRIZO,CARRIZO
 0x9877,CARRIZO_9877,CARRIZO,CARRIZO
+0x7300,FIJI_7300,FIJI,FIJI
-- 
1.8.3.1

___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 1/2] radeon: cleanup the entity rec

2015-07-27 Thread Alex Deucher
On Sun, Jul 26, 2015 at 7:23 PM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 Some of these were set, some of them were
 always opposites, so clean things up.

 Signed-off-by: Dave Airlie airl...@redhat.com

For the series:
Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/drmmode_display.c | 2 +-
  src/radeon.h  | 1 -
  src/radeon_kms.c  | 5 -
  src/radeon_probe.c| 4 
  src/radeon_probe.h| 4 
  5 files changed, 1 insertion(+), 15 deletions(-)

 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
 index 337ee55..a769013 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -1561,7 +1561,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr 
 drmmode, drmModeResPtr mode_r
 if (!RADEONZaphodStringMatches(pScrn, s, name))
 goto out_free_encoders;
 } else {
 -   if (info-IsPrimary  (num != 0))
 +   if (!info-IsSecondary  (num != 0))
 goto out_free_encoders;
 else if (info-IsSecondary  (num != 1))
 goto out_free_encoders;
 diff --git a/src/radeon.h b/src/radeon.h
 index d6f18fa..88df93f 100644
 --- a/src/radeon.h
 +++ b/src/radeon.h
 @@ -499,7 +499,6 @@ typedef struct {
  #endif

  Bool  IsSecondary;
 -Bool  IsPrimary;

  Bool  r600_shadow_fb;
  void *fb_shadow;
 diff --git a/src/radeon_kms.c b/src/radeon_kms.c
 index 2dad0e6..14de0eb 100644
 --- a/src/radeon_kms.c
 +++ b/src/radeon_kms.c
 @@ -1079,7 +1079,6 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)

  info   = RADEONPTR(pScrn);
  info-IsSecondary  = FALSE;
 -info-IsPrimary = FALSE;
  info-pEnt = 
 xf86GetEntityInfo(pScrn-entityList[pScrn-numEntities - 1]);
  if (info-pEnt-location.type != BUS_PCI
  #ifdef XSERVER_PLATFORM_BUS
 @@ -1097,14 +1096,10 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
  if(xf86IsPrimInitDone(pScrn-entityList[0]))
  {
  info-IsSecondary = TRUE;
 -pRADEONEnt-pSecondaryScrn = pScrn;
  }
  else
  {
 -   info-IsPrimary = TRUE;
  xf86SetPrimInitDone(pScrn-entityList[0]);
 -pRADEONEnt-pPrimaryScrn = pScrn;
 -pRADEONEnt-HasSecondary = FALSE;
  }
  }

 diff --git a/src/radeon_probe.c b/src/radeon_probe.c
 index ad1e96e..f81ed13 100644
 --- a/src/radeon_probe.c
 +++ b/src/radeon_probe.c
 @@ -169,10 +169,8 @@ radeon_get_scrninfo(int entity_num, void *pci_dev)
  if (!pPriv-ptr) {
  pPriv-ptr = xnfcalloc(sizeof(RADEONEntRec), 1);
  pRADEONEnt = pPriv-ptr;
 -pRADEONEnt-HasSecondary = FALSE;
  } else {
  pRADEONEnt = pPriv-ptr;
 -pRADEONEnt-HasSecondary = TRUE;
  }
  }

 @@ -271,10 +269,8 @@ radeon_platform_probe(DriverPtr pDriver,
  if (!pPriv-ptr) {
  pPriv-ptr = xnfcalloc(sizeof(RADEONEntRec), 1);
  pRADEONEnt = pPriv-ptr;
 -pRADEONEnt-HasSecondary = FALSE;
  } else {
  pRADEONEnt = pPriv-ptr;
 -pRADEONEnt-HasSecondary = TRUE;
  }
  pRADEONEnt-platform_dev = dev;
  }
 diff --git a/src/radeon_probe.h b/src/radeon_probe.h
 index 958cb23..258c7be 100644
 --- a/src/radeon_probe.h
 +++ b/src/radeon_probe.h
 @@ -132,12 +132,8 @@ typedef struct {

  typedef struct
  {
 -Bool HasSecondary;
  Bool  HasCRTC2; /* All cards except original Radeon  
 */

 -ScrnInfoPtr pSecondaryScrn;
 -ScrnInfoPtr pPrimaryScrn;
 -
  int fd; /* for sharing across zaphod heads   
 */
  int fd_ref;
  unsigned long fd_wakeup_registered; /* server generation for which 
 fd has been registered for wakeup handling */
 --
 2.4.3

 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: two same ati cards, xrandr render offload

2015-07-20 Thread Alex Deucher

The multi-GPU prime stuff doesn't work with an xorg config.  It only works if 
you let X autoconfigure the GPUs.  I think there were x server patches at one 
point to allow this, but I'm not sure if they ever made it upstream.

Alex 


 On Friday, July 17, 2015 1:57 PM, Alexandr Gluzskiy s...@sss.chaoslab.ru 
wrote:
   
 

 Good day to all.
i have question about xrandr render offloading feature
i have multihead setup:
xrandr
Screen 0: minimum 320 x 200, current 5120 x 1200, maximum 16384 x 16384
DisplayPort-0 connected 1920x1200+1280+0 (normal left inverted right x 
axis y axis) 518mm x 324mm
    1920x1200    59.95*+
    1920x1080    59.99
    1600x1200    60.00
    1680x1050    59.95
    1600x900      59.98
    1280x1024    60.02
    1440x900      59.89
    1280x800      59.81
    1280x720      59.97
    1024x768      60.00
    800x600      60.32
    640x480      60.00
HDMI-0 connected 1920x1080+3200+0 (normal left inverted right x axis y 
axis) 510mm x 290mm
    1920x1080    60.00*+  50.00    59.94
    1920x1080i    60.00    50.00    59.94
    1680x1050    59.88
    1280x1024    60.02
    1280x960      60.00
    1152x864      59.97
    1280x720      60.00    50.00    59.94
    1024x768      60.00
    800x600      60.32
    720x576      50.00
    720x480      60.00    59.94
    640x480      60.00    59.94
DVI-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 
338mm x 270mm
    1280x1024    60.02*+  75.02
    1280x960      60.00
    1152x864      75.00
    1024x768      75.08    70.07    60.00
    832x624      74.55
    800x600      72.19    75.00    60.32    56.25
    640x480      75.00    72.81    66.67    60.00
    720x400      70.08

have one screen in X:

cat /etc/X11/xorg.conf
Section ServerFlags
    Option BlankTime  10
    Option StandbyTime  20
    Option SuspendTime  30
    Option DontZap true
    Option DRI2 true
    Option DRI3 false
    Option IgnoreABI false
    Option AutoAddDevices true
    Option AutoEnableDevices true
    Option AllowGLXWithComposite true
    Option AllowMouseOpenFail true
    Option Clone off
    Option AIGLX on
##    Option Pixmap 32
    Option Xinerama false
EndSection

Section Extensions
    Option Composite Enable
#    Option DAMAGE Enable
#    Option DOUBLE-BUFFER Enable
#    Option GLX Enable
#    Option RANDR Enable
    Option RENDER Enable
#    Option XVideo Enable
#    Option MIT-SHM Enable
#    Option DPMS Enable
EndSection

Section Module
#    Load dri2
#    Load dri3
#    Load glamoregl
    SubSection extmod
        Option  omit XFree86-DGA
    EndSubSection
EndSection

Section Monitor
    Identifier DVI-0
    Option PreferredMode 1280x1024
EndSection

Section Monitor
    Identifier DisplayPort-0
    Option PreferredMode 1920x1200
    Option Primary true
EndSection

Section Monitor
    Identifier HDMI-0
    Option PreferredMode 1920x1080
EndSection

Section Device
    Identifier card1
    Driver radeon
#    Option EnablePageFlip false
#    Option Accel on
    Option DRI3 off
    BusID PCI:1:0:0
EndSection

Section Device
    Identifier card2
    Driver radeon
#    Option EnablePageFlip false
#    Option Accel off
    Option DRI3 off
    BusID PCI:4:0:0
EndSection


Section Screen
    Identifier screen1
    Device card1
    Monitor DVI-0
    Monitor DisplayPort-0
    Monitor HDMI-0
    DefaultDepth    24
    SubSection            Display
        Depth              24
        Virtual 5120 1080
    EndSubSection
EndSection

#Section Screen
#    Identifier screen2
#    Device card2
#    Monitor DVI-1
#    DefaultDepth    24
#EndSection

Section ServerLayout
    Identifier main_layout
    Screen 0 screen1
#    Screen 1 screen2 LeftOf screen1
EndSection

Section dri
  Mode 0666
EndSection


and here i am not sure if i really need to write anything about second 
gpu in xorg.conf


so, this all working fine and now i want to offload rendering to second 
gpu, for testing, for load balancing (first gpu have much greater 
temperature than second), so i starting to configure via xrandr, and 
stuck on first command:
  xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x58 cap: 0xf, Source Output, Sink Output, Source 
Offload, Sink Offload crtcs: 6 outputs: 3 associated providers: 0 
name:radeon


P.S. sorry for my bad english, it's not my native language
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


 
  ___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Adopt for new X server dirty tracking APIs.

2015-07-14 Thread Alex Deucher
On Tue, Jul 14, 2015 at 4:08 AM, Michel Dänzer mic...@daenzer.net wrote:
 From: Dave Airlie airl...@gmail.com

 Signed-off-by: Dave Airlie airl...@redhat.com

 (Ported from radeon commit b6d871bf299c7d0f106c07ee4d8bd3b2337f53cc)

 Signed-off-by: Michel Dänzer michel.daen...@amd.com

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/amdgpu_kms.c  | 4 
  src/drmmode_display.c | 4 +++-
  2 files changed, 7 insertions(+), 1 deletion(-)

 diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
 index f6ccbd4..2019155 100644
 --- a/src/amdgpu_kms.c
 +++ b/src/amdgpu_kms.c
 @@ -188,7 +188,11 @@ static void redisplay_dirty(ScreenPtr screen, 
 PixmapDirtyUpdatePtr dirty)

 PixmapRegionInit(pixregion, dirty-slave_dst);
 DamageRegionAppend(dirty-slave_dst-drawable, pixregion);
 +#ifdef HAS_DIRTYTRACKING_ROTATION
 +   PixmapSyncDirtyHelper(dirty);
 +#else
 PixmapSyncDirtyHelper(dirty, pixregion);
 +#endif

 DamageRegionProcessPending(dirty-slave_dst-drawable);
 RegionUninit(pixregion);
 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
 index 7e0af1a..bce6774 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -796,7 +796,9 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, 
 PixmapPtr ppix)
 screen-height = screenpix-drawable.height = max_height;
 }
 drmmode_crtc-prime_pixmap_x = this_x;
 -#ifdef HAS_DIRTYTRACKING2
 +#ifdef HAS_DIRTYTRACKING_ROTATION
 +   PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, 
 RR_Rotate_0);
 +#elif defined(HAS_DIRTYTRACKING2)
 PixmapStartDirtyTracking2(ppix, screenpix, 0, 0, this_x, 0);
  #else
 PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
 --
 2.1.4

 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] DRI2: Don't ignore rotated CRTCs in amdgpu_dri2_drawable_crtc

2015-07-09 Thread Alex Deucher
On Thu, Jul 9, 2015 at 4:58 AM, Michel Dänzer mic...@daenzer.net wrote:
 From: Michel Dänzer michel.daen...@amd.com

 Waiting for vblank interrupts works fine with rotated CRTCs. The only
 case we can't handle with rotation is page flipping, which is handled
 in can_exchange().

 This fixes gnome-shell hanging on rotation, probably because
 amdgpu_dri2_get_msc returned MSC/UST 0 for rotated CRTCs.

 Signed-off-by: Michel Dänzer michel.daen...@amd.com

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/amdgpu_dri2.c | 9 +
  1 file changed, 1 insertion(+), 8 deletions(-)

 diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
 index bde36de..bbf286c 100644
 --- a/src/amdgpu_dri2.c
 +++ b/src/amdgpu_dri2.c
 @@ -425,18 +425,11 @@ xf86CrtcPtr amdgpu_dri2_drawable_crtc(DrawablePtr 
 pDraw, Bool consider_disabled)
  {
 ScreenPtr pScreen = pDraw-pScreen;
 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 -   xf86CrtcPtr crtc;

 -   crtc = amdgpu_pick_best_crtc(pScrn, consider_disabled,
 +   return amdgpu_pick_best_crtc(pScrn, consider_disabled,
  pDraw-x,
  pDraw-x + pDraw-width,
  pDraw-y, pDraw-y + pDraw-height);
 -
 -   /* Make sure the CRTC is valid and this is the real front buffer */
 -   if (crtc != NULL  !crtc-rotatedData)
 -   return crtc;
 -   else
 -   return NULL;
  }

  static void
 --
 2.1.4

 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] radeon: adopt for new X server dirty tracking APIs.

2015-07-09 Thread Alex Deucher
On Thu, Jul 9, 2015 at 5:27 AM, Dave Airlie airl...@gmail.com wrote:
 Signed-off-by: Dave Airlie airl...@redhat.com

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/drmmode_display.c | 4 +++-
  src/radeon_kms.c  | 4 
  2 files changed, 7 insertions(+), 1 deletion(-)

 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
 index ad2f48b..337ee55 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -969,7 +969,9 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr 
 ppix)
 screen-height = screenpix-drawable.height = max_height;
 }
 drmmode_crtc-prime_pixmap_x = this_x;
 -#ifdef HAS_DIRTYTRACKING2
 +#ifdef HAS_DIRTYTRACKING_ROTATION
 +   PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, 
 RR_Rotate_0);
 +#elif defined(HAS_DIRTYTRACKING2)
 PixmapStartDirtyTracking2(ppix, screenpix, 0, 0, this_x, 0);
  #else
 PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
 diff --git a/src/radeon_kms.c b/src/radeon_kms.c
 index ec8f51c..2dad0e6 100644
 --- a/src/radeon_kms.c
 +++ b/src/radeon_kms.c
 @@ -287,7 +287,11 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr 
 dirty)

 PixmapRegionInit(pixregion, dirty-slave_dst);
 DamageRegionAppend(dirty-slave_dst-drawable, pixregion);
 +#ifdef HAS_DIRTYTRACKING_ROTATION
 +   PixmapSyncDirtyHelper(dirty);
 +#else
 PixmapSyncDirtyHelper(dirty, pixregion);
 +#endif

 radeon_cs_flush_indirect(pScrn);
 DamageRegionProcessPending(dirty-slave_dst-drawable);
 --
 2.4.3

 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 1/3] present: Fall back to modeset for unflip operation

2015-07-08 Thread Alex Deucher
On Wed, Jul 8, 2015 at 5:25 AM, Michel Dänzer mic...@daenzer.net wrote:
 From: Michel Dänzer michel.daen...@amd.com

 It's not always possible to use the page flip ioctl for this, e.g.
 during DPMS off. We were previously just skipping the unflip in that
 case, which could result in hangs when setting DPMS off while a
 fullscreen Present app is running, e.g. at the GNOME3 lock screen.

 Signed-off-by: Michel Dänzer michel.daen...@amd.com

Having to do a full modeset is pretty ugly, but I don't have a better
solution.  Series is:
Reviewed-by: Alex Deucher alexander.deuc...@amd.com


 ---
  src/drmmode_display.c | 19 +++
  src/drmmode_display.h |  3 +++
  src/radeon_present.c  | 46 ++
  3 files changed, 52 insertions(+), 16 deletions(-)

 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
 index 8483909..ad2f48b 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -769,6 +769,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr 
 mode,

 if (crtc-scrn-pScreen)
 xf86CrtcSetScreenSubpixelOrder(crtc-scrn-pScreen);
 +
 +   drmmode_crtc-need_modeset = FALSE;
 +
 /* go through all the outputs and force DPMS them back on? */
 for (i = 0; i  xf86_config-num_output; i++) {
 xf86OutputPtr output = xf86_config-output[i];
 @@ -1153,20 +1156,28 @@ static void
  drmmode_output_dpms(xf86OutputPtr output, int mode)
  {
 drmmode_output_private_ptr drmmode_output = output-driver_private;
 +   xf86CrtcPtr crtc = output-crtc;
 drmModeConnectorPtr koutput = drmmode_output-mode_output;
 drmmode_ptr drmmode = drmmode_output-drmmode;

 if (!koutput)
 return;

 -   if (mode != DPMSModeOn  output-crtc)
 -   drmmode_do_crtc_dpms(output-crtc, mode);
 +   if (mode != DPMSModeOn  crtc)
 +   drmmode_do_crtc_dpms(crtc, mode);

 drmModeConnectorSetProperty(drmmode-fd, koutput-connector_id,
 drmmode_output-dpms_enum_id, mode);

 -   if (mode == DPMSModeOn  output-crtc)
 -   drmmode_do_crtc_dpms(output-crtc, mode);
 +   if (mode == DPMSModeOn  crtc) {
 +   drmmode_crtc_private_ptr drmmode_crtc = crtc-driver_private;
 +
 +   if (drmmode_crtc-need_modeset)
 +   drmmode_set_mode_major(crtc, crtc-mode, crtc-rotation, 
 crtc-x,
 +  crtc-y);
 +   else
 +   drmmode_do_crtc_dpms(crtc, mode);
 +   }
  }


 diff --git a/src/drmmode_display.h b/src/drmmode_display.h
 index ca42c7d..ab6c590 100644
 --- a/src/drmmode_display.h
 +++ b/src/drmmode_display.h
 @@ -99,6 +99,9 @@ typedef struct {
  uint32_t interpolated_vblanks;
  uint16_t lut_r[256], lut_g[256], lut_b[256];
  int prime_pixmap_x;
 +
 +/* Modeset needed for DPMS on */
 +Bool need_modeset;
  } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr;

  typedef struct {
 diff --git a/src/radeon_present.c b/src/radeon_present.c
 index c48df13..bc1053e 100644
 --- a/src/radeon_present.c
 +++ b/src/radeon_present.c
 @@ -341,30 +341,52 @@ radeon_present_unflip(ScreenPtr screen, uint64_t 
 event_id)
  {
  ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
  RADEONInfoPtr info = RADEONPTR(scrn);
 +xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
  struct radeon_present_vblank_event *event;
  PixmapPtr pixmap = screen-GetScreenPixmap(screen);
  uint32_t handle;
 -Bool ret;
 +int i;

  if (!radeon_present_check_flip(NULL, screen-root, pixmap, TRUE))
 -   return;
 +   goto modeset;

 -if (!radeon_get_pixmap_handle(pixmap, handle))
 -   return;
 +if (!radeon_get_pixmap_handle(pixmap, handle)) {
 +   ErrorF(%s: radeon_get_pixmap_handle failed, display might freeze\n,
 +  __func__);
 +   goto modeset;
 +}

  event = calloc(1, sizeof(struct radeon_present_vblank_event));
 -if (!event)
 -   return;
 +if (!event) {
 +   ErrorF(%s: calloc failed, display might freeze\n, __func__);
 +   goto modeset;
 +}

  event-event_id = event_id;

 -ret = radeon_do_pageflip(scrn, RADEON_DRM_QUEUE_CLIENT_DEFAULT, handle,
 -event_id, event, -1, radeon_present_flip_event,
 -radeon_present_flip_abort);
 -if (!ret) {
 -   xf86DrvMsg(scrn-scrnIndex, X_ERROR, present unflip failed\n);
 -   info-drmmode.present_flipping = FALSE;
 +if (radeon_do_pageflip(scrn, RADEON_DRM_QUEUE_CLIENT_DEFAULT, handle,
 +  event_id, event, -1, radeon_present_flip_event,
 +  radeon_present_flip_abort))
 +   return;
 +
 +modeset:
 +for (i = 0; i  config-num_crtc; i++) {
 +   xf86CrtcPtr crtc = config-crtc[i];
 +   drmmode_crtc_private_ptr drmmode_crtc = crtc

Re: [PATCH] Skip disabled CRTCs in radeon_scanout_(do_)update

2015-06-24 Thread Alex Deucher
On Tue, Jun 16, 2015 at 4:35 AM, Michel Dänzer mic...@daenzer.net wrote:
 From: Michel Dänzer michel.daen...@amd.com

 The vblank / page flip ioctls don't work as expected for a disabled CRTC.

 Signed-off-by: Michel Dänzer michel.daen...@amd.com

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/radeon_kms.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

 diff --git a/src/radeon_kms.c b/src/radeon_kms.c
 index 25a746d..ba95653 100644
 --- a/src/radeon_kms.c
 +++ b/src/radeon_kms.c
 @@ -338,7 +338,8 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int 
 scanout_id)
  RADEONInfoPtr info;
  Bool force;

 -if (drmmode_crtc-dpms_mode != DPMSModeOn ||
 +if (!xf86_crtc-enabled ||
 +   drmmode_crtc-dpms_mode != DPMSModeOn ||
 !drmmode_crtc-scanout[scanout_id].pixmap)
 return FALSE;

 @@ -409,7 +410,8 @@ radeon_scanout_update(xf86CrtcPtr xf86_crtc)
  DrawablePtr pDraw;
  BoxRec extents;

 -if (drmmode_crtc-scanout_update_pending ||
 +if (!xf86_crtc-enabled ||
 +   drmmode_crtc-scanout_update_pending ||
 !drmmode_crtc-scanout[0].pixmap ||
 drmmode_crtc-dpms_mode != DPMSModeOn)
 return;
 --
 2.1.4

 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu] Handle CRTC DPMS from output DPMS hooks

2015-06-24 Thread Alex Deucher
On Mon, Jun 15, 2015 at 11:42 PM, Michel Dänzer mic...@daenzer.net wrote:
 From: Michel Dänzer michel.daen...@amd.com

 This fixes at least two issues:

 The CRTC DPMS hook isn't called after a modeset, so the vertical blank
 interrupt emulation code considered the CRTC disabled after a modeset. As
 a side effect, page flipping was no longer used after a modeset.

 This change also makes sure the vertical blank interrupt emulation code
 runs before the hardware CRTC is disabled and after it's enabled from the
 output DPMS hook. The wrong order could cause gnome-shell to hang after
 a suspend/resume and/or DPMS off/on cycle.

 (imported from commit c4ae0e2cbcc0e2ebf9f13ee92d59b5120254a1dc)

 Signed-off-by: Michel Dänzer michel.daen...@amd.com

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/drmmode_display.c | 17 +++--
  1 file changed, 15 insertions(+), 2 deletions(-)

 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
 index 19f0f19..c418dfd 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -235,7 +235,8 @@ int drmmode_crtc_get_ust_msc(xf86CrtcPtr crtc, CARD64 
 *ust, CARD64 *msc)
 return Success;
  }

 -static void drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
 +static void
 +drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode)
  {
 drmmode_crtc_private_ptr drmmode_crtc = crtc-driver_private;
 ScrnInfoPtr scrn = crtc-scrn;
 @@ -296,6 +297,12 @@ static void drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
 drmmode_crtc-dpms_mode = mode;
  }

 +static void
 +drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
 +{
 +   /* Nothing to do. drmmode_do_crtc_dpms() is called as appropriate */
 +}
 +
  /* TODO: currently this function only clear the front buffer to zero */
  /* Moving forward, we might to look into making the copy with glamor instead 
 */
  void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 @@ -959,9 +966,14 @@ static void drmmode_output_dpms(xf86OutputPtr output, 
 int mode)
 drmModeConnectorPtr koutput = drmmode_output-mode_output;
 drmmode_ptr drmmode = drmmode_output-drmmode;

 +   if (mode != DPMSModeOn  output-crtc)
 +   drmmode_do_crtc_dpms(output-crtc, mode);
 +
 drmModeConnectorSetProperty(drmmode-fd, koutput-connector_id,
 drmmode_output-dpms_enum_id, mode);
 -   return;
 +
 +   if (mode == DPMSModeOn  output-crtc)
 +   drmmode_do_crtc_dpms(output-crtc, mode);
  }

  static Bool drmmode_property_ignore(drmModePropertyPtr prop)
 @@ -1681,6 +1693,7 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, 
 drmmode_ptr drmmode)

 /* Skip disabled CRTCs */
 if (!crtc-enabled) {
 +   drmmode_do_crtc_dpms(crtc, DPMSModeOff);
 drmModeSetCrtc(drmmode-fd,
drmmode_crtc-mode_crtc-crtc_id, 0, 0,
0, NULL, 0, NULL);
 --
 2.1.4

 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 1/2] present: Ignore TILE_SPLIT tiling flags in page flip check.

2015-06-24 Thread Alex Deucher
On Sun, Jun 21, 2015 at 6:36 PM, Mario Kleiner
mario.kleiner...@gmail.com wrote:
 On 06/05/2015 03:10 PM, Alex Deucher wrote:

 On Fri, Jun 5, 2015 at 8:33 AM, Mario Kleiner
 mario.kleiner...@gmail.com wrote:

 Mismatched tile split bits between source pixmap
 and target screen pixmap caused present_check_flip
 to reject page flips on at least RV730 (Radeon HD 4670).
 (Source pixmap had 0x1, Target screen pixmap had 0x601)

 Mask those tile split bits out to make the check pass and
 page flipping under DRI3/Present work.

 Maybe we should mask out more bits?


 I'm not sure if it's safe to do that.  Tile split is part of the
 tiling configuration in the display registers on evergreen and newer.
 It's probably better to try and figure out why the surfaces end up
 with different tiling parameters and fix that.

 Alex


 Alex, you're right. Just sent out a new patch which hopefully fixes it
 properly for pre-evergreen, at least it seems to do so in my testing.

 While looking at it, i found one minor thing which i don't know if it
 matters, probably not, so just fyi:


 eg_tile_split() in evergreen_accel.c and eg_tile_split_opp() in
 radeon_bo_helper.c of the ddx assign the default case in the the
 switch(tile_split) statements inconsistently, iow. eg_tile_split_opp() isn't
 the inverse of eg_tile_split():

 eg_tile_split(): default: and 4096 bytes map to flag 6.
 eg_tile_split_opp(): default and flag 4 map to 1024 bytes.

 Mesa otoh does it consistently:

 src/gallium/drivers/r600/evergreen_state.c:
 eg_tile_split(): default and 1024 bytes map to flag 4.

 src/gallium/winsys/radeon/drm/radeon_drm_bo.c:

 eg_tile_split(): default and flag 4 map to 1024 bytes.
 eg_tile_split_rev(): default and 1024 bytes map to flag 4.

 So it seems the eg_tile_split() default case in the ddx evergreen_accel.c
 is inconsistent with other definitions.

That should probably be fixed up.

Alex
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH] Don't attempt a DRI2/Present page flip while the other one is flipping

2015-06-11 Thread Alex Deucher
On Thu, Jun 11, 2015 at 5:59 AM, Michel Dänzer mic...@daenzer.net wrote:
 From: Michel Dänzer michel.daen...@amd.com

 Fixes corrupted display and hangs when switching between DRI2 and DRI3
 fullscreen apps, e.g. a compositor using DRI3 and a fullscreen app using
 DRI2 or vice versa.

 Signed-off-by: Michel Dänzer michel.daen...@amd.com

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/drmmode_display.h |  3 +++
  src/radeon_dri2.c | 23 +--
  src/radeon_present.c  | 17 -
  3 files changed, 36 insertions(+), 7 deletions(-)

 diff --git a/src/drmmode_display.h b/src/drmmode_display.h
 index 2fdd3e0..ca42c7d 100644
 --- a/src/drmmode_display.h
 +++ b/src/drmmode_display.h
 @@ -54,6 +54,9 @@ typedef struct {
int count_crtcs;

Bool delete_dp_12_displays;
 +
 +  Bool dri2_flipping;
 +  Bool present_flipping;
  } drmmode_rec, *drmmode_ptr;

  typedef struct {
 diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
 index a1f0145..7587a0c 100644
 --- a/src/radeon_dri2.c
 +++ b/src/radeon_dri2.c
 @@ -584,6 +584,7 @@ static void
  radeon_dri2_flip_event_handler(ScrnInfoPtr scrn, uint32_t frame, uint64_t 
 usec,
void *event_data)
  {
 +RADEONInfoPtr info = RADEONPTR(scrn);
  DRI2FrameEventPtr flip = event_data;
  unsigned tv_sec, tv_usec;
  DrawablePtr drawable;
 @@ -627,6 +628,7 @@ radeon_dri2_flip_event_handler(ScrnInfoPtr scrn, uint32_t 
 frame, uint64_t usec,
 DRI2SwapComplete(flip-client, drawable, frame, tv_sec, tv_usec,
  DRI2_FLIP_COMPLETE, flip-event_complete,
  flip-event_data);
 +   info-drmmode.dri2_flipping = FALSE;
 break;
  default:
 xf86DrvMsg(scrn-scrnIndex, X_WARNING, %s: unknown vblank event 
 received\n, __func__);
 @@ -644,6 +646,7 @@ radeon_dri2_schedule_flip(ScrnInfoPtr scrn, ClientPtr 
 client,
   DRI2BufferPtr back, DRI2SwapEventPtr func,
   void *data, unsigned int target_msc)
  {
 +RADEONInfoPtr info = RADEONPTR(scrn);
  struct dri2_buffer_priv *back_priv;
  struct radeon_bo *bo;
  DRI2FrameEventPtr flip_info;
 @@ -670,11 +673,16 @@ radeon_dri2_schedule_flip(ScrnInfoPtr scrn, ClientPtr 
 client,
  back_priv = back-driverPrivate;
  bo = radeon_get_pixmap_bo(back_priv-pixmap);

 -return radeon_do_pageflip(scrn, client, bo-handle,
 - RADEON_DRM_QUEUE_ID_DEFAULT, flip_info,
 - ref_crtc_hw_id,
 - radeon_dri2_flip_event_handler,
 - radeon_dri2_flip_event_abort);
 +if (radeon_do_pageflip(scrn, client, bo-handle,
 +  RADEON_DRM_QUEUE_ID_DEFAULT, flip_info,
 +  ref_crtc_hw_id,
 +  radeon_dri2_flip_event_handler,
 +  radeon_dri2_flip_event_abort)) {
 +   info-drmmode.dri2_flipping = TRUE;
 +   return TRUE;
 +}
 +
 +return FALSE;
  }

  static Bool
 @@ -742,8 +750,11 @@ static Bool
  can_flip(ScrnInfoPtr pScrn, DrawablePtr draw,
  DRI2BufferPtr front, DRI2BufferPtr back)
  {
 +RADEONInfoPtr info = RADEONPTR(pScrn);
 +
  return draw-type == DRAWABLE_WINDOW 
 -  RADEONPTR(pScrn)-allowPageFlip 
 +  info-allowPageFlip 
 +  !info-drmmode.present_flipping 
pScrn-vtSema 
DRI2CanFlip(draw) 
can_exchange(pScrn, draw, front, back);
 diff --git a/src/radeon_present.c b/src/radeon_present.c
 index 2626044..c48df13 100644
 --- a/src/radeon_present.c
 +++ b/src/radeon_present.c
 @@ -50,6 +50,7 @@

  struct radeon_present_vblank_event {
  uint64_t event_id;
 +xf86CrtcPtr crtc;
  };

  static uint32_t crtc_select(int crtc_id)
 @@ -238,6 +239,9 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr 
 window, PixmapPtr pixmap,
  if (!sync_flip)
 return FALSE;

 +if (info-drmmode.dri2_flipping)
 +   return FALSE;
 +
  /* The kernel driver doesn't handle flipping between BOs with different
   * tiling parameters correctly yet
   */
 @@ -266,8 +270,12 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr 
 window, PixmapPtr pixmap,
  static void
  radeon_present_flip_event(ScrnInfoPtr scrn, uint32_t msc, uint64_t ust, void 
 *pageflip_data)
  {
 +RADEONInfoPtr info = RADEONPTR(scrn);
  struct radeon_present_vblank_event *event = pageflip_data;

 +if (!event-crtc)
 +   info-drmmode.present_flipping = FALSE;
 +
  present_event_notify(event-event_id, ust, msc);
  free(event);
  }
 @@ -293,6 +301,7 @@ radeon_present_flip(RRCrtcPtr crtc, uint64_t event_id, 
 uint64_t target_msc,
  {
  ScreenPtr screen = crtc-pScreen;
  ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 +RADEONInfoPtr info = RADEONPTR(scrn);
  struct radeon_present_vblank_event *event;
  xf86CrtcPtr xf86_crtc = crtc

Re: [PATCH xf86-video-amdgpu 00/11] ShadowPrimary TearFree support

2015-06-11 Thread Alex Deucher
On Wed, Jun 10, 2015 at 5:04 AM, Michel Dänzer mic...@daenzer.net wrote:
 This series adds support for options ShadowPrimary and TearFree,
 corresponding to the same options in the radeon driver. Most of the
 changes are ports from the radeon driver, large parts of which was done
 by Darren Powell.

Reviewed-by: Alex Deucher alexander.deuc...@amd.com


 [PATCH xf86-video-amdgpu 01/11] Rename scanout_pixmap_x field to
 [PATCH xf86-video-amdgpu 02/11] Split out struct drmmode_scanout for
 [PATCH xf86-video-amdgpu 03/11] Add RADEON_CREATE_PIXMAP_SCANOUT flag
 [PATCH xf86-video-amdgpu 04/11] glamor: Remove unused function
 [PATCH xf86-video-amdgpu 05/11] glamor: Add wrappers for the X server
 [PATCH xf86-video-amdgpu 06/11] Set AMDGPU_BO_FLAGS_GBM for cursor
 [PATCH xf86-video-amdgpu 07/11] Factor out amdgpu_bo_get_handle
 [PATCH xf86-video-amdgpu 08/11] Add AMDGPU_CREATE_PIXMAP_GTT flag
 [PATCH xf86-video-amdgpu 09/11] glamor: Add Option ShadowPrimary
 [PATCH xf86-video-amdgpu 10/11] glamor: Remove the stride member of
 [PATCH xf86-video-amdgpu 11/11] Add Option TearFree
 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH 2/2] Allow/Fix use of multiple ZaphodHead outputs per x-screen.

2015-06-05 Thread Alex Deucher
On Fri, Jun 5, 2015 at 8:33 AM, Mario Kleiner
mario.kleiner...@gmail.com wrote:
 Defining multiple ZaphodHead outputs per x-screen in a
 multiple x-screen's per gpu configuration caused all
 outputs except one per x-screen to go dark, because
 there was a fixed mapping x-screen number - crtc number,
 limiting the number of crtc's per x-screen to one.

 On a ZaphodHead's setup, be more clever and assign
 as many crtc's to a given x-screen as there are
 ZaphodHeads defined for that screen, assuming
 there are enough unused crtc's available.

 Tested on a triple display setup with different combos
 of one, two or three ZaphodHeads per one, two or three
 x-screens.

 This is a port of almost identical code from
 nouveau-ddx.

 Signed-off-by: Mario Kleiner mario.kleiner...@gmail.com

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/drmmode_display.c | 44 +++-
  src/radeon_probe.c| 15 +++
  src/radeon_probe.h|  2 ++
  3 files changed, 48 insertions(+), 13 deletions(-)

 diff --git a/src/drmmode_display.c b/src/drmmode_display.c
 index c12bf51..a9f5481 100644
 --- a/src/drmmode_display.c
 +++ b/src/drmmode_display.c
 @@ -1012,15 +1012,16 @@ void drmmode_crtc_hw_id(xf86CrtcPtr crtc)
 drmmode_crtc-hw_id = tmp;
  }

 -static void
 +static unsigned int
  drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr 
 mode_res, int num)
  {
 xf86CrtcPtr crtc;
 drmmode_crtc_private_ptr drmmode_crtc;
 +   RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);

 crtc = xf86CrtcCreate(pScrn, drmmode_crtc_funcs);
 if (crtc == NULL)
 -   return;
 +   return 0;

 drmmode_crtc = xnfcalloc(sizeof(drmmode_crtc_private_rec), 1);
 drmmode_crtc-mode_crtc = drmModeGetCrtc(drmmode-fd, 
 mode_res-crtcs[num]);
 @@ -1028,7 +1029,12 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr 
 drmmode, drmModeResPtr mode_res
 crtc-driver_private = drmmode_crtc;
 drmmode_crtc_hw_id(crtc);

 -   return;
 +   /* Mark num'th crtc as in use on this device. */
 +   pRADEONEnt-assigned_crtcs |= (1  num);
 +   xf86DrvMsg(pScrn-scrnIndex, X_INFO,
 +  Allocated crtc nr. %d to this screen.\n, num);
 +
 +   return 1;
  }

  static xf86OutputStatus
 @@ -1461,7 +1467,7 @@ drmmode_create_name(ScrnInfoPtr pScrn, 
 drmModeConnectorPtr koutput, char *name,
 }
  }

 -static void
 +static unsigned int
  drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr 
 mode_res, int num, int *num_dvi, int *num_hdmi, int dynamic)
  {
 xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
 @@ -1478,7 +1484,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr 
 drmmode, drmModeResPtr mode_r

 koutput = drmModeGetConnector(drmmode-fd, mode_res-connectors[num]);
 if (!koutput)
 -   return;
 +   return 0;

 for (i = 0; i  koutput-count_props; i++) {
 props = drmModeGetProperty(drmmode-fd, koutput-props[i]);
 @@ -1524,7 +1530,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr 
 drmmode, drmModeResPtr mode_r
 for (i = 0; i  koutput-count_encoders; i++)
 drmModeFreeEncoder(kencoders[i]);
 free(kencoders);
 -   return;
 +   return 0;
 }
 }

 @@ -1587,7 +1593,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr 
 drmmode, drmModeResPtr mode_r
 drmmode_output_create_resources(output);
 }

 -   return;
 +   return 1;
  out_free_encoders:
 if (kencoders){
 for (i = 0; i  koutput-count_encoders; i++)
 @@ -1595,7 +1601,7 @@ out_free_encoders:
 free(kencoders);
 }
 drmModeFreeConnector(koutput);
 -
 +   return 0;
  }

  uint32_t find_clones(ScrnInfoPtr scrn, xf86OutputPtr output)
 @@ -2030,8 +2036,10 @@ drm_wakeup_handler(pointer data, int err, pointer p)

  Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
  {
 +   RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
 int i, num_dvi = 0, num_hdmi = 0;
 drmModeResPtr mode_res;
 +   unsigned int crtcs_needed = 0;

 xf86CrtcConfigInit(pScrn, drmmode_xf86crtc_config_funcs);

 @@ -2041,14 +2049,24 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr 
 drmmode, int cpp)
 if (!mode_res)
 return FALSE;

 +   xf86DrvMsg(pScrn-scrnIndex, X_INFO, Initializing outputs ...\n);
 +   for (i = 0; i  mode_res-count_connectors; i++)
 +   crtcs_needed += drmmode_output_init(pScrn, drmmode, mode_res,
 +   i, num_dvi, num_hdmi, 
 0);
 +   xf86DrvMsg(pScrn-scrnIndex, X_INFO,
 +  %d crtcs needed for screen.\n, crtcs_needed

Re: [PATCH 1/2] present: Ignore TILE_SPLIT tiling flags in page flip check.

2015-06-05 Thread Alex Deucher
On Fri, Jun 5, 2015 at 8:33 AM, Mario Kleiner
mario.kleiner...@gmail.com wrote:
 Mismatched tile split bits between source pixmap
 and target screen pixmap caused present_check_flip
 to reject page flips on at least RV730 (Radeon HD 4670).
 (Source pixmap had 0x1, Target screen pixmap had 0x601)

 Mask those tile split bits out to make the check pass and
 page flipping under DRI3/Present work.

 Maybe we should mask out more bits?

I'm not sure if it's safe to do that.  Tile split is part of the
tiling configuration in the display registers on evergreen and newer.
It's probably better to try and figure out why the surfaces end up
with different tiling parameters and fix that.

Alex


 Signed-off-by: Mario Kleiner mario.kleiner...@gmail.com
 ---
  src/radeon_present.c | 4 
  1 file changed, 4 insertions(+)

 diff --git a/src/radeon_present.c b/src/radeon_present.c
 index 2626044..cbe3ac4 100644
 --- a/src/radeon_present.c
 +++ b/src/radeon_present.c
 @@ -207,6 +207,10 @@ radeon_present_get_pixmap_tiling_flags(RADEONInfoPtr 
 info, PixmapPtr pixmap)
  {
  uint32_t tiling_flags = radeon_get_pixmap_tiling_flags(pixmap);

 +/* Ignore TILE_SPLIT flags. */
 +tiling_flags = ~(RADEON_TILING_EG_TILE_SPLIT_MASK 
 + RADEON_TILING_EG_TILE_SPLIT_SHIFT);
 +
  /* Micro tiling is always enabled with macro tiling on = R600, so we
   * can ignore the micro tiling bit in that case
   */
 --
 1.9.1

 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH xf86-video-amdgpu 0/13] DRI3/Present support ported from radeon

2015-06-02 Thread Alex Deucher
On Tue, Jun 2, 2015 at 5:21 AM, Michel Dänzer mic...@daenzer.net wrote:
 This series ports the changes for DRI3/Present support from the radeon
 driver, with some followup fixes squashed in.

 Patch 11 was ported by Darren Powell, so I added my review tag.

 [PATCH xf86-video-amdgpu 01/13] Require at least xserver 1.8
 [PATCH xf86-video-amdgpu 02/13] Move xorg_list backwards
 [PATCH xf86-video-amdgpu 03/13] Add DRM event queue helpers
 [PATCH xf86-video-amdgpu 04/13] DRI2: Simplify blit fallback handling
 [PATCH xf86-video-amdgpu 05/13] DRI2: Remove superfluous assignments
 [PATCH xf86-video-amdgpu 06/13] DRI2: Move
 [PATCH xf86-video-amdgpu 07/13] DRI2: Use helper functions for DRM
 [PATCH xf86-video-amdgpu 08/13] DRI2: Split out helper for getting
 [PATCH xf86-video-amdgpu 09/13] Add support for SYNC extension fences
 [PATCH xf86-video-amdgpu 10/13] Add support for the Present extension
 [PATCH xf86-video-amdgpu 11/13] glamor: Add radeon_pixmap parameter
 [PATCH xf86-video-amdgpu 12/13] amdgpu_set_shared_pixmap_backing: Add
 [PATCH xf86-video-amdgpu 13/13] Add DRI3 support

For the series:
Reviewed-by: Alex Deucher alexander.deuc...@amd.com
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


  1   2   3   4   5   6   7   8   9   10   >