Skip to content

Commit 3208a24

Browse files
committed
Merge tag 'drm-misc-next-fixes-2020-04-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
A bunch of fixes to avoid null pointer dereference in fbcon, fix a return in xen, some DT bindings fixes, a vc4 issue with 1920x1200 mode validation, and a conflicting framebuffer in vboxvideo. Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 0a1a679 + d8a26d8 commit 3208a24

File tree

11 files changed

+37
-44
lines changed

11 files changed

+37
-44
lines changed

Documentation/devicetree/bindings/display/panel/panel-dpi.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ properties:
2121
- {}
2222
- const: panel-dpi
2323

24-
data-mapping:
25-
enum:
26-
- rgb24
27-
- rgb565
28-
- bgr666
29-
description: |
30-
Describes the media format, how the display panel is connected
31-
to the display interface.
32-
3324
backlight: true
3425
enable-gpios: true
3526
height-mm: true
@@ -52,7 +43,6 @@ examples:
5243
compatible = "osddisplays,osd057T0559-34ts", "panel-dpi";
5344
label = "osddisplay";
5445
power-supply = <&vcc_supply>;
55-
data-mapping = "rgb565";
5646
backlight = <&backlight>;
5747
5848
port {

Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ properties:
6565
ports:
6666
type: object
6767
description:
68-
Ports as described in Documentation/devictree/bindings/graph.txt
68+
Ports as described in Documentation/devicetree/bindings/graph.txt
6969
properties:
7070
"#address-cells":
7171
const: 1
@@ -121,7 +121,7 @@ examples:
121121
#include <dt-bindings/interrupt-controller/irq.h>
122122
#include <dt-bindings/soc/ti,sci_pm_domain.h>
123123
124-
dss: dss@04a00000 {
124+
dss: dss@4a00000 {
125125
compatible = "ti,am65x-dss";
126126
reg = <0x0 0x04a00000 0x0 0x1000>, /* common */
127127
<0x0 0x04a02000 0x0 0x1000>, /* vidl1 */

Documentation/devicetree/bindings/display/ti/ti,j721e-dss.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ properties:
9898
ports:
9999
type: object
100100
description:
101-
Ports as described in Documentation/devictree/bindings/graph.txt
101+
Ports as described in Documentation/devicetree/bindings/graph.txt
102102
properties:
103103
"#address-cells":
104104
const: 1
@@ -154,7 +154,7 @@ examples:
154154
#include <dt-bindings/interrupt-controller/irq.h>
155155
#include <dt-bindings/soc/ti,sci_pm_domain.h>
156156
157-
dss: dss@04a00000 {
157+
dss: dss@4a00000 {
158158
compatible = "ti,j721e-dss";
159159
reg = <0x00 0x04a00000 0x00 0x10000>, /* common_m */
160160
<0x00 0x04a10000 0x00 0x10000>, /* common_s0*/

Documentation/devicetree/bindings/display/ti/ti,k2g-dss.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ properties:
5656
port:
5757
type: object
5858
description:
59-
Port as described in Documentation/devictree/bindings/graph.txt.
59+
Port as described in Documentation/devicetree/bindings/graph.txt.
6060
The DSS DPI output port node
6161

6262
max-memory-bandwidth:
@@ -81,7 +81,7 @@ examples:
8181
#include <dt-bindings/interrupt-controller/arm-gic.h>
8282
#include <dt-bindings/interrupt-controller/irq.h>
8383
84-
dss: dss@02540000 {
84+
dss: dss@2540000 {
8585
compatible = "ti,k2g-dss";
8686
reg = <0x02540000 0x400>,
8787
<0x02550000 0x1000>,

drivers/dma-buf/Kconfig

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ config DMABUF_MOVE_NOTIFY
4343
bool "Move notify between drivers (EXPERIMENTAL)"
4444
default n
4545
help
46-
Don''t pin buffers if the dynamic DMA-buf interface is available on both the
47-
exporter as well as the importer. This fixes a security problem where
48-
userspace is able to pin unrestricted amounts of memory through DMA-buf.
49-
But marked experimental because we don''t jet have a consistent execution
50-
context and memory management between drivers.
46+
Don't pin buffers if the dynamic DMA-buf interface is available on
47+
both the exporter as well as the importer. This fixes a security
48+
problem where userspace is able to pin unrestricted amounts of memory
49+
through DMA-buf.
50+
This is marked experimental because we don't yet have a consistent
51+
execution context and memory management between drivers.
5152

5253
config DMABUF_SELFTESTS
5354
tristate "Selftests for the dma-buf interfaces"

drivers/gpu/drm/drm_mm.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include <linux/export.h>
4646
#include <linux/interval_tree_generic.h>
4747
#include <linux/seq_file.h>
48-
#include <linux/sched/signal.h>
4948
#include <linux/slab.h>
5049
#include <linux/stacktrace.h>
5150

@@ -367,11 +366,6 @@ next_hole(struct drm_mm *mm,
367366
struct drm_mm_node *node,
368367
enum drm_mm_insert_mode mode)
369368
{
370-
/* Searching is slow; check if we ran out of time/patience */
371-
cond_resched();
372-
if (fatal_signal_pending(current))
373-
return NULL;
374-
375369
switch (mode) {
376370
default:
377371
case DRM_MM_INSERT_BEST:
@@ -563,7 +557,7 @@ int drm_mm_insert_node_in_range(struct drm_mm * const mm,
563557
return 0;
564558
}
565559

566-
return signal_pending(current) ? -ERESTARTSYS : -ENOSPC;
560+
return -ENOSPC;
567561
}
568562
EXPORT_SYMBOL(drm_mm_insert_node_in_range);
569563

drivers/gpu/drm/panel/panel-simple.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ static int panel_dpi_probe(struct device *dev,
361361
struct panel_desc *desc;
362362
unsigned int bus_flags;
363363
struct videomode vm;
364-
const char *mapping;
365364
int ret;
366365

367366
np = dev->of_node;
@@ -386,16 +385,6 @@ static int panel_dpi_probe(struct device *dev,
386385
of_property_read_u32(np, "width-mm", &desc->size.width);
387386
of_property_read_u32(np, "height-mm", &desc->size.height);
388387

389-
of_property_read_string(np, "data-mapping", &mapping);
390-
if (!strcmp(mapping, "rgb24"))
391-
desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
392-
else if (!strcmp(mapping, "rgb565"))
393-
desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
394-
else if (!strcmp(mapping, "bgr666"))
395-
desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
396-
else if (!strcmp(mapping, "lvds666"))
397-
desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
398-
399388
/* Extract bus_flags from display_timing */
400389
bus_flags = 0;
401390
vm.flags = timing->flags;

drivers/gpu/drm/vboxvideo/vbox_drv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
4141
if (!vbox_check_supported(VBE_DISPI_ID_HGSMI))
4242
return -ENODEV;
4343

44+
ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "vboxvideodrmfb");
45+
if (ret)
46+
return ret;
47+
4448
vbox = kzalloc(sizeof(*vbox), GFP_KERNEL);
4549
if (!vbox)
4650
return -ENOMEM;

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,11 +681,23 @@ static enum drm_mode_status
681681
vc4_hdmi_encoder_mode_valid(struct drm_encoder *crtc,
682682
const struct drm_display_mode *mode)
683683
{
684-
/* HSM clock must be 108% of the pixel clock. Additionally,
685-
* the AXI clock needs to be at least 25% of pixel clock, but
686-
* HSM ends up being the limiting factor.
684+
/*
685+
* As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must
686+
* be faster than pixel clock, infinitesimally faster, tested in
687+
* simulation. Otherwise, exact value is unimportant for HDMI
688+
* operation." This conflicts with bcm2835's vc4 documentation, which
689+
* states HSM's clock has to be at least 108% of the pixel clock.
690+
*
691+
* Real life tests reveal that vc4's firmware statement holds up, and
692+
* users are able to use pixel clocks closer to HSM's, namely for
693+
* 1920x1200@60Hz. So it was decided to have leave a 1% margin between
694+
* both clocks. Which, for RPi0-3 implies a maximum pixel clock of
695+
* 162MHz.
696+
*
697+
* Additionally, the AXI clock needs to be at least 25% of
698+
* pixel clock, but HSM ends up being the limiting factor.
687699
*/
688-
if (mode->clock > HSM_CLOCK_FREQ / (1000 * 108 / 100))
700+
if (mode->clock > HSM_CLOCK_FREQ / (1000 * 101 / 100))
689701
return MODE_CLOCK_HIGH;
690702

691703
return MODE_OK;

drivers/gpu/drm/xen/xen_drm_front.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *filp,
401401

402402
obj = xen_drm_front_gem_create(dev, args->size);
403403
if (IS_ERR_OR_NULL(obj)) {
404-
ret = PTR_ERR(obj);
404+
ret = PTR_ERR_OR_ZERO(obj);
405405
goto fail;
406406
}
407407

0 commit comments

Comments
 (0)