Alisa Khabibrakhmanova
5e1bfb277d
drm/via: Add new condition to via_dma_cleanup()
...
Pointer dev_priv->mmio, which was checked for NULL at via_do_init_map(),
is passed to via_do_cleanup_map() and is dereferenced there without check.
The patch adds the condition in via_dma_cleanup() which prevents potential NULL
pointer dereference.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 22f579c621 ("drm: Add via unichrome support")
Signed-off-by: Alisa Khabibrakhmanova <khabibrakhmanova@ispras.ru >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20220729090643.240778-1-khabibrakhmanova@ispras.ru
2022-09-07 07:01:16 +02:00
Danilo Krummrich
b765bc9968
drm/via: use idr_init_base() to initialize dev_priv->object_idr
...
idr_init_base(), implemented by commit 6ce711f275 ("idr: Make 1-based
IDRs more efficient"), let us set an arbitrary base other than
idr_init(), which uses base 0.
Since, for this IDR, no ID < 1 is ever requested/allocated, using
idr_init_base(&idr, 1) avoids unnecessary tree walks.
Signed-off-by: Danilo Krummrich <dakr@redhat.com >
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
Link: https://lore.kernel.org/r/20220701190227.284783-2-dakr@redhat.com
2022-07-28 16:36:49 +02:00
Sam Ravnborg
685bf9f58d
drm/via: Embed via_drv.h in via_dri1
...
With this change the driver is now a signle file driver.
The only remaning heder file describes the HW and can be shared with the
new openchrome driver.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-10-sam@ravnborg.org
2022-07-16 09:26:21 +02:00
Sam Ravnborg
8f8ed7f838
drm/via: Embed via_verifier in via_dri1
...
Embed the header file in via_drv.h and the code in via_dri1.
All functions are made static as there are no more external users.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-9-sam@ravnborg.org
2022-07-16 09:26:19 +02:00
Sam Ravnborg
f99995a4d7
drm/via: Embed via_dmablit in via_dri1
...
Embed some of the header file in via_drv.h and
the rest in via_dri1.c
While embedding deleted extra empty lines and functions that
has no external users are made static.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-8-sam@ravnborg.org
2022-07-16 09:26:18 +02:00
Sam Ravnborg
b0b3a87925
drm/via: Embed via_irq in via_dri1
...
All functions are made static as there are no more external users.
The file had new copyrights that are kept.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-7-sam@ravnborg.org
2022-07-16 09:26:17 +02:00
Sam Ravnborg
e85e4ae015
drm/via: Embed via_video in via_dri1
...
All functions are made static as there are no more external users.
The file had a new copyright that is kept.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-6-sam@ravnborg.org
2022-07-16 09:26:16 +02:00
Sam Ravnborg
67034c8e00
drm/via: Embed via_mm in via_dri1
...
All functions was made static as there are no external users.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-5-sam@ravnborg.org
2022-07-16 09:26:15 +02:00
Sam Ravnborg
fa0cc3ca1d
drm/via: Embed via_map in via_dri1
...
A few functions has no external use and are made static.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-4-sam@ravnborg.org
2022-07-16 09:26:14 +02:00
Sam Ravnborg
9a4537a782
drm/via: Embed via_dma in via_dri1
...
Moved the copyright notices so all copyrights are kept.
A few variables was made static as there are no more users outside this
file.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-3-sam@ravnborg.org
2022-07-16 09:26:10 +02:00
Sam Ravnborg
e6d9767faf
drm/via: Rename via_drv to via_dri1
...
The via driver implements the DRI1 interface, and we have a new
implementation of the via driver coming that supports atomic
modesetting.
It is not acceptable just to replace the existing driver so
this is first step to make it a single-file implementation allowing
it to stay without interfering with the new driver.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Kevin Brace <kevinbrace@bracecomputerlab.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220713170202.1798216-2-sam@ravnborg.org
2022-07-16 09:26:10 +02:00