openwrt/staging/blogic.git
6 years agodrm/nouveau/gr/gf100-: delete duplicated grctx init code
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: delete duplicated grctx init code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: update r408840 where required
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: update r408840 where required

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: update 419a3c where required
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: update 419a3c where required

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise r418e94
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise r418e94

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise r419e00
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise r419e00

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: update 419eb0 where required
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: update 419eb0 where required

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: note missing 418800 modifications
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: note missing 418800 modifications

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-gf119: update 419cb8 where required
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-gf119: update 419cb8 where required

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: support firmware-provided bundle/method everywhere
Ben Skeggs [Tue, 8 May 2018 10:39:47 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: support firmware-provided bundle/method everywhere

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise tpc_mask + apply fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise tpc_mask + apply fixes from traces

We weren't placing higher TPC IDs in the right place on some configurations.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise r419f78 + apply fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise r419f78 + apply fixes from traces

Removed from GK110[B]/GK208 as RM traces show it not being touched.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise gpc_tpc_nr
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise gpc_tpc_nr

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise r406500
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise r406500

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise dist_skip_table + improve algorithm
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise dist_skip_table + improve algorithm

The algorithm for GM200 and newer matches RM for all the boards I have, but
I don't have enough data to try and figure something out for earlier boards,
so these will still write zeroes to the table as we did before.

The code in NVGPU isn't helpful here, it appears to handle specific cases.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-gf119: modify max_ways_evict where required
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-gf119: modify max_ways_evict where required

I don't think this is done after Fermi, NVGPU used to do it but removed
the code, and I've not seen RM traces touching it either.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise alpha_beta_tables + improve algorithms
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise alpha_beta_tables + improve algorithms

I haven't yet been able to find a fully programatic way of calculating the
same mapping as NVIDIA for GF100-GF119, so the algorithm partially depends
on data tables for specific configurations.

I couldn't find traces for every possibility, so the algorithm will switch
to a mapping similar to what GK104-GM10x use if it encounters one.  We did
the wrong thing before anyway, so shouldn't matter too much.

The algorithm used in the GK104 implementation was ported from NVGPU.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise rop_mapping
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise rop_mapping

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise r4060a8 + apply fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise r4060a8 + apply fixes from traces

Also fixes some GPUs where we write too many registers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise tpc_per_gpc
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise tpc_per_gpc

GM20B now also shares the same code, as NVGPU shows it doesn't need
special treatment.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise sm_id/tpc_nr
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise sm_id/tpc_nr

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise patch_ltc, noting missing init
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise patch_ltc, noting missing init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: support firmware-provided sw_ctx everywhere
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: support firmware-provided sw_ctx everywhere

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: delete duplicated init code
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: delete duplicated init code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_400054
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_400054

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: apply be exception fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: apply be exception fixes from traces

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_shader_exceptions
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_shader_exceptions

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_504430
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_504430

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_tex_hww_esr
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_tex_hww_esr

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_ppc_exceptions
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_ppc_exceptions

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_419c9c + apply fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_419c9c + apply fixes from traces

Deliberately removed from non-GP100, as RM doesn't touch it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_419eb4 + apply fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_419eb4 + apply fixes from traces

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_419cc0 + apply fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_419cc0 + apply fixes from traces

Pulled some init out of main per-GPC/TPC loops to match RM.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_sked_hww_esr
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_sked_hww_esr

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_40601c
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_40601c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_ds_hww_esr_2
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_ds_hww_esr_2

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_fecs_exceptions + apply fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_fecs_exceptions + apply fixes from traces

The value for GF100 has changed here, but it matches RM now.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100: write 0x400124 during init
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100: write 0x400124 during init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_swdx_pes_mask
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_swdx_pes_mask

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: implement another chunk of bios-provided init
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: implement another chunk of bios-provided init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_rop_active_fbps
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_rop_active_fbps

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_num_active_ltcs
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_num_active_ltcs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_zcull
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_zcull

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_vsc_stream_master
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_vsc_stream_master

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_bios
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_bios

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: support clkgate_pack everywhere
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: support clkgate_pack everywhere

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise r405a14
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise r405a14

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: support firmware-provided sw_nonctx everywhere
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: support firmware-provided sw_nonctx everywhere

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/gr/gf100-: virtualise init_gpc_mmu + apply fixes from traces
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/gr/gf100-: virtualise init_gpc_mmu + apply fixes from traces

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gp100-: force individual channels into a channel group
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gp100-: force individual channels into a channel group

RM does this for some reason, and is enforced in HW on Volta.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gm107-: write instance address in channel runlist entry
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gm107-: write instance address in channel runlist entry

RM does this for some reason.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk208-: write pbdma timeout regs during initialisation
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk208-: write pbdma timeout regs during initialisation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk110-: support writing channel group runlist entries
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk110-: support writing channel group runlist entries

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk104-: poll for runlist update completion
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk104-: poll for runlist update completion

Newer HW doesn't appear to send this event, which will cause long delays
in runlist updates if they don't complete immediately.

RM doesn't use these events anywhere, and an NVGPU commit message notes
that polling is the preferred method even on HW that supports the event.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk104-: add interfaces to support different runlist layouts
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk104-: add interfaces to support different runlist layouts

This will be required to support features on newer hardware.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk104-: simplify definition of channel classes
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk104-: simplify definition of channel classes

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk104-: require explicit runlist selection for channel allocation
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk104-: require explicit runlist selection for channel allocation

We didn't used to be aware that runlist/engine IDs weren't the same thing,
or that there was such variability in configuration between GPUs.

By exposing this information to a client, and giving it explicit control
of which runlist it's allocating a channel on, we're able to make better
choices.

The immediate effect of this is that on GPUs where CE0 is the "GRCE", we
will now be allocating a copy engine running asynchronously to GR for BO
migrations - as intended.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk104-: support querying engines available on each runlist
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk104-: support querying engines available on each runlist

Will be used to improve channel runlist selection.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk104-: allow fault recovery code to be called by other subdevs
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk104-: allow fault recovery code to be called by other subdevs

This will be required to support Volta.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo/gk104-: accept engine contexts for CE3 and up
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo/gk104-: accept engine contexts for CE3 and up

These can exist on GP100 and newer.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fifo: support channel count query
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fifo: support channel count query

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/device: support querying available engines of a specific type
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/device: support querying available engines of a specific type

Will be used for fifo runlist selection.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/device: implement a generic method to query device-specific properties
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/device: implement a generic method to query device-specific properties

We have a need to fetch data from GPU-specific sub-devices that is not
tied to any particular engine object.

This commit provides the framework to support such queries.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: pass nvkm_memory objects for channel push buffers
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: pass nvkm_memory objects for channel push buffers

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: add channel interfaces to control error interrupts
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: add channel interfaces to control error interrupts

This will be required to support Volta, but also allows us to remove code
that's duplicated for each channel type already.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: add channel interfaces to determine the user area
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: add channel interfaces to determine the user area

This will be required to support Volta.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: merge handling of pio and dma channels
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: merge handling of pio and dma channels

Unnecessarily complicated, and a barrier to cleanly supporting Volta.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: simplify definiton of core channels
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: simplify definiton of core channels

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: simplify definition of cursor channels
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: simplify definition of cursor channels

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: simplify definition of base channels
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: simplify definition of base channels

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: simplify definition of overlay immediate channels
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: simplify definition of overlay immediate channels

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: simplify definition of overlay channels
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: simplify definition of overlay channels

Introduces a new method of defining channels available from the display,
common to all channel types, allowing for more flexibility in available
channel types/counts, and reducing the amount of boiler-plate required.

This will be required to support Volta.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: replace user object with engine pointer in channels
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: replace user object with engine pointer in channels

More simplification.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: initialise from the engine, rather than the user object
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: initialise from the engine, rather than the user object

Engines are initialised on an as-needed basis, so this results in the
same behaviour, whilst allowing us to simplify things a bit.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: fetch mask of available piors during oneinit
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: fetch mask of available piors during oneinit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: fetch mask of available sors during oneinit
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: fetch mask of available sors during oneinit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: fetch mask of available dacs during oneinit
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: fetch mask of available dacs during oneinit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: fetch mask of available heads during oneinit
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: fetch mask of available heads during oneinit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/disp/nv50-: delay subunit construction until oneinit
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/disp/nv50-: delay subunit construction until oneinit

We should be reading registers to determine which subunits are really
present on a given board, and this needs to be done after DEVINIT.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fb/gm200-: fix overwriting of big page setting
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fb/gm200-: fix overwriting of big page setting

Likely a rebase bug.  Should have no impact in default configuration due
to using per-instance setting by default.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fb/gf100-: bump size of mmu debug buffers to match big page size
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fb/gf100-: bump size of mmu debug buffers to match big page size

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fault/gp100: implement replayable fault buffer initialisation
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fault/gp100: implement replayable fault buffer initialisation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/fault: add infrastructure to support fault buffers
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/fault: add infrastructure to support fault buffers

GPU-specific support will be added separately.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/mc/gp100-: route fault buffer interrupts to FAULT
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/mc/gp100-: route fault buffer interrupts to FAULT

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/core: define FAULT subdev
Ben Skeggs [Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)]
drm/nouveau/core: define FAULT subdev

This will be responsible for the handling of MMU fault buffers on GPUs
that support them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau/secboot: remove VLA usage
Gustavo A. R. Silva [Tue, 13 Mar 2018 16:24:11 +0000 (11:24 -0500)]
drm/nouveau/secboot: remove VLA usage

In preparation to enabling -Wvla, remove VLA. In this particular
case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
variable cmdline_size. Also, remove cmdline_size as it is not
actually useful anymore.

The use of stack Variable Length Arrays needs to be avoided, as they
can be a vector for stack exhaustion, which can be both a runtime bug
or a security flaw. Also, in general, as code evolves it is easy to
lose track of how big a VLA can get. Thus, we can end up having runtime
failures that are hard to debug.

Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agodrm/nouveau: nouveau: use larger buffer in nvif_vmm_map
Arnd Bergmann [Fri, 2 Feb 2018 15:27:31 +0000 (16:27 +0100)]
drm/nouveau: nouveau: use larger buffer in nvif_vmm_map

gcc points out a buffer that is clearly too small to be used
in a meaningful way, as the 'sizeof(*args) + argc > sizeof(stack)'
will always fail:

In function 'memcpy',
    inlined from 'nvif_vmm_map' at drivers/gpu/drm/nouveau/nvif/vmm.c:55:2:
include/linux/string.h:353:9: error: '__builtin_memcpy' offset 40 is out of the bounds [0, 16] of object 'stack' with type 'u8[16]' {aka 'unsigned char[16]'} [-Werror=array-bounds]
  return __builtin_memcpy(p, q, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/nouveau/nvif/vmm.c: In function 'nvif_vmm_map':
drivers/gpu/drm/nouveau/nvif/vmm.c:40:5: note: 'stack' declared here

This makes the buffer large enough so it should serve the purpose
that the author presumably had in mind. Alternatively we could
just get rid of it completely and simplify the code at the cost
of always doing the kmalloc (as we do in the current version).

Fixes: 920d2b5ef215 ("drm/nouveau/mmu: define user interfaces to mmu vmm opertaions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6 years agoMerge drm-fixes-for-v4.17-rc6-urgent into drm-next
Dave Airlie [Fri, 18 May 2018 04:08:53 +0000 (14:08 +1000)]
Merge drm-fixes-for-v4.17-rc6-urgent into drm-next

Need to backmerge some nouveau fixes to reduce
the nouveau -next conflicts a lot.

Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agodrm: rcar-du: Fix build failure
Laurent Pinchart [Tue, 15 May 2018 17:47:52 +0000 (20:47 +0300)]
drm: rcar-du: Fix build failure

Commit 75a07f399cd4 ("drm: rcar-du: Zero-out sg_tables when duplicating
plane state") introduced a reference to the alpha field of struct
rcar_du_vsp_plane_state that got removed in commit 301a9b8d5456
("drm/rcar-du: Convert to the new generic alpha property"). The issue
stems from the merge of the two commits through separate branches and
breaks compilation of the driver. Fix it.

Fixes: 75a07f399cd4 ("drm: rcar-du: Zero-out sg_tables when duplicating plane state")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180515174752.28954-1-laurent.pinchart+renesas@ideasonboard.com
6 years agodrm: rcar-du: Fix rcar_du_of_init() stub
Laurent Pinchart [Tue, 15 May 2018 15:57:36 +0000 (18:57 +0300)]
drm: rcar-du: Fix rcar_du_of_init() stub

The rcar_du_of_init() function is supposed to be defined as a stub when
CONFIG_DRM_RCAR_LVDS is disabled as the rcar_du_of.c file isn't compiled
in that case. However, a bug in the configuration option check makes it
a stub when CONFIG_DRM_RCAR_LVDS=m as well, which prevents legacy DTs
from being fixed at boot time. Fix the configuration option check by
using IS_ENABLED.

Fixes: 81c0e3dd8292 ("drm: rcar-du: Fix legacy DT to create LVDS encoder nodes")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180515155736.3379-1-laurent.pinchart+renesas@ideasonboard.com
6 years agodrm/amdgpu: include pagemap.h for release_pages()
Stephen Rothwell [Wed, 16 May 2018 06:43:34 +0000 (16:43 +1000)]
drm/amdgpu: include pagemap.h for release_pages()

Fixes: 5ae0283e831a ("drm/amdgpu: Add userptr support for KFD"
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoMerge branch 'drm-next-4.18' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Tue, 15 May 2018 22:21:51 +0000 (08:21 +1000)]
Merge branch 'drm-next-4.18' of git://people.freedesktop.org/~agd5f/linux into drm-next

Main changes for 4.18.  I'd like to do a separate pull for vega20 later
this week or next.  Highlights:
- Reserve pre-OS scanout buffer during init for seemless transition from
  console to driver
- VEGAM support
- Improved GPU scheduler documentation
- Initial gfxoff support for raven
- SR-IOV fixes
- Default to non-AGP on PowerPC for radeon
- Fine grained clock voltage control for vega10
- Power profiles for vega10
- Further clean up of powerplay/driver interface
- Underlay fixes
- Display link bw updates
- Gamma fixes
- Scatter/Gather display support on CZ/ST
- Misc bug fixes and clean ups

[airlied: fixup v3d vs scheduler API change]

Link: https://patchwork.freedesktop.org/patch/msgid/20180515185450.1113-1-alexander.deucher@amd.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoMerge tag 'drm-intel-next-2018-05-14' of git://anongit.freedesktop.org/drm/drm-intel...
Dave Airlie [Tue, 15 May 2018 21:10:13 +0000 (07:10 +1000)]
Merge tag 'drm-intel-next-2018-05-14' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

Last drm/i915 changes for v4.18:

- NV12 enabling (Chandra, Maarten)
- ICL workarounds (Oscar)
- ICL basic DPLL enabling (Paulo)
- GVT updates
- DP link config refactoring (Jani)
- Module parameter to override DMC firmware (Jani)
- PSR updates (José, DK, Daniel, Ville)
- ICL DP vswing programming (Manasi)
- ICL DBuf slice updates (Mahesh)
- Selftest fixes and updates (Chris, Matthew, Oscar)
- Execlist fixes and updates (Chris)
- Stolen memory first 4k fix (Hans de Goede)
- wait_for fixes (Mika)
- Tons of GEM improvements (Chris)
- Plenty of other fixes and improvements (Everyone)
- Crappy changelog (Me)

Signed-off-by: Dave Airlie <airlied@redhat.com>
# gpg: Signature made Mon 14 May 2018 11:04:24 PM AEST
# gpg:                using RSA key D398079D26ABEE6F
# gpg: Good signature from "Jani Nikula <jani.nikula@intel.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 1565 A65B 77B0 632E 1124  E59C D398 079D 26AB EE6F

# Conflicts:
# drivers/gpu/drm/i915/intel_lrc.c
# drivers/gpu/drm/i915/intel_sprite.c
Link: https://patchwork.freedesktop.org/patch/msgid/87k1s51bvw.fsf@intel.com
6 years agodrm/scheduler: remove unused parameter
Nayan Deshmukh [Thu, 29 Mar 2018 17:06:32 +0000 (22:36 +0530)]
drm/scheduler: remove unused parameter

this patch also effect the amdgpu and etnaviv drivers which
use the function drm_sched_entity_init

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoAdd SPDX idenitifier and clarify license
Dirk Hohndel [Wed, 2 May 2018 13:46:21 +0000 (15:46 +0200)]
Add SPDX idenitifier and clarify license

This is dual licensed under GPL-2.0 or MIT.

Signed-off-by: Dirk Hohndel (VMware) <dirk@hohndel.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: print the BO flags in the gem debugfs entry
Christian König [Fri, 11 May 2018 15:14:29 +0000 (23:14 +0800)]
drm/amdgpu: print the BO flags in the gem debugfs entry

Quite useful to know.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: drop printing the BO offset in the gem debugfs (v2)
Christian König [Fri, 11 May 2018 15:13:39 +0000 (23:13 +0800)]
drm/amdgpu: drop printing the BO offset in the gem debugfs (v2)

It is meaningless anyway.

v2: remove unused variable (Alex)

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Add support to change mtype for 2nd part of gart BOs on GFX9
Yong Zhao [Mon, 14 May 2018 16:15:27 +0000 (12:15 -0400)]
drm/amdgpu: Add support to change mtype for 2nd part of gart BOs on GFX9

This change prepares for a workaround in amdkfd for a GFX9 HW bug. It
requires the control stack memory of compute queues, which is allocated
from the second page of MQD gart BOs, to have mtype NC, rather than
the default UC.

Signed-off-by: Yong Zhao <yong.zhao@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: Add notify PWE function to SMU10
Mikita Lipski [Mon, 14 May 2018 14:13:57 +0000 (10:13 -0400)]
drm/amd/powerplay: Add notify PWE function to SMU10

Functionality to message smc to enable pwe after gpu suspense.
It is used in case when display resumes from S3 and wants to start
audio driver by enabling pwe.

Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: remove need of modeset flag for overlay planes (V2)
Shirish S [Fri, 27 Apr 2018 10:17:21 +0000 (15:47 +0530)]
drm/amd/display: remove need of modeset flag for overlay planes (V2)

This patch is in continuation to the
"843e3c7 drm/amd/display: defer modeset check in dm_update_planes_state"
where we started to eliminate the dependency on
DRM_MODE_ATOMIC_ALLOW_MODESET to be set by the user space,
which as such is not mandatory.

After deferring, this patch eliminates the dependency on the flag
for overlay planes.

This has to be done in stages as its a pretty complex and requires thorough
testing before we free primary planes as well from dependency on modeset
flag.

V2: Simplified the plane type check.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: fix null pointer for bo unmap trace function
Junwei Zhang [Fri, 11 May 2018 06:54:31 +0000 (14:54 +0800)]
drm/amdgpu: fix null pointer for bo unmap trace function

fix crash in trace.

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>