linux/drivers/gpu/drm
Damien Lespiau 98533251b0 drm/i915/bdw: Fix the write setting up the WIZ hashing mode
I was playing with clang and oh surprise! a warning trigerred by
-Wshift-overflow (gcc doesn't have this one):

    WA_SET_BIT_MASKED(GEN7_GT_MODE,
                      GEN6_WIZ_HASHING_MASK | GEN6_WIZ_HASHING_16x4);

    drivers/gpu/drm/i915/intel_ringbuffer.c:786:2: warning: signed shift result
      (0x28002000000) requires 43 bits to represent, but 'int' only has 32 bits
      [-Wshift-overflow]
        WA_SET_BIT_MASKED(GEN7_GT_MODE,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/gpu/drm/i915/intel_ringbuffer.c:737:15: note: expanded from macro
      'WA_SET_BIT_MASKED'
        WA_REG(addr, _MASKED_BIT_ENABLE(mask), (mask) & 0xffff)

Turned out GEN6_WIZ_HASHING_MASK was already shifted by 16, and we were
trying to shift it a bit more.

The other thing is that it's not the usual case of setting WA bits here, we
need to have separate mask and value.

To fix this, I've introduced a new _MASKED_FIELD() macro that takes both the
(unshifted) mask and the desired value and the rest of the patch ripples
through from it.

This bug was introduced when reworking the WA emission in:

  Commit 7225342ab5
  Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
  Date:   Tue Oct 7 17:21:26 2014 +0300

      drm/i915: Build workaround list in ring initialization

v2: Invert the order of the mask and value arguments (Daniel Vetter)
    Rewrite _MASKED_BIT_ENABLE() and _MASKED_BIT_DISABLE() with
    _MASKED_FIELD() (Jani Nikula)
    Make sure we only evaluate 'a' once in _MASKED_BIT_ENABLE() (Dave Gordon)
    Add check to ensure the value is within the mask boundaries (Chris Wilson)

v3: Ensure the the value and mask are 16 bits (Dave Gordon)

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2014-12-10 11:20:46 +02:00
..
amd amdkfd: delete some dead code 2014-11-25 19:43:29 +03:00
armada Merge tag 'drm-intel-fixes-2014-11-19' into drm-intel-next-queued 2014-11-19 18:17:38 +01:00
ast drm: Move drm_crtc_init from drm_crtc.h to drm_plane_helper.h 2014-11-05 00:14:55 +01:00
bochs bochs: add page_flip 2014-11-20 11:27:31 +10:00
bridge
cirrus drm/cirrus: allow 32bpp framebuffers for cirrus drm 2014-11-20 11:42:46 +10:00
exynos Linux 3.18-rc7 2014-12-02 10:58:33 +10:00
gma500 drm/gma500: add support for atom e6xx lpc lvds i2c 2014-12-02 13:42:49 +10:00
i2c drm: Add adv7511 encoder driver 2014-11-26 20:09:40 +02:00
i810 drm: move drm_mmap to <drm/drm_legacy.h> 2014-09-24 11:43:07 +10:00
i915 drm/i915/bdw: Fix the write setting up the WIZ hashing mode 2014-12-10 11:20:46 +02:00
imx drm: imx: Move imx-drm driver out of staging 2014-11-26 09:40:39 +10:00
mga drm: move drm_mmap to <drm/drm_legacy.h> 2014-09-24 11:43:07 +10:00
mgag200 drm: Move drm_crtc_init from drm_crtc.h to drm_plane_helper.h 2014-11-05 00:14:55 +01:00
msm drm/msm: switch to atomic-helpers iterator macros 2014-11-27 15:39:09 +01:00
nouveau Merge tag 'drm-intel-next-2014-11-21-fixed' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-12-03 08:25:59 +10:00
omapdrm drm: omapdrm: remove unused variable 2014-11-20 11:29:39 +10:00
panel drm/panel: Add Sharp LQ101R1SX01 support 2014-11-13 13:56:19 +01:00
qxl drm/qxl: drop unused mode private pointer 2014-11-15 10:15:30 +10:00
r128 drm: remove unnecessary sizeof(u8) 2014-11-20 11:30:37 +10:00
radeon Linux 3.18-rc7 2014-12-02 10:58:33 +10:00
rcar-du drm: rcar-du: Fix NULL encoder pointer dereference 2014-12-03 08:28:48 +10:00
savage drm: move drm_mmap to <drm/drm_legacy.h> 2014-09-24 11:43:07 +10:00
shmobile drm: Move drm_crtc_init from drm_crtc.h to drm_plane_helper.h 2014-11-05 00:14:55 +01:00
sis drm: move drm_mmap to <drm/drm_legacy.h> 2014-09-24 11:43:07 +10:00
sti drm: Move drm_crtc_init from drm_crtc.h to drm_plane_helper.h 2014-11-05 00:14:55 +01:00
tdfx drm: move drm_mmap to <drm/drm_legacy.h> 2014-09-24 11:43:07 +10:00
tegra Linux 3.18-rc7 2014-12-02 10:58:33 +10:00
tilcdc drm/tilcdc: Deletion of an unnecessary check before the function call "drm_fbdev_cma_hotplug_event" 2014-11-21 12:16:31 +10:00
ttm drm/ttm: Avoid memory allocation from shrinker functions. 2014-11-20 11:31:56 +10:00
udl drm/udl: properly check for error pointers 2014-11-26 10:03:18 +10:00
via drm: move drm_mmap to <drm/drm_legacy.h> 2014-09-24 11:43:07 +10:00
vmwgfx drm/vmwgfx: Deletion of an unnecessary check before the function call "vfree" 2014-11-21 12:16:40 +10:00
ati_pcigart.c drm: split ati_pcigart.h out of drmP.h 2014-09-12 14:11:14 +10:00
drm_agpsupport.c drm: move AGP definitions harder 2014-09-10 17:40:11 +10:00
drm_atomic.c drm/atomic: track bitmask of planes attached to crtc 2014-11-27 15:38:15 +01:00
drm_atomic_helper.c drm/atomic: clear plane's CRTC and FB when shutting down 2014-11-27 15:39:11 +01:00
drm_auth.c drm: Move piles of functions from drmP.h to drm_internal.h 2014-09-12 11:16:29 +02:00
drm_bufs.c drm: Move __drm_pci_free to drm_legacy.h 2014-09-12 11:08:56 +02:00
drm_cache.c
drm_context.c
drm_crtc.c drm: Handle atomic state properly in kms getfoo ioctl 2014-11-27 15:39:11 +01:00
drm_crtc_helper.c drm/atomic: Refcounting for plane_state->fb 2014-11-06 21:08:37 +01:00
drm_crtc_internal.h
drm_debugfs.c drm: Move piles of functions from drmP.h to drm_internal.h 2014-09-12 11:16:29 +02:00
drm_dma.c drm: Move legacy buffer structures to <drm/drm_legacy.h> 2014-09-12 15:28:12 +02:00
drm_dp_helper.c drm/dp: Add counters in the drm_dp_aux struct for I2C NACKs and DEFERs 2014-11-05 14:03:22 +01:00
drm_dp_mst_topology.c drm/dp/mst: Handle invalid link bandwidth from DPCD gracefully 2014-11-15 09:31:34 +10:00
drm_drv.c drm: Document that drm_dev_alloc doesn't need a parent 2014-11-25 13:12:42 +01:00
drm_edid.c Merge tag 'drm-intel-next-2014-11-21-fixed' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-12-03 08:25:59 +10:00
drm_edid_load.c drm/edid: Deletion of an unnecessary check before the function call "release_firmware" 2014-11-21 12:16:27 +10:00
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c drm: Remove compiler BUG_ON() test 2014-11-04 09:47:45 +01:00
drm_flip_work.c drm: flip-work: change drm_flip_work_init prototype 2014-11-15 09:29:14 +10:00
drm_fops.c drm: Implement O_NONBLOCK support on /dev/dri/cardN 2014-10-08 15:07:07 +02:00
drm_gem.c drm: Sanitize DRM_IOCTL_MODE_CREATE_DUMB input 2014-11-15 09:50:21 +10:00
drm_gem_cma_helper.c drm/cma: Remove call to drm_gem_free_mmap_offset() 2014-11-13 13:27:33 +01:00
drm_global.c
drm_hashtab.c
drm_info.c drm: Extract <drm/drm_gem.h> 2014-09-24 11:43:41 +10:00
drm_internal.h drm: Move internal debugfs functions to drm_internal.h 2014-09-24 11:43:35 +10:00
drm_ioc32.c
drm_ioctl.c drm: Purge ioctl forward declarations from drmP.h 2014-09-12 15:27:47 +02:00
drm_irq.c drm/irq: BUG_ON() -> WARN_ON() 2014-11-20 11:33:51 +10:00
drm_legacy.h drm: Create drm legacy driver header 2014-09-12 11:08:55 +02:00
drm_lock.c drm: unexport drm_global_mutex 2014-09-12 11:19:47 +02:00
drm_memory.c drm: Move drm_memory.c map support declarations to <drm/drm_legacy.h> 2014-09-12 15:28:12 +02:00
drm_mipi_dsi.c drm/dsi: Do not require .owner field to be set 2014-11-13 13:56:17 +01:00
drm_mm.c
drm_modes.c gpu:drm: Fix typo in Documentation/DocBook/drm.xml 2014-10-21 10:55:33 +02:00
drm_modeset_lock.c drm: Per-plane locking 2014-11-12 17:56:12 +10:00
drm_of.c
drm_panel.c
drm_pci.c drm: Move legacy buffer structures to <drm/drm_legacy.h> 2014-09-12 15:28:12 +02:00
drm_plane_helper.c drm/plane: Pass old state to ->atomic_update() 2014-11-25 13:27:58 +01:00
drm_platform.c drm: Goody bye, drm_bus! 2014-09-10 17:43:10 +10:00
drm_prime.c drm: Miscellaneous fixes for v3.19-rc1 2014-11-15 09:37:20 +10:00
drm_probe_helper.c drm: Fix DRM_FORCE_ON_DIGITAL use 2014-11-04 09:45:04 +01:00
drm_rect.c
drm_scatter.c drm: Move sg functions into drm_legacy.h 2014-09-12 11:08:54 +02:00
drm_sysfs.c drm: Move piles of functions from drmP.h to drm_internal.h 2014-09-12 11:16:29 +02:00
drm_trace.h
drm_trace_points.c
drm_vm.c drm: Move drm_vm_open_locked into drm_internal.h 2014-09-24 11:43:20 +10:00
drm_vma_manager.c
Kconfig drm: imx: Move imx-drm driver out of staging 2014-11-26 09:40:39 +10:00
Makefile drm: imx: Move imx-drm driver out of staging 2014-11-26 09:40:39 +10:00