Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-2020-02-21' of git://anongit.freedesktop.org…
Browse files Browse the repository at this point in the history
…/drm/drm-misc into drm-next

drm-misc-next for 5.7:

UAPI Changes:

Cross-subsystem Changes:

Core Changes:
  - crtc: Drop get_crtc callback
  - dp: Add support for DP1.4 EDID corruption test
  - edid: Improve CEA detailed timings support
  - format-helper: Move to a GPL2/MIT dual license
  - mode: Drop drm_display_mode.private
  - vblank: Convert drm-driver vblank related code to CRTC equivalents and
    cleanup the core.
  - drm_global_mutex reworks

Driver Changes:
  - hibmc: Add gamma_set support and improve DPMS support
  - pl111: Support Integrator IM-PD1
  - sun4i: LVDS support for the A20, improvements to panel handling in DSI
  - virtio: job batching improvements, mem handling code rework
  - panel: Support for Rocktech RK101II01D-CT
  - bridge: Support for ADV7535, tc358768, improvements to ti-sn65dsi86

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200221100928.anipic2v7q5wswkb@gilmour.lan
  • Loading branch information
Dave Airlie committed Feb 26, 2020
2 parents 1b245ec + d718e53 commit aaa9d26
Show file tree
Hide file tree
Showing 130 changed files with 3,036 additions and 1,287 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ properties:
- const: allwinner,sun9i-a80-tcon-lcd
- const: allwinner,sun9i-a80-tcon-tv

- items:
- enum:
- allwinner,sun7i-a20-tcon0
- allwinner,sun7i-a20-tcon1
- const: allwinner,sun7i-a20-tcon

- items:
- enum:
- allwinner,sun50i-a64-tcon-lcd
Expand Down
23 changes: 12 additions & 11 deletions Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Analog Device ADV7511(W)/13/33 HDMI Encoders
Analog Device ADV7511(W)/13/33/35 HDMI Encoders
-----------------------------------------

The ADV7511, ADV7511W, ADV7513 and ADV7533 are HDMI audio and video transmitters
compatible with HDMI 1.4 and DVI 1.0. They support color space conversion,
S/PDIF, CEC and HDCP. ADV7533 supports the DSI interface for input pixels, while
the others support RGB interface.
The ADV7511, ADV7511W, ADV7513, ADV7533 and ADV7535 are HDMI audio and video
transmitters compatible with HDMI 1.4 and DVI 1.0. They support color space
conversion, S/PDIF, CEC and HDCP. ADV7533/5 supports the DSI interface for input
pixels, while the others support RGB interface.

Required properties:

Expand All @@ -13,6 +13,7 @@ Required properties:
"adi,adv7511w"
"adi,adv7513"
"adi,adv7533"
"adi,adv7535"

- reg: I2C slave addresses
The ADV7511 internal registers are split into four pages exposed through
Expand Down Expand Up @@ -52,14 +53,14 @@ The following input format properties are required except in "rgb 1x" and
- bgvdd-supply: A 1.8V supply that powers up the BGVDD pin. This is
needed only for ADV7511.

The following properties are required for ADV7533:
The following properties are required for ADV7533 and ADV7535:

- adi,dsi-lanes: Number of DSI data lanes connected to the DSI host. It should
be one of 1, 2, 3 or 4.
- a2vdd-supply: 1.8V supply that powers up the A2VDD pin on the chip.
- v3p3-supply: A 3.3V supply that powers up the V3P3 pin on the chip.
- v1p2-supply: A supply that powers up the V1P2 pin on the chip. It can be
either 1.2V or 1.8V.
either 1.2V or 1.8V for ADV7533 but only 1.8V for ADV7535.

Optional properties:

Expand All @@ -71,9 +72,9 @@ Optional properties:
- adi,embedded-sync: The input uses synchronization signals embedded in the
data stream (similar to BT.656). Defaults to separate H/V synchronization
signals.
- adi,disable-timing-generator: Only for ADV7533. Disables the internal timing
generator. The chip will rely on the sync signals in the DSI data lanes,
rather than generate its own timings for HDMI output.
- adi,disable-timing-generator: Only for ADV7533 and ADV7535. Disables the
internal timing generator. The chip will rely on the sync signals in the
DSI data lanes, rather than generate its own timings for HDMI output.
- clocks: from common clock binding: reference to the CEC clock.
- clock-names: from common clock binding: must be "cec".
- reg-names : Names of maps with programmable addresses.
Expand All @@ -85,7 +86,7 @@ Required nodes:
The ADV7511 has two video ports. Their connections are modelled using the OF
graph bindings specified in Documentation/devicetree/bindings/graph.txt.

- Video port 0 for the RGB, YUV or DSI input. In the case of ADV7533, the
- Video port 0 for the RGB, YUV or DSI input. In the case of ADV7533/5, the
remote endpoint phandle should be a reference to a valid mipi_dsi_host device
node.
- Video port 1 for the HDMI output
Expand Down
159 changes: 159 additions & 0 deletions Documentation/devicetree/bindings/display/bridge/toshiba,tc358768.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/bridge/toshiba,tc358768.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Toschiba TC358768/TC358778 Parallel RGB to MIPI DSI bridge

maintainers:
- Peter Ujfalusi <peter.ujfalusi@ti.com>

description: |
The TC358768/TC358778 is bridge device which converts RGB to DSI.
properties:
compatible:
enum:
- toshiba,tc358768
- toshiba,tc358778

reg:
maxItems: 1
description: base I2C address of the device

reset-gpios:
maxItems: 1
description: GPIO connected to active low RESX pin

vddc-supply:
description: Regulator for 1.2V internal core power.

vddmipi-supply:
description: Regulator for 1.2V for the MIPI.

vddio-supply:
description: Regulator for 1.8V - 3.3V IO power.

clocks:
maxItems: 1

clock-names:
const: refclk

ports:
type: object

properties:
"#address-cells":
const: 1

"#size-cells":
const: 0

port@0:
type: object
additionalProperties: false

description: |
Video port for RGB input
properties:
reg:
const: 0

patternProperties:
endpoint:
type: object
additionalProperties: false

properties:
data-lines:
enum: [ 16, 18, 24 ]

remote-endpoint: true

required:
- reg

port@1:
type: object
additionalProperties: false

description: |
Video port for DSI output (panel or connector).
properties:
reg:
const: 1

patternProperties:
endpoint:
type: object
additionalProperties: false

properties:
remote-endpoint: true

required:
- reg

required:
- "#address-cells"
- "#size-cells"
- port@0
- port@1

required:
- compatible
- reg
- vddc-supply
- vddmipi-supply
- vddio-supply
- ports

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
i2c1 {
#address-cells = <1>;
#size-cells = <0>;
dsi_bridge: dsi-bridge@e {
compatible = "toshiba,tc358768";
reg = <0xe>;
clocks = <&tc358768_refclk>;
clock-names = "refclk";
reset-gpios = <&pcf_display_board 0 GPIO_ACTIVE_LOW>;
vddc-supply = <&v1_2d>;
vddmipi-supply = <&v1_2d>;
vddio-supply = <&v3_3d>;
dsi_bridge_ports: ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
rgb_in: endpoint {
remote-endpoint = <&dpi_out>;
data-lines = <24>;
};
};
port@1 {
reg = <1>;
dsi_out: endpoint {
remote-endpoint = <&lcd_in>;
};
};
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ properties:
- osddisplays,osd101t2045-53ts
# QiaoDian XianShi Corporation 4"3 TFT LCD panel
- qiaodian,qd43003c0-40
# Rocktech Displays Ltd. RK101II01D-CT 10.1" TFT 1280x800
- rocktech,rk101ii01d-ct
# Rocktech Display Ltd. RK070ER9427 800(RGB)x480 TFT LCD panel
- rocktech,rk070er9427
# Samsung 12.2" (2560x1600 pixels) TFT LCD panel
Expand Down
2 changes: 1 addition & 1 deletion drivers/dma-buf/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ config SYNC_FILE
default n
select DMA_SHARED_BUFFER
---help---
The Sync File Framework adds explicit syncronization via
The Sync File Framework adds explicit synchronization via
userspace. It enables send/receive 'struct dma_fence' objects to/from
userspace via Sync File fds for synchronization between drivers via
userspace components. It has been ported from Android.
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/amd/amdgpu/amdgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1174,9 +1174,9 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
int amdgpu_device_ip_suspend(struct amdgpu_device *adev);
int amdgpu_device_suspend(struct drm_device *dev, bool fbcon);
int amdgpu_device_resume(struct drm_device *dev, bool fbcon);
u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe);
int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe);
void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe);
u32 amdgpu_get_vblank_counter_kms(struct drm_crtc *crtc);
int amdgpu_enable_vblank_kms(struct drm_crtc *crtc);
void amdgpu_disable_vblank_kms(struct drm_crtc *crtc);
long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg);

Expand Down
16 changes: 14 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static void amdgpu_display_flip_work_func(struct work_struct *__work)
& (DRM_SCANOUTPOS_VALID | DRM_SCANOUTPOS_IN_VBLANK)) ==
(DRM_SCANOUTPOS_VALID | DRM_SCANOUTPOS_IN_VBLANK) &&
(int)(work->target_vblank -
amdgpu_get_vblank_counter_kms(adev->ddev, amdgpu_crtc->crtc_id)) > 0) {
amdgpu_get_vblank_counter_kms(crtc)) > 0) {
schedule_delayed_work(&work->flip_work, usecs_to_jiffies(1000));
return;
}
Expand Down Expand Up @@ -219,7 +219,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
if (!adev->enable_virtual_display)
work->base = amdgpu_bo_gpu_offset(new_abo);
work->target_vblank = target - (uint32_t)drm_crtc_vblank_count(crtc) +
amdgpu_get_vblank_counter_kms(dev, work->crtc_id);
amdgpu_get_vblank_counter_kms(crtc);

/* we borrow the event spin lock for protecting flip_wrok */
spin_lock_irqsave(&crtc->dev->event_lock, flags);
Expand Down Expand Up @@ -924,3 +924,15 @@ int amdgpu_display_crtc_idx_to_irq_type(struct amdgpu_device *adev, int crtc)
return AMDGPU_CRTC_IRQ_NONE;
}
}

bool amdgpu_crtc_get_scanout_position(struct drm_crtc *crtc,
bool in_vblank_irq, int *vpos,
int *hpos, ktime_t *stime, ktime_t *etime,
const struct drm_display_mode *mode)
{
struct drm_device *dev = crtc->dev;
unsigned int pipe = crtc->index;

return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos,
stime, etime, mode);
}
15 changes: 0 additions & 15 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,16 +1377,6 @@ int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv)
return 0;
}

static bool
amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
bool in_vblank_irq, int *vpos, int *hpos,
ktime_t *stime, ktime_t *etime,
const struct drm_display_mode *mode)
{
return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos,
stime, etime, mode);
}

static struct drm_driver kms_driver = {
.driver_features =
DRIVER_USE_AGP | DRIVER_ATOMIC |
Expand All @@ -1398,11 +1388,6 @@ static struct drm_driver kms_driver = {
.postclose = amdgpu_driver_postclose_kms,
.lastclose = amdgpu_driver_lastclose_kms,
.unload = amdgpu_driver_unload_kms,
.get_vblank_counter = amdgpu_get_vblank_counter_kms,
.enable_vblank = amdgpu_enable_vblank_kms,
.disable_vblank = amdgpu_disable_vblank_kms,
.get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
.get_scanout_position = amdgpu_get_crtc_scanout_position,
.irq_handler = amdgpu_irq_handler,
.ioctls = amdgpu_ioctls_kms,
.gem_free_object_unlocked = amdgpu_gem_object_free,
Expand Down
21 changes: 12 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,14 +1110,15 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
/**
* amdgpu_get_vblank_counter_kms - get frame count
*
* @dev: drm dev pointer
* @pipe: crtc to get the frame count from
* @crtc: crtc to get the frame count from
*
* Gets the frame count on the requested crtc (all asics).
* Returns frame count on success, -EINVAL on failure.
*/
u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe)
u32 amdgpu_get_vblank_counter_kms(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
unsigned int pipe = crtc->index;
struct amdgpu_device *adev = dev->dev_private;
int vpos, hpos, stat;
u32 count;
Expand Down Expand Up @@ -1177,14 +1178,15 @@ u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe)
/**
* amdgpu_enable_vblank_kms - enable vblank interrupt
*
* @dev: drm dev pointer
* @pipe: crtc to enable vblank interrupt for
* @crtc: crtc to enable vblank interrupt for
*
* Enable the interrupt on the requested crtc (all asics).
* Returns 0 on success, -EINVAL on failure.
*/
int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe)
int amdgpu_enable_vblank_kms(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
unsigned int pipe = crtc->index;
struct amdgpu_device *adev = dev->dev_private;
int idx = amdgpu_display_crtc_idx_to_irq_type(adev, pipe);

Expand All @@ -1194,13 +1196,14 @@ int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe)
/**
* amdgpu_disable_vblank_kms - disable vblank interrupt
*
* @dev: drm dev pointer
* @pipe: crtc to disable vblank interrupt for
* @crtc: crtc to disable vblank interrupt for
*
* Disable the interrupt on the requested crtc (all asics).
*/
void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe)
void amdgpu_disable_vblank_kms(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
unsigned int pipe = crtc->index;
struct amdgpu_device *adev = dev->dev_private;
int idx = amdgpu_display_crtc_idx_to_irq_type(adev, pipe);

Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,11 @@ void amdgpu_panel_mode_fixup(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode);
int amdgpu_display_crtc_idx_to_irq_type(struct amdgpu_device *adev, int crtc);

bool amdgpu_crtc_get_scanout_position(struct drm_crtc *crtc,
bool in_vblank_irq, int *vpos,
int *hpos, ktime_t *stime, ktime_t *etime,
const struct drm_display_mode *mode);

/* fbdev layer */
int amdgpu_fbdev_init(struct amdgpu_device *adev);
void amdgpu_fbdev_fini(struct amdgpu_device *adev);
Expand Down
Loading

0 comments on commit aaa9d26

Please sign in to comment.