summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-18drm/gma500/gma_device: Include our own header containing prototypesLee Jones1-0/+1
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/gma500/gma_device.c:10:6: warning: no previous prototype for ‘gma_get_core_freq’ [-Wmissing-prototypes] Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-23-lee.jones@linaro.org
2021-01-18drm/gma500/gma_display: Demote kernel-doc abuses to standard comment blocksLee Jones1-4/+4
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/gma500/gma_display.c:27: warning: Function parameter or member 'crtc' not described in 'gma_pipe_has_type' drivers/gpu/drm/gma500/gma_display.c:27: warning: Function parameter or member 'type' not described in 'gma_pipe_has_type' drivers/gpu/drm/gma500/gma_display.c:190: warning: Function parameter or member 'crtc' not described in 'gma_crtc_dpms' drivers/gpu/drm/gma500/gma_display.c:190: warning: Function parameter or member 'mode' not described in 'gma_crtc_dpms' drivers/gpu/drm/gma500/gma_display.c:573: warning: Function parameter or member 'crtc' not described in 'gma_crtc_save' drivers/gpu/drm/gma500/gma_display.c:616: warning: Function parameter or member 'crtc' not described in 'gma_crtc_restore' Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Eric Anholt <eric@anholt.net> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-22-lee.jones@linaro.org
2021-01-18drm/gma500/power: Fix a bunch of *dev documentation issuesLee Jones1-3/+4
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/gma500/power.c:101: warning: Function parameter or member 'pdev' not described in 'gma_resume_display' drivers/gpu/drm/gma500/power.c:155: warning: Function parameter or member 'pdev' not described in 'gma_resume_pci' drivers/gpu/drm/gma500/power.c:155: warning: Excess function parameter 'dev' description in 'gma_resume_pci' drivers/gpu/drm/gma500/power.c:189: warning: Function parameter or member '_dev' not described in 'gma_power_suspend' drivers/gpu/drm/gma500/power.c:189: warning: Excess function parameter 'pdev' description in 'gma_power_suspend' drivers/gpu/drm/gma500/power.c:189: warning: Excess function parameter 'state' description in 'gma_power_suspend' drivers/gpu/drm/gma500/power.c:216: warning: Function parameter or member '_dev' not described in 'gma_power_resume' drivers/gpu/drm/gma500/power.c:216: warning: Excess function parameter 'pdev' description in 'gma_power_resume' Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Benjamin Defnet <benjamin.r.defnet@intel.com> Cc: Rajesh Poornachandran <rajesh.poornachandran@intel.com> Cc: Alan Cox <alan@linux.intel.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-20-lee.jones@linaro.org
2021-01-18drm/gma500/mmu: Make local function 'psb_mmu_pt_alloc_map_lock()' staticLee Jones1-2/+2
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/gma500/mmu.c:316:20: warning: no previous prototype for ‘psb_mmu_pt_alloc_map_lock’ [-Wmissing-prototypes] Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-19-lee.jones@linaro.org
2021-01-18drm/gma500/intel_i2c: Remove superflouous parameter description and rename ↵Lee Jones1-2/+1
another Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/gma500/intel_i2c.c:108: warning: Excess function parameter 'output' description in 'psb_intel_i2c_create' drivers/gpu/drm/gma500/intel_i2c.c:153: warning: Function parameter or member 'chan' not described in 'psb_intel_i2c_destroy' drivers/gpu/drm/gma500/intel_i2c.c:153: warning: Excess function parameter 'output' description in 'psb_intel_i2c_destroy' Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Eric Anholt <eric@anholt.net> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-18-lee.jones@linaro.org
2021-01-18drm/gma500/intel_bios: Demote non-conformant kernel-doc headerLee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/gma500/intel_bios.c:581: warning: Function parameter or member 'dev' not described in 'psb_intel_destroy_bios' Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Eric Anholt <eric@anholt.net> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-17-lee.jones@linaro.org
2021-01-18drm/gma500/gem: Add and rename some function parameter descriptionsLee Jones1-2/+3
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/gma500/gem.c:57:5: warning: no previous prototype for ‘psb_gem_create’ [-Wmissing-prototypes] drivers/gpu/drm/gma500/gem.c:59: warning: Function parameter or member 'stolen' not described in 'psb_gem_create' drivers/gpu/drm/gma500/gem.c:59: warning: Function parameter or member 'align' not described in 'psb_gem_create' drivers/gpu/drm/gma500/gem.c:110: warning: Function parameter or member 'file' not described in 'psb_gem_dumb_create' drivers/gpu/drm/gma500/gem.c:110: warning: Excess function parameter 'drm_file' description in 'psb_gem_dumb_create' drivers/gpu/drm/gma500/gem.c:135: warning: Excess function parameter 'vma' description in 'psb_gem_fault' Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-16-lee.jones@linaro.org
2021-01-18drm/gma500/framebuffer: Fix some possible doc-rot issuesLee Jones1-3/+3
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/gma500/framebuffer.c:171: warning: Function parameter or member 'obj' not described in 'psb_framebuffer_init' drivers/gpu/drm/gma500/framebuffer.c:171: warning: Excess function parameter 'gt' description in 'psb_framebuffer_init' drivers/gpu/drm/gma500/framebuffer.c:212: warning: Function parameter or member 'obj' not described in 'psb_framebuffer_create' drivers/gpu/drm/gma500/framebuffer.c:212: warning: Excess function parameter 'gt' description in 'psb_framebuffer_create' drivers/gpu/drm/gma500/framebuffer.c:262: warning: Function parameter or member 'fb_helper' not described in 'psbfb_create' drivers/gpu/drm/gma500/framebuffer.c:262: warning: Excess function parameter 'fbdev' description in 'psbfb_create' Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-15-lee.jones@linaro.org
2021-01-18drm/mga/mga_ioc32: Fix some formatting issues in 'mga_compat_ioctl's headerLee Jones1-6/+6
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/mga/mga_ioc32.c:171: warning: Function parameter or member 'filp' not described in 'mga_compat_ioctl' drivers/gpu/drm/mga/mga_ioc32.c:171: warning: Function parameter or member 'cmd' not described in 'mga_compat_ioctl' drivers/gpu/drm/mga/mga_ioc32.c:171: warning: Function parameter or member 'arg' not described in 'mga_compat_ioctl' Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Lee Jones <lee.jones@linaro.org> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-7-lee.jones@linaro.org
2021-01-18drm/r128/r128_ioc32: Fix formatting issues in 'r128_compat_ioctl()'s headerLee Jones1-6/+6
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/r128/r128_ioc32.c:182: warning: Function parameter or member 'filp' not described in 'r128_compat_ioctl' drivers/gpu/drm/r128/r128_ioc32.c:182: warning: Function parameter or member 'cmd' not described in 'r128_compat_ioctl' drivers/gpu/drm/r128/r128_ioc32.c:182: warning: Function parameter or member 'arg' not described in 'r128_compat_ioctl' Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Lee Jones <lee.jones@linaro.org> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-6-lee.jones@linaro.org
2021-01-18drm/mga/mga_ioc32: Document headers do not make good kernel-doc candidatesLee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/mga/mga_ioc32.c:2: warning: Cannot understand * file mga_ioc32.c Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-3-lee.jones@linaro.org
2021-01-18drm/r128/r128_ioc32: Document headers do not make good kernel-doc candidatesLee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/r128/r128_ioc32.c:2: warning: Cannot understand * file r128_ioc32.c Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210115181313.3431493-2-lee.jones@linaro.org
2021-01-18dma-buf: Add debug optionDaniel Vetter3-4/+56
We have too many people abusing the struct page they can get at but really shouldn't in importers. Aside from that the backing page might simply not exist (for dynamic p2p mappings) looking at it and using it e.g. for mmap can also wreak the page handling of the exporter completely. Importers really must go through the proper interface like dma_buf_mmap for everything. I'm semi-tempted to enforce this for dynamic importers since those really have no excuse at all to break the rules. Unfortuantely we can't store the right pointers somewhere safe to make sure we oops on something recognizable, so best is to just wrangle them a bit by flipping all the bits. At least on x86 kernel addresses have all their high bits sets and the struct page array is fairly low in the kernel mapping, so flipping all the bits gives us a very high pointer in userspace and hence excellent chances for an invalid dereference. v2: Add a note to the @map_dma_buf hook that exporters shouldn't do fancy caching tricks, which would blow up with this address scrambling trick here (Chris) Enable by default when CONFIG_DMA_API_DEBUG is enabled. v3: Only one copy of the mangle/unmangle code (Christian) v4: #ifdef, not #if (0day) v5: sg_table can also be an ERR_PTR (Chris, Christian) Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: "Christian König" <christian.koenig@amd.com> Cc: David Stevens <stevensd@chromium.org> Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20210115164739.3958206-1-daniel.vetter@ffwll.ch
2021-01-18drm/ttm: WARN_ON non-empty lru when disabling a resource managerDaniel Vetter1-0/+4
ttm_resource_manager->use_type is only used for runtime changes by vmwgfx. I think ideally we'd push this functionality into drivers - ttm itself does not provide any locking to guarantee this is safe, so the only way this can work at runtime is if the driver does provide additional guarantees. vwmgfx does that through the vmw_private->reservation_sem. Therefore supporting this feature in shared code feels a bit misplaced. As a first step add a WARN_ON to make sure the resource manager is empty. This is just to make sure I actually understand correctly what vmwgfx is doing, and to make sure an eventual subsequent refactor doesn't break anything. This check should also be useful for other drivers, to make sure they haven't leaked anything. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Christian Koenig <christian.koenig@amd.com> Cc: Huang Rui <ray.huang@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201211162942.3399050-3-daniel.vetter@ffwll.ch
2021-01-18drm/vmwgfx: Always evict vram _before_ disabling itDaniel Vetter1-1/+1
Other way round is a bit inconsistent (but not buggy in any kind). This is prep work so that ttm_resource_manager_set_used can assert that the resource manager is empty. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> Cc: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201211162942.3399050-2-daniel.vetter@ffwll.ch
2021-01-18drm/vmwgfx: Drop svga_lockDaniel Vetter2-10/+1
This isn't actually protecting anything becuase: - when running, ttm_resource_manager->use_type is protected through vmw_private->reservation_semaphore against concurrent execbuf or well anything else that might evict or reserve buffers - during suspend/resume there's nothing else running, hence vmw_pm_freeze and vmw_pm_restore do not need to take the same lock. - this also holds for the SVGA_REG_ENABLE register write Hence it is safe to just remove that spinlock. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> Cc: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201211162942.3399050-1-daniel.vetter@ffwll.ch
2021-01-18drm/panel: panel-simple: add bus-format and connector-type to Innolux n116bgeHeiko Stuebner1-0/+2
The Innolux n116bge panel has an eDP connector and 3*6 bits bus format. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210109130951.3448435-1-heiko@sntech.de
2021-01-18vgaarb: Remove unneeded semicolonsYue Zou1-3/+3
Remove superfluous semicolons after function definitions. Signed-off-by: Yue Zou <zouyue3@huawei.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210118010356.214491-1-zouyue3@huawei.com
2021-01-18drm: Set vm_ops to GEM object's values during mmapThomas Zimmermann2-9/+12
The GEM mmap code relies on the GEM object's mmap callback to set the VMA's vm_ops field. This is easily forgotten and already led to a memory leak in the CMA helpers. Instead set the vm_ops field in the DRM core code to the GEM object's value. Drivers with different needs can override this in their mmap callback. v2: * support (vm_ops == NULL) if mmap is given; required by VRAM helpers Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: f5ca8eb6f9bd ("drm/cma-helper: Implement mmap as GEM CMA object functions") Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reported-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Eric Anholt <eric@anholt.net> Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20210115093038.10345-1-tzimmermann@suse.de
2021-01-15drm/vkms: Fix missing kmalloc allocation failure checkColin Ian King1-1/+5
Currently the kmalloc allocation for config is not being null checked and could potentially lead to a null pointer dereference. Fix this by adding the missing null check. Addresses-Coverity: ("Dereference null return value") Fixes: 2df7af93fdad ("drm/vkms: Add vkms_config type") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Sumera Priyadarsini <sylphrenadin@gmail.com> Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210115130911.71073-1-colin.king@canonical.com
2021-01-15drm/amdgpu: Remove unused variableNirmoy Das1-1/+0
Remove unused space_needed variable. Fixes: 453f617a30aa ("drm/amdgpu: Resize BAR0 to the maximum available size, even if it doesn't cover VRAM") Signed-off-by: Nirmoy Das <nirmoy.das@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/413807/
2021-01-15drm/vc4: Initialize vc4_drm_driver with CMA helper defaultsThomas Zimmermann3-23/+1
The function vc4_prime_import_sg_table() is an otherwise empty wrapper around CMA's drm_gem_cma_prime_import_sg_table(). Removing it in favor of the latter allows to initialize vc4_drm_driver with CMA's initializer macro. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210114084949.29014-1-tzimmermann@suse.de
2021-01-15drm/hisilicon/hibmc: Remove hibmc_ttm.cThomas Zimmermann1-61/+0
The file is not in use. It got re-added by a rebased patch. Removing it. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 4d4dad21cc7b ("drm/hibmc: Remove references to struct drm_device.pdev") Reviewed-by: Tian Tao <tiantao6@hisilicon.com> Reported-by: Tian Tao <tiantao6@hisilicon.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Xinliang Liu <xinliang.liu@linaro.org> Cc: Tian Tao <tiantao6@hisilicon.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com> Cc: Chen Feng <puck.chen@hisilicon.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Gong junjie <gongjunjie2@huawei.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210113113107.12005-1-tzimmermann@suse.de
2021-01-14drm/modes: Switch to 64bit maths to avoid integer overflowVille Syrjälä1-2/+2
The new >8k CEA modes have dotclocks reaching 5.94 GHz, which means our clock*1000 will now overflow the 32bit unsigned integer. Switch to 64bit maths to avoid it. Cc: stable@vger.kernel.org Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201022194256.30978-1-ville.syrjala@linux.intel.com Tested-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2021-01-14drm/vmwgfx: Fix display register usage for some older configsZack Rusin2-2/+2
We can't be setting the display_id register to an invalid value because that makes our device reset the fb which causes nasty flicker (due to destruction and creation of a new fb). Also we can't be using the BITS_PER_PIXEL register if the 8BIT_EMULATION is not supported. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/414041/?series=85516&rev=2
2021-01-14drm/vmwgfx: Cleanup the cmd/fifo splitZack Rusin23-207/+198
Lets try to cleanup the usage of the term FIFO which we used for both our MMIO based cmd queue processing and for general command processing which could have been using command buffers interface. We're going to rename the functions which are processing commands (and work either via MMIO or command buffers) as _cmd_ and functions which operate on the MMIO based commands as FIFO to match the SVGA device naming. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Link: https://patchwork.freedesktop.org/patch/414044/?series=85516&rev=2
2021-01-14drm/vmwgfx: Remove the throttling codeZack Rusin6-188/+3
Throttling was used before fencing to implement early vsync support in the xorg state tracker a long time ago. The xorg state tracker has been removed years ago and no one else has ever used throttling. It's time to remove this code, it hasn't been used or tested in years. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/414042/?series=85516&rev=2
2021-01-14drm/vmwgfx: Cleanup pci resource allocationZack Rusin2-45/+73
Instead of doing it in multiple spots lets centralize the code to handle pci resources. This also cleans up the error handling a bit and will make it a lot easier to add additional svga versions to the driver. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/414040/?series=85516&rev=2
2021-01-14drm/vmwgfx: Cleanup fifo mmio handlingZack Rusin7-113/+98
Going forward the svga device might reuse mmio for general register accesses, in order to prepare for that we need to cleanup our naming and handling of fifo specific mmio reads and writes. As part of this work lets switch to managed mapping of the fifo mmio to make the error handling cleaner. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/414045/?series=85516&rev=2
2021-01-14drm/vmwgfx: Switch to a managed drm deviceZack Rusin10-84/+68
To cleanup some of the error handling and prepare for some other work lets switch to a managed drm device. It will let us get a better handle on some of the error paths. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/414039/?series=85516&rev=2
2021-01-14drm/vmwgfx: Remove stealth modeZack Rusin2-26/+10
Before drm got helpers for removing conflicting pci framebuffer devices we implemented something known as "stealth" mode which allowed vmwgfx to run even if it couldn't reserve pci resources. We can just switch to regular drm helpers instead of keeping the stealth mode alive as it makes our code a lot cleaner. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Link: https://patchwork.freedesktop.org/patch/414043/?series=85516&rev=2
2021-01-14drm/vmwgfx: add Zack Rusin as maintainerRoland Scheidegger1-0/+1
Reviewed-by: Zack Rusin <zackr@vmware.com> Signed-off-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Zack Rusin <zackr@vmware.com> Link: https://patchwork.freedesktop.org/patch/414043/?series=85516&rev=2
2021-01-14drm/vblank: Fix typo in docsSumera Priyadarsini1-1/+1
Fix typo in intro chapter in drm_vblank.c. Change 'sacn' to 'scan'. Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210114142245.udr7v2aa43ho56xs@adolin
2021-01-14drm: drm_crc: fix a kernel-doc markupMauro Carvalho Chehab1-1/+1
A function has a different name between their prototype and its kernel-doc markup: ../include/drm/drm_crtc.h:1257: warning: expecting prototype for drm_crtc_alloc_with_planes(). Prototype was for drmm_crtc_alloc_with_planes() instead Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Acked-by: Simon Ser <contact@emersion.fr> Signed-off-by: Simon Ser <contact@emersion.fr> Link: https://patchwork.freedesktop.org/patch/msgid/2439fb6713e9b2aa27a81f3269a4b0e8e7dfcd36.1610610937.git.mchehab+huawei@kernel.org
2021-01-14drm/sun4i: tcon: fix inverted DCLK polarityGiulio Benetti2-19/+3
During commit 88bc4178568b ("drm: Use new DRM_BUS_FLAG_*_(DRIVE|SAMPLE)_(POS|NEG)EDGE flags") DRM_BUS_FLAG_* macros have been changed to avoid ambiguity but just because of this ambiguity previous DRM_BUS_FLAG_PIXDATA_(POS/NEG)EDGE were used meaning _SAMPLE_ not _DRIVE_. This leads to DLCK inversion and need to fix but instead of swapping phase values, let's adopt an easier approach Maxime suggested: It turned out that bit 26 of SUN4I_TCON0_IO_POL_REG is dedicated to invert DCLK polarity and this makes things really easier than before. So let's handle DCLK polarity by adding SUN4I_TCON0_IO_POL_DCLK_DRIVE_NEGEDGE as bit 26 and activating according to bus_flags the same way it is done for all the other signals polarity. Fixes: 88bc4178568b ("drm: Use new DRM_BUS_FLAG_*_(DRIVE|SAMPLE)_(POS|NEG)EDGE flags") Suggested-by: Maxime Ripard <maxime@cerno.tech> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20210114081732.9386-1-giulio.benetti@benettiengineering.com
2021-01-14drm/hisilicon: Fix build errorTian Tao1-1/+1
Fix the following errors: divers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c: In function ‘hibmc_hw_map’: drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c:213:25: error: ‘dev’ undeclared (first use in this function); Fixes: 4d4dad21cc7b ("drm/hibmc: Remove references to struct drm_device.pdev") Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/1610529568-25754-1-git-send-email-tiantao6@hisilicon.com
2021-01-14drm: Include <linux/mem_encrypt.h> in drm_cache.cThomas Zimmermann1-0/+1
The function drm_need_swiotbl() needs mem_encrypt_active() from <linux/mem_encrypt.h>. The include got lost when refactoring the code recently. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 3abc66706385 ("drm: Implement drm_need_swiotlb() in drm_cache.c") Reviewed-by: Christian König <christian.koenig@amd.com> Reported-by: kernel test robot <lkp@intel.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Christian König <christian.koenig@amd.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20210114080535.17132-1-tzimmermann@suse.de
2021-01-13drm/panfrost: Use delayed timer as default in devfreq profileLukasz Luba1-0/+1
Devfreq framework supports 2 modes for monitoring devices. Use delayed timer as default instead of deferrable timer in order to monitor the GPU status regardless of CPU idle. Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210105164111.30122-1-lukasz.luba@arm.com
2021-01-13drm: Move struct drm_device.hose to legacy sectionThomas Zimmermann2-4/+7
The field is only relevant for legacy DRM drivers. Its only non-legacy user in the DRM core is in drm_file.c. This code is now protected by CONFIG_DRM_LEGACY. Radeon, the only driver that used the field, has been changed to maintain it's own copy. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210112081035.6882-7-tzimmermann@suse.de
2021-01-13drm/radeon: Store PCI controller in struct radeon_device.hoseThomas Zimmermann4-5/+8
Moves struct drm_device.hose into struct radeon_device. The field in struct DRM device is only for legacy drivers. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210112081035.6882-6-tzimmermann@suse.de
2021-01-13drm: Merge CONFIG_DRM_VM into CONFIG_DRM_LEGACYThomas Zimmermann3-8/+2
CONFIG_DRM_VM gets selected by CONFIG_DRM_LEGACY, but nothing else. So remove it and build drm_vm.o as part of CONFIG_DRM_LEGACY. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210112081035.6882-5-tzimmermann@suse.de
2021-01-13drm: Build drm_memory.o only for legacy driversThomas Zimmermann1-2/+3
The file contains I/O-memory functions that are only used by legacy drivers. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210112081035.6882-4-tzimmermann@suse.de
2021-01-13drm: Implement drm_need_swiotlb() in drm_cache.cThomas Zimmermann2-33/+32
The function is declared in drm_cache.h. I also removed the curly braces from the for loop to adhere to kernel coding style. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210112081035.6882-3-tzimmermann@suse.de
2021-01-13drm: Inline AGP wrappers into their only callersThomas Zimmermann3-42/+6
The AGP wrapper functions serve no purpose. They used to handle builds that have CONFIG_AGP unset. But their callers are all in drm_agpsupport.c, which only gets build with CONFIG_AGP. v2: * clarify CONFIG_AGP in commit description (Daniel) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210112081035.6882-2-tzimmermann@suse.de
2021-01-13drm/vc4: Move mmap implementation into GEM object functionThomas Zimmermann3-65/+6
Moving vc4's mmap code from vc4_mmap() into a GEM object function allows for the use drm_gem_mmap() and drm_gem_prime_mmap(). The content of vc4_drm_fpos can then be generated by DEFINE_DRM_GEM_FOPS(). The actual mmap implementation is just a check if the BO is a validated shader plus the default CMA mmap code. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210108140808.25775-4-tzimmermann@suse.de
2021-01-13drm/vc4: Make several BO functions staticThomas Zimmermann2-19/+17
Rearrange the code to make BO functions static. This will also help with streamlining the BO's mmap implementation. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210108140808.25775-3-tzimmermann@suse.de
2021-01-13drm/vc4: Use drm_gem_cma_vmap() directlyThomas Zimmermann2-14/+1
Validated shaders cannot be exported. There's no need for testing this in the BO's vmap implementation. Call drm_gem_cma_vmap() directly instead. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210108140808.25775-2-tzimmermann@suse.de
2021-01-13drm/sun4i: Add support for BT2020 to DE3Jernej Skrabec2-1/+13
DE3 supports 10-bit formats, so it's only naturally to also support BT2020 encoding. Add support for it. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20210110201947.3611649-4-jernej.skrabec@siol.net
2021-01-13drm/sun4i: de2/de3: Remove redundant CSC matricesJernej Skrabec1-65/+34
YUV to RGB matrices are almost identical to YVU to RGB matrices. They only have second and third column reversed. Do that reversion in code in order to lower amount of static data and redundancy. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20210110201947.3611649-3-jernej.skrabec@siol.net
2021-01-13drm/sun4i: csc: Rework DE3 CSC macrosJernej Skrabec2-5/+3
Rework DE3 CSC macros to take just one coordinate instead of two. This will make its usage easier in subsequent commit. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20210110201947.3611649-2-jernej.skrabec@siol.net