RE: [PATCH v13 5/7] vfio: ABI for mdev display dma-buf operation
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, August 3, 2017 11:38 AM > To: Zhang, Tina > Cc: Tian, Kevin ; intel-...@lists.freedesktop.org; dri- > de...@lists.freedesktop.org; kwankh...@nvidia.com; kra...@redhat.com; > intel-gvt-...@lists.freedesktop.org; Wang, Zhi A ; Lv, > Zhiyuan > Subject: Re: [PATCH v13 5/7] vfio: ABI for mdev display dma-buf operation > > On Thu, 3 Aug 2017 03:17:09 + > "Zhang, Tina" wrote: > > > > -Original Message- > > > From: dri-devel [mailto:dri-devel-boun...@lists.freedesktop.org] On > > > Behalf Of Alex Williamson > > > Sent: Wednesday, August 2, 2017 5:18 AM > > > To: Zhang, Tina > > > Cc: Tian, Kevin ; kra...@redhat.com; intel- > > > g...@lists.freedesktop.org; Wang, Zhi A ; > > > kwankh...@nvidia.com; dri-devel@lists.freedesktop.org; intel-gvt- > > > d...@lists.freedesktop.org; Lv, Zhiyuan > > > Subject: Re: [PATCH v13 5/7] vfio: ABI for mdev display dma-buf > > > operation > > > > > > On Tue, 25 Jul 2017 17:28:18 +0800 > > > Tina Zhang wrote: > > > > > > > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user mode > > > > query and get the plan and its related information. > > > > > > > > The dma-buf's life cycle is handled by user mode and tracked by kernel. > > > > The returned fd in struct vfio_device_query_gfx_plane can be a new > > > > fd or an old fd of a re-exported dma-buf. Host User mode can check > > > > the value of fd and to see if it needs to create new resource > > > > according to the new fd or just use the existed resource related to the > > > > old > fd. > > > > > > > > Signed-off-by: Tina Zhang > > > > --- > > > > include/uapi/linux/vfio.h | 28 > > > > 1 file changed, 28 insertions(+) > > > > > > > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > > > > index ae46105..827a230 100644 > > > > --- a/include/uapi/linux/vfio.h > > > > +++ b/include/uapi/linux/vfio.h > > > > @@ -502,6 +502,34 @@ struct vfio_pci_hot_reset { > > > > > > > > #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + > > > 13) > > > > > > > > +/** > > > > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + > 14, > > > > +struct vfio_device_query_gfx_plane) > > > > + * > > > > + * Set the drm_plane_type and retrieve information about the gfx plane. > > > > + * > > > > + * Return: 0 on success, -errno on failure. > > > > + */ > > > > +struct vfio_device_gfx_plane_info { > > > > + __u32 argsz; > > > > + __u32 flags; > > > > + /* in */ > > > > + __u32 drm_plane_type; /* type of plane: DRM_PLANE_TYPE_* */ > > > > + /* out */ > > > > + __u32 drm_format; /* drm format of plane */ > > > > + __u64 drm_format_mod; /* tiled mode */ > > > > + __u32 width;/* width of plane */ > > > > + __u32 height; /* height of plane */ > > > > + __u32 stride; /* stride of plane */ > > > > + __u32 size; /* size of plane in bytes, align on page*/ > > > > + __u32 x_pos;/* horizontal position of cursor plane, upper > > > > left corner > > > in pixels */ > > > > + __u32 y_pos;/* vertical position of cursor plane, upper > > > > left corner in > > > lines*/ > > > > + __u32 region_index; > > > > + __s32 fd; /* dma-buf fd */ > > > > > > How do I know which of these is valid, region_index or fd? Can I > > > ask for one vs the other? What are the errno values to > > > differentiate unsupported vs not initialized? Is there a "probe" > > > flag that I can use to determine what the device supports without > > > allocating > those resources yet? > > Dma-buf won't use region_index, which means region_index is zero all the > time for dma-buf usage. > > As we discussed, there won't be errno if not initialized, just keep all > > fields zero. > > I will add the comments about these in the next version. Thanks > > Zero is a valid region index. If zero is valid, can we find out other invalid value? How about 0x? Tina ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102016] build error - pipe_r300.c:12:39: error: ‘flags’ undeclared (first use in this function)
https://bugs.freedesktop.org/show_bug.cgi?id=102016 Fabio Pedretti changed: What|Removed |Added Assignee|dri-devel@lists.freedesktop |mesa-dev@lists.freedesktop. |.org|org QA Contact|dri-devel@lists.freedesktop |mesa-dev@lists.freedesktop. |.org|org CC||mar...@gmail.com, ||nhaeh...@gmail.com -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102014] Mesa git build broken by commit bc7f41e11d325280db12e7b9444501357bc13922
https://bugs.freedesktop.org/show_bug.cgi?id=102014 Vinson Lee changed: What|Removed |Added CC||pedretti.fa...@gmail.com --- Comment #6 from Vinson Lee --- *** Bug 102016 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/bridge/sii8620: add remote control support
MHL specification defines Remote Control Protocol(RCP) to send input events between MHL devices. The driver now recognizes RCP messages and reacts to them by reporting key events to input subsystem, allowing a user to control a device using TV remote control. Signed-off-by: Maciej Purski --- drivers/gpu/drm/bridge/sil-sii8620.c | 188 ++- include/drm/bridge/mhl.h | 4 + 2 files changed, 187 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 2d51a22..7e75f2f 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,7 @@ enum sii8620_mt_state { struct sii8620 { struct drm_bridge bridge; struct device *dev; + struct input_dev *rcp_input_dev; struct clk *clk_xtal; struct gpio_desc *gpio_reset; struct gpio_desc *gpio_int; @@ -106,6 +108,82 @@ struct sii8620_mt_msg { sii8620_cb continuation; }; +static struct { + u16 key; + u16 extra_key; + bool autorepeat; +} rcp_keymap[] = { + [0x00] = { KEY_SELECT }, + [0x01] = { KEY_UP, 0, true }, + [0x02] = { KEY_DOWN, 0, true }, + [0x03] = { KEY_LEFT, 0, true }, + [0x04] = { KEY_RIGHT, 0, true }, + + [0x05] = { KEY_RIGHT, KEY_UP, true }, + [0x06] = { KEY_RIGHT, KEY_DOWN, true }, + [0x07] = { KEY_LEFT, KEY_UP, true }, + [0x08] = { KEY_LEFT, KEY_DOWN, true }, + + [0x09] = { KEY_MENU }, + [0x0A] = { KEY_UNKNOWN }, + [0x0B] = { KEY_UNKNOWN }, + [0x0C] = { KEY_BOOKMARKS }, + [0x0D] = { KEY_EXIT }, + + [0x20] = { KEY_NUMERIC_0 }, + [0x21] = { KEY_NUMERIC_1 }, + [0x22] = { KEY_NUMERIC_2 }, + [0x23] = { KEY_NUMERIC_3 }, + [0x24] = { KEY_NUMERIC_4 }, + [0x25] = { KEY_NUMERIC_5 }, + [0x26] = { KEY_NUMERIC_6 }, + [0x27] = { KEY_NUMERIC_7 }, + [0x28] = { KEY_NUMERIC_8 }, + [0x29] = { KEY_NUMERIC_9 }, + + [0x2A] = { KEY_DOT }, + [0x2B] = { KEY_ENTER }, + [0x2C] = { KEY_CLEAR }, + + [0x30] = { KEY_CHANNELUP, 0, true }, + [0x31] = { KEY_CHANNELDOWN, 0, true }, + + [0x33] = { KEY_SOUND }, + [0x35] = { KEY_PROGRAM }, /* Show Information */ + + [0x37] = { KEY_PAGEUP, 0, true }, + [0x38] = { KEY_PAGEDOWN, 0, true }, + + [0x41] = { KEY_VOLUMEUP, 0, true }, + [0x42] = { KEY_VOLUMEDOWN, 0, true }, + [0x43] = { KEY_MUTE }, + [0x44] = { KEY_PLAY }, + [0x45] = { KEY_STOP }, + [0x46] = { KEY_PLAYPAUSE }, /* Pause */ + [0x47] = { KEY_RECORD }, + [0x48] = { KEY_REWIND, 0, true }, + [0x49] = { KEY_FASTFORWARD, 0, true }, + [0x4A] = { KEY_EJECTCD }, + [0x4B] = { KEY_NEXTSONG, 0, true }, /* Forward */ + [0x4C] = { KEY_PREVIOUSSONG, 0, true }, /* Backward */ + + [0x60] = { KEY_PLAYPAUSE }, /* Play */ + [0x61] = { KEY_PLAYPAUSE }, /* Pause the Play */ + [0x62] = { KEY_RECORD }, + [0x63] = { KEY_PAUSE }, + [0x64] = { KEY_STOP }, + [0x65] = { KEY_MUTE }, + [0x66] = { KEY_MUTE }, /* Restore Mute */ + + [0x71] = { KEY_F1 }, + [0x72] = { KEY_F2 }, + [0x73] = { KEY_F3 }, + [0x74] = { KEY_F4 }, + [0x75] = { KEY_F5 }, + + [0x7E] = { KEY_VENDOR }, +}; + static const u8 sii8620_i2c_page[] = { 0x39, /* Main System */ 0x3d, /* TDM and HSIC */ @@ -431,6 +509,16 @@ static void sii8620_mt_rap(struct sii8620 *ctx, u8 code) sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RAP, code); } +static void sii8620_mt_rcpk(struct sii8620 *ctx, u8 code) +{ + sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RCPK, code); +} + +static void sii8620_mt_rcpe(struct sii8620 *ctx, u8 code) +{ + sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RCPE, code); +} + static void sii8620_mt_read_devcap_send(struct sii8620 *ctx, struct sii8620_mt_msg *msg) { @@ -1753,6 +1841,43 @@ static void sii8620_send_features(struct sii8620 *ctx) sii8620_write_buf(ctx, REG_MDT_XMIT_WRITE_PORT, buf, ARRAY_SIZE(buf)); } +static void sii8620_rcp_report_key(struct sii8620 *ctx, u8 keycode, bool pressed) +{ + input_report_key(ctx->rcp_input_dev, + rcp_keymap[keycode].key, pressed); + + if (rcp_keymap[keycode].extra_key) + input_report_key(ctx->rcp_input_dev, + rcp_keymap[keycode].extra_key, pressed); +} + +static bool sii8620_rcp_consume(struct sii8620 *ctx, u8 keycode) +{ + bool pressed = !(keycode & MHL_RCP_KEY_RELEASED_MASK); + + if (!ctx->rcp_input_dev) { + dev_dbg(ctx->dev, "RCP input device not initialized\n"); + return false; + } + + keycode &= MHL_RCP_KEY_ID_MASK; + if (keycode >= ARRAY_S
[PATCH 1/2] drm/bridge: add Silicon Image SiI9234 driver
SiI9234 transmitter converts eTMDS/HDMI signal to MHL 1.0. It is controlled via I2C bus. Its interaction with other devices in video pipeline is performed mainly on HW level. The only interaction it does on device driver level is filtering-out unsupported video modes, it exposes drm_bridge interface to perform this operation. This patch is based on the code refactored by Tomasz Stanislawski , which was initially developed by: Adam Hampson Erik Gilling Shankar Bandal Dharam Kumar Signed-off-by: Maciej Purski --- .../devicetree/bindings/display/bridge/sii9234.txt | 20 + drivers/gpu/drm/bridge/Kconfig |8 + drivers/gpu/drm/bridge/Makefile|1 + drivers/gpu/drm/bridge/sii9234.c | 1019 4 files changed, 1048 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/sii9234.txt create mode 100644 drivers/gpu/drm/bridge/sii9234.c diff --git a/Documentation/devicetree/bindings/display/bridge/sii9234.txt b/Documentation/devicetree/bindings/display/bridge/sii9234.txt new file mode 100644 index 000..2cdf286 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/sii9234.txt @@ -0,0 +1,20 @@ +SiI9234 Mobile HD Link Transmitter + +Required properties: +- compatible : "sil,sii9234". +- reg : I2C address for TPI interface, use 0x39 +- vcc-supply : regulator that supplies the chip +- interrupts, interrupt-parent: interrupt specifier of INT pin +- reset-gpios: gpio specifier of RESET pin + +Additional compatible properties are also allowed. + +Example: + sii9234@39 { + compatible = "sil,sii9234"; + reg = <0x39>; + vcc-supply = <&vsil>; + reset-gpios = <&gpf3 4 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&gpf3>; + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; + }; diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index adf9ae0..f5784e5 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -100,6 +100,14 @@ config DRM_TI_TFP410 ---help--- Texas Instruments TFP410 DVI/HDMI Transmitter driver +config DRM_SII9234 + tristate "Silicon Image SII9234 Driver" + depends on I2C + help + Say Y here if you want support for the MHL interface. + It is an I2C driver, that detects connection of MHL bridge + and starts encapsulation of HDMI signal. + source "drivers/gpu/drm/bridge/analogix/Kconfig" source "drivers/gpu/drm/bridge/adv7511/Kconfig" diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index defcf1e..e3d5eb0 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -6,6 +6,7 @@ obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o +obj-$(CONFIG_DRM_SII9234) += sii9234.o obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ diff --git a/drivers/gpu/drm/bridge/sii9234.c b/drivers/gpu/drm/bridge/sii9234.c new file mode 100644 index 000..9c436e7 --- /dev/null +++ b/drivers/gpu/drm/bridge/sii9234.c @@ -0,0 +1,1019 @@ +/* + * Copyright (C) 2014 Samsung Electronics + * + * Author: Tomasz Stanislawski + * + * Based on sii9234 driver created by: + *Adam Hampson + *Erik Gilling + *Shankar Bandal + *Dharam Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program + * + */ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* MHL Tx registers and bits */ +#define MHL_TX_SRST 0x05 +#define MHL_TX_SYSSTAT_REG 0x09 +#define MHL_TX_INTR1_REG0x71 +#define MHL_TX_INTR4_REG0x74 +#define MHL_TX_INTR1_ENABLE_REG 0x75 +#define MHL_TX_INTR4_ENABLE_REG 0x78 +#define MHL_TX_INT_CTRL_REG 0x79 +#define MHL_TX_TMDS_CCTRL 0x80 +#define MHL_TX_DISC_CTRL1_REG 0x90 +#define MHL_TX_DISC_CTRL2_REG 0x91 +#define MHL_TX_DISC_CTRL3_REG 0x92 +#
[PATCH 2/2] ARM: dts: exynos: Add HDMI and Sil9234 to Trats2 board
This patch adds HDMI and Sil9234 MHL converter to Trats2 board. Based on previous work by: Tomasz Stanislawski Signed-off-by: Maciej Purski --- arch/arm/boot/dts/exynos4412-trats2.dts | 93 + 1 file changed, 93 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 35e9b94..39940f6 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -97,6 +97,16 @@ gpio = <&gpj0 5 GPIO_ACTIVE_HIGH>; enable-active-high; }; + + vsil: voltage-regulator-vsil { + compatible = "regulator-fixed"; + regulator-name = "HDMI_5V"; + regulator-min-microvolt = <500>; + regulator-max-microvolt = <500>; + gpio = <&gpl0 4 GPIO_ACTIVE_HIGH>; + enable-active-high; + vin-supply = <&buck7_reg>; + }; }; gpio-keys { @@ -229,6 +239,34 @@ }; }; + i2c-mhl { + compatible = "i2c-gpio"; + gpios = <&gpf0 4 GPIO_ACTIVE_HIGH &gpf0 6 GPIO_ACTIVE_HIGH>; + i2c-gpio,delay-us = <100>; + #address-cells = <1>; + #size-cells = <0>; + + pinctrl-0 = <&i2c_mhl_bus>; + pinctrl-names = "default"; + status = "okay"; + + sii9234: sii9234@39 { + compatible = "sil,sii9234"; + vcc-supply = <&vsil>; + reset-gpios = <&gpf3 4 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&gpf3>; + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x39>; + + + port { + mhl_to_hdmi: endpoint { + remote-endpoint = <&hdmi_to_mhl>; + }; + }; + }; + }; + camera: camera { pinctrl-0 = <&cam_port_a_clk_active &cam_port_b_clk_active>; pinctrl-names = "default"; @@ -522,6 +560,31 @@ status = "okay"; }; +&hdmi { + hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&hdmi_hpd>; + hdmi-en-supply = <&vsil>; + vdd-supply = <&ldo3_reg>; + vdd_osc-supply = <&ldo4_reg>; + vdd_pll-supply = <&ldo3_reg>; + ddc = <&i2c_5>; + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + hdmi_to_mhl: endpoint { + remote-endpoint = <&mhl_to_hdmi>; + }; + }; + }; + +}; + &hsotg { vusb_d-supply = <&ldo15_reg>; vusb_a-supply = <&ldo12_reg>; @@ -600,6 +663,11 @@ }; }; + +&i2c_5 { + status = "okay"; +}; + &i2c_7 { samsung,i2c-sda-delay = <100>; samsung,i2c-slave-addr = <0x10>; @@ -894,12 +962,20 @@ }; }; +&i2c_8 { + status = "okay"; +}; + &i2s0 { pinctrl-0 = <&i2s0_bus>; pinctrl-names = "default"; status = "okay"; }; +&mixer { + status = "okay"; +}; + &mshc_0 { num-slots = <1>; broken-cd; @@ -926,6 +1002,18 @@ pinctrl-names = "default"; pinctrl-0 = <&sleep0>; + mhl_int: mhl-int { + samsung,pins = "gpf3-5"; + samsung,pin-pud = <0>; + }; + + i2c_mhl_bus: i2c-mhl-bus { + samsung,pins = "gpf0-4", "gpf0-6"; + samsung,pin-function = <2>; + samsung,pin-pud = <1>; + samsung,pin-drv = <0>; + }; + sleep0: sleep-states { PIN_SLP(gpa0-0, INPUT, NONE); PIN_SLP(gpa0-1, OUT0, NONE); @@ -1029,6 +1117,11 @@ pinctrl-names = "default"; pinctrl-0 = <&sleep1>; + hdmi_hpd: hdmi-hpd { + samsung,pins = "gpx3-7"; + samsung,pin-pud = ; + }; + sleep1: sleep-states { PIN_SLP(gpk0-0, PREV, NONE); PIN_SLP(gpk0-1, PREV, NONE); -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/2] add Silicon Image SiI9234 driver
Hi everyone, These patches are a continuation of work by Tomasz Stanislawski on sii9324 driver, which was described in th following letter: https://lists.freedesktop.org/archives/dri-devel/2014-April/057481.html The main differences from the previous code are: * driver moved to /gpu/drm/bridge/ and integrated with drm/bridge subsystem * added filtering-out unsupported display modes * changed gpio interface to up-to-date * changed interrupt handling * improve code style * add hdmi and sii9324 to exynos4412-trats2 device tree All comments are welcome. Regards, Maciej Purski Patch summary: Maciej Purski (2): drm/bridge: add Silicon Image SiI9234 driver ARM: dts: exynos: Add HDMI and Sil9234 to Trats2 board .../devicetree/bindings/display/bridge/sii9234.txt | 20 + arch/arm/boot/dts/exynos4412-trats2.dts| 93 ++ drivers/gpu/drm/bridge/Kconfig |8 + drivers/gpu/drm/bridge/Makefile|1 + drivers/gpu/drm/bridge/sii9234.c | 1019 5 files changed, 1141 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/sii9234.txt create mode 100644 drivers/gpu/drm/bridge/sii9234.c -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 6/6] drm/i915: Add support for CCS modifiers
On Wed, Aug 2, 2017 at 5:43 PM, Ben Widawsky wrote: > On 17-08-02 12:14:15, Daniel Vetter wrote: >> >> On Tue, Aug 01, 2017 at 09:14:50AM -0700, Ben Widawsky wrote: >>> >>> On 17-07-31 10:29:55, Daniel Vetter wrote: >>> > On Sat, Jul 29, 2017 at 09:25:50AM -0700, Ben Widawsky wrote: >>> > > On 17-07-29 13:53:10, Daniel Stone wrote: >>> > > > Hi Ben, >>> > > > >>> > > > On 26 July 2017 at 19:08, Ben Widawsky wrote: >>> > > > > + } else if (INTEL_GEN(dev_priv) >= 9) { >>> > > > > intel_primary_formats = skl_primary_formats; >>> > > > > num_formats = ARRAY_SIZE(skl_primary_formats); >>> > > > > - modifiers = skl_format_modifiers; >>> > > > > + if (pipe >= PIPE_C) >>> > > > > + modifiers = skl_format_modifiers_ccs; >>> > > > > + else >>> > > > > + modifiers = skl_format_modifiers_noccs; >>> > > > >>> > > > Shouldn't that be (pipe < PIPE_C)? >>> > > > >>> > > > Cheers, >>> > > > Daniel >>> > > >>> > > Yep. It was wrong in v7 too :/. I have it fixed locally. >>> > >>> > Shouldn't the igt catch this, or does it not try to exercise all the >>> > plane/crtc combos there are? >>> > -Daniel >>> >>> I don't know whether or not IGT should have caught this, but it wouldn't >>> have >>> because I had been sending these without Ville's patches, so my patches >>> alone >>> don't even build (since his patches defined the modifiers). >> >> >> You can run igt testcases locally. I expect you to do that, at least for >> the stuff you're touching. >> >> Does this mean there's no igts for this at all? >> -Daniel > > > I haven't been running IGT locally, so I don't know if they touch this path. > We've done all testing so far with kmscube, X, and weston; then measure the > overall bandwidth. In this case, I'd stop testing these since Jason/Daniel > took > over my other patches. I don't even know how to locally make sure I get a > display on pipe C. > > You could easily make an IGT make sure that you get back the right list of > modifiers for a given pipe on a given GEN. Probably should do one. That's not a terribly interesting testcase (we have none of this kind I think). But I thought there was a CCS igt that created some simple compressed buffers and tried to display them, and then checked it all looked good using crcs, i.e. an actual functional testcase, and that should have caught the mislisten on pipe C (if it bothered to test all planes that expose the CCS modifier). Iirc Ville had that. We do need that for merging the kernel side. Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102014] Mesa git build broken by commit bc7f41e11d325280db12e7b9444501357bc13922
https://bugs.freedesktop.org/show_bug.cgi?id=102014 Marko changed: What|Removed |Added Attachment #133196|0 |1 is obsolete|| Attachment #133197|0 |1 is obsolete|| Attachment #133198|0 |1 is obsolete|| --- Comment #7 from Marko --- Created attachment 133223 --> https://bugs.freedesktop.org/attachment.cgi?id=133223&action=edit Fixes build for current Mesa-git Hi guys, I've generated a single patch which currently builds successfully on commit d5ba75f8881f0869dc16f71f7395514c0a35b6e2 Ragards, Marko -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/bridge/sii8620: add remote control support
Hi Maciej, Unfortunately I do not have the MHL spec, but I was wondering what the relationship between RCP and CEC is. CEC has remote control support as well, so is RCP that subset of the CEC specification or is it completely separate? I'm CC-ing Sean Young and the linux-media mailinglist as well since Sean maintains the rc subsystem. Which you probably should use, but I'm not the expert on that. Regards, Hans On 08/03/17 09:44, Maciej Purski wrote: > MHL specification defines Remote Control Protocol(RCP) to > send input events between MHL devices. > The driver now recognizes RCP messages and reacts to them > by reporting key events to input subsystem, allowing > a user to control a device using TV remote control. > > Signed-off-by: Maciej Purski > --- > drivers/gpu/drm/bridge/sil-sii8620.c | 188 > ++- > include/drm/bridge/mhl.h | 4 + > 2 files changed, 187 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c > b/drivers/gpu/drm/bridge/sil-sii8620.c > index 2d51a22..7e75f2f 100644 > --- a/drivers/gpu/drm/bridge/sil-sii8620.c > +++ b/drivers/gpu/drm/bridge/sil-sii8620.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -58,6 +59,7 @@ enum sii8620_mt_state { > struct sii8620 { > struct drm_bridge bridge; > struct device *dev; > + struct input_dev *rcp_input_dev; > struct clk *clk_xtal; > struct gpio_desc *gpio_reset; > struct gpio_desc *gpio_int; > @@ -106,6 +108,82 @@ struct sii8620_mt_msg { > sii8620_cb continuation; > }; > > +static struct { > + u16 key; > + u16 extra_key; > + bool autorepeat; > +} rcp_keymap[] = { > + [0x00] = { KEY_SELECT }, > + [0x01] = { KEY_UP, 0, true }, > + [0x02] = { KEY_DOWN, 0, true }, > + [0x03] = { KEY_LEFT, 0, true }, > + [0x04] = { KEY_RIGHT, 0, true }, > + > + [0x05] = { KEY_RIGHT, KEY_UP, true }, > + [0x06] = { KEY_RIGHT, KEY_DOWN, true }, > + [0x07] = { KEY_LEFT, KEY_UP, true }, > + [0x08] = { KEY_LEFT, KEY_DOWN, true }, > + > + [0x09] = { KEY_MENU }, > + [0x0A] = { KEY_UNKNOWN }, > + [0x0B] = { KEY_UNKNOWN }, > + [0x0C] = { KEY_BOOKMARKS }, > + [0x0D] = { KEY_EXIT }, > + > + [0x20] = { KEY_NUMERIC_0 }, > + [0x21] = { KEY_NUMERIC_1 }, > + [0x22] = { KEY_NUMERIC_2 }, > + [0x23] = { KEY_NUMERIC_3 }, > + [0x24] = { KEY_NUMERIC_4 }, > + [0x25] = { KEY_NUMERIC_5 }, > + [0x26] = { KEY_NUMERIC_6 }, > + [0x27] = { KEY_NUMERIC_7 }, > + [0x28] = { KEY_NUMERIC_8 }, > + [0x29] = { KEY_NUMERIC_9 }, > + > + [0x2A] = { KEY_DOT }, > + [0x2B] = { KEY_ENTER }, > + [0x2C] = { KEY_CLEAR }, > + > + [0x30] = { KEY_CHANNELUP, 0, true }, > + [0x31] = { KEY_CHANNELDOWN, 0, true }, > + > + [0x33] = { KEY_SOUND }, > + [0x35] = { KEY_PROGRAM }, /* Show Information */ > + > + [0x37] = { KEY_PAGEUP, 0, true }, > + [0x38] = { KEY_PAGEDOWN, 0, true }, > + > + [0x41] = { KEY_VOLUMEUP, 0, true }, > + [0x42] = { KEY_VOLUMEDOWN, 0, true }, > + [0x43] = { KEY_MUTE }, > + [0x44] = { KEY_PLAY }, > + [0x45] = { KEY_STOP }, > + [0x46] = { KEY_PLAYPAUSE }, /* Pause */ > + [0x47] = { KEY_RECORD }, > + [0x48] = { KEY_REWIND, 0, true }, > + [0x49] = { KEY_FASTFORWARD, 0, true }, > + [0x4A] = { KEY_EJECTCD }, > + [0x4B] = { KEY_NEXTSONG, 0, true }, /* Forward */ > + [0x4C] = { KEY_PREVIOUSSONG, 0, true }, /* Backward */ > + > + [0x60] = { KEY_PLAYPAUSE }, /* Play */ > + [0x61] = { KEY_PLAYPAUSE }, /* Pause the Play */ > + [0x62] = { KEY_RECORD }, > + [0x63] = { KEY_PAUSE }, > + [0x64] = { KEY_STOP }, > + [0x65] = { KEY_MUTE }, > + [0x66] = { KEY_MUTE }, /* Restore Mute */ > + > + [0x71] = { KEY_F1 }, > + [0x72] = { KEY_F2 }, > + [0x73] = { KEY_F3 }, > + [0x74] = { KEY_F4 }, > + [0x75] = { KEY_F5 }, > + > + [0x7E] = { KEY_VENDOR }, > +}; > + > static const u8 sii8620_i2c_page[] = { > 0x39, /* Main System */ > 0x3d, /* TDM and HSIC */ > @@ -431,6 +509,16 @@ static void sii8620_mt_rap(struct sii8620 *ctx, u8 code) > sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RAP, code); > } > > +static void sii8620_mt_rcpk(struct sii8620 *ctx, u8 code) > +{ > + sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RCPK, code); > +} > + > +static void sii8620_mt_rcpe(struct sii8620 *ctx, u8 code) > +{ > + sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RCPE, code); > +} > + > static void sii8620_mt_read_devcap_send(struct sii8620 *ctx, > struct sii8620_mt_msg *msg) > { > @@ -1753,6 +1841,43 @@ static void sii8620_send_features(struct sii8620 *ctx) > sii8620_write_buf(ctx, REG_MDT_XMIT_WRITE_PORT, buf, ARRAY_SIZE(buf)); > } > > +static void sii8620_rcp_report_key(struct sii8620 *ctx, u8 keycode, bool > pressed) > +{ > + input_report_key(ctx->rcp_
[PATCH] drm: exynos: Add driver for HDMI audio interface
The hdmi-codec interface added in this patch is required to properly support HDMI audio. Currently the audio part of the SoC internal HDMI transmitter is configured with fixed values, which makes HDMI audio working by chance, only on boards equipped with external audio codec connected in parallel with the HDMI audio transmitter I2S input interface. Signed-off-by: Sylwester Nawrocki --- Changes since RFC version: - fixed hdmi-codec locking issue - added a comment documenting struct hdmi_contex::mutex --- drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_hdmi.c | 226 +-- 2 files changed, 193 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 1d18534..a6edbb6 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -3,6 +3,7 @@ config DRM_EXYNOS depends on OF && DRM && (ARCH_S3C64XX || ARCH_EXYNOS || ARCH_MULTIPLATFORM) select DRM_KMS_HELPER select VIDEOMODE_HELPERS + select SND_SOC_HDMI_CODEC if SND_SOC help Choose this option if you have a Samsung SoC EXYNOS chipset. If M is selected the module will be called exynosdrm. diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 06bfbe4..64eadf58 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -40,7 +40,7 @@ #include #include #include - +#include #include #include @@ -111,12 +111,19 @@ struct hdmi_driver_data { struct string_array_spec clk_muxes; }; +struct hdmi_audio { + struct platform_device *pdev; + struct hdmi_audio_infoframe infoframe; + unsigned int sample_rate; + unsigned int sample_width; + u8 enable; +}; + struct hdmi_context { struct drm_encoder encoder; struct device *dev; struct drm_device *drm_dev; struct drm_connectorconnector; - boolpowered; booldvi_mode; struct delayed_work hotplug_work; struct drm_display_mode current_mode; @@ -137,6 +144,11 @@ struct hdmi_context { struct regulator*reg_hdmi_en; struct exynos_drm_clk phy_clk; struct drm_bridge *bridge; + + /* mutex protecting subsequent fields below */ + struct mutexmutex; + struct hdmi_audio audio; + boolpowered; }; static inline struct hdmi_context *encoder_to_hdmi(struct drm_encoder *e) @@ -768,6 +780,22 @@ static int hdmi_clk_set_parents(struct hdmi_context *hdata, bool to_phy) return ret; } +static int hdmi_audio_infoframe_apply(struct hdmi_context *hdata) +{ + struct hdmi_audio_infoframe *infoframe = &hdata->audio.infoframe; + u8 buf[HDMI_INFOFRAME_SIZE(AUDIO)]; + int len; + + len = hdmi_audio_infoframe_pack(infoframe, buf, sizeof(buf)); + if (len < 0) + return len; + + hdmi_reg_writeb(hdata, HDMI_AUI_CON, HDMI_AUI_CON_EVERY_VSYNC); + hdmi_reg_write_buf(hdata, HDMI_AUI_HEADER0, buf, len); + + return 0; +} + static void hdmi_reg_infoframes(struct hdmi_context *hdata) { union hdmi_infoframe frm; @@ -805,15 +833,7 @@ static void hdmi_reg_infoframes(struct hdmi_context *hdata) hdmi_reg_write_buf(hdata, HDMI_VSI_DATA(0), buf + 3, ret - 3); } - ret = hdmi_audio_infoframe_init(&frm.audio); - if (!ret) { - frm.audio.channels = 2; - ret = hdmi_audio_infoframe_pack(&frm.audio, buf, sizeof(buf)); - } - if (ret > 0) { - hdmi_reg_writeb(hdata, HDMI_AUI_CON, HDMI_AUI_CON_EVERY_VSYNC); - hdmi_reg_write_buf(hdata, HDMI_AUI_HEADER0, buf, ret); - } + hdmi_audio_infoframe_apply(hdata); } static enum drm_connector_status hdmi_detect(struct drm_connector *connector, @@ -996,23 +1016,18 @@ static void hdmi_reg_acr(struct hdmi_context *hdata, u32 freq) hdmi_reg_writeb(hdata, HDMI_ACR_CON, 4); } -static void hdmi_audio_init(struct hdmi_context *hdata) +static void hdmi_audio_config(struct hdmi_context *hdata) { - u32 sample_rate, bits_per_sample; - u32 data_num, bit_ch, sample_frq; - u32 val; + u32 data_num, sample_freq, val; + u32 bit_ch = 1; - sample_rate = 44100; - bits_per_sample = 16; - switch (bits_per_sample) { + switch (hdata->audio.sample_width) { case 20: data_num = 2; - bit_ch = 1; break; case 24: data_num = 3; - bit_ch = 1; break; default: data_num = 1; @@ -1020,7 +1035,7 @@ static void hdmi_audio_init(str
[Bug 62541] Kernel oops/panic during system boot with systemd - "Unable to handle kernel NULL pointer dereference"
https://bugzilla.kernel.org/show_bug.cgi?id=62541 Jani Nikula (jani.nik...@intel.com) changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |OBSOLETE -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 102014] Mesa git build broken by commit bc7f41e11d325280db12e7b9444501357bc13922
https://bugs.freedesktop.org/show_bug.cgi?id=102014 --- Comment #8 from Andy Furniss --- Also see this thread = there are more fixes needed to avoid issues after the build is fixed. https://lists.freedesktop.org/archives/mesa-dev/2017-August/165195.html -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 0/6] Support for LEGO MINDSTORMS EV3 LCD display
On Wed, Aug 02, 2017 at 11:05:58AM -0500, David Lechner wrote: > On 08/02/2017 03:05 AM, Noralf Trønnes wrote: > > > > Den 02.08.2017 00.26, skrev David Lechner: > > > On 08/01/2017 01:08 PM, Noralf Trønnes wrote: > > > > (cc: Daniel Vetter) > > > > > > > > > > > > Den 01.08.2017 18.51, skrev David Lechner: > > > > > On 07/30/2017 12:14 PM, Noralf Trønnes wrote: > > > > > > > > > > > > Den 29.07.2017 21.40, skrev David Lechner: > > > > > > > On 07/29/2017 02:17 PM, David Lechner wrote: > > > > > > > > The goal of this series is to get the built-in > > > > > > > > LCD of the LEGO MINDSTORMS EV3 > > > > > > > > working. But, most of the content here is > > > > > > > > building up the infrastructure to do > > > > > > > > that. > > > > > > > > > > > > > > > > > > > > > > Some general comments/questions: > > > > > > > > > > > > > > I have noticed that DRM doesn't really have support > > > > > > > for monochrome displays. I'm guessing that is > > > > > > > because no one really uses them anymore? > > > > > > > > > > > > > > > > > > > The repaper driver was the first monochrome drm driver and I chose > > > > > > to > > > > > > present it to userspace as XRGB and convert it to monochrome. > > > > > > The reason for this is that everything, libraries, apps, > > > > > > plymouth (boot > > > > > > splash, no rgb565) supports it. I didn't see any point in adding a > > > > > > new > > > > > > monochrome drm format that didn't have, or probably wouldn't get > > > > > > userspace support (by libraries at least). The application of course > > > > > > needs to know this to get a good result. > > > > > > > > > > > > tinydrm_xrgb_to_gray8() does the conversion: > > > > > > https://cgit.freedesktop.org/drm/drm-misc/commit/drivers/gpu/drm/tinydrm?id=379ea9a1a59a5a32c8db6f164e80a3fd00cb3781 > > > > > > > > > > > > > > > > > > > The LEGO EV3 display is just an LCD (not the backlit > > > > > > > kind). It has two modes of operation. It can to 2bbp > > > > > > > grayscale or it can do 1bpp monochrome. The > > > > > > > grayscale isn't the best (looks splotchy in places), > > > > > > > so it would be nice to be able to choose between > > > > > > > these two modes. How would I implement something > > > > > > > like that? > > > > > > > > > > > > > > > > > > > Do you expect anyone to use grayscale if it doesn't look good? > > > > > > Maybe better to add it later if there's a demand for it. > > > > > > > > > > I don't expect many people to use it at all. The people that > > > > > do will be hackers like me that want to see what it is > > > > > capable of, so I think I will keep it grayscale by default. > > > > > > > > > > > > > It looks like the best way to satisfy your needs is to add > > > > specific formats. > > > > > > > > Video for Linux have these: > > > > > > > > include/uapi/linux/videodev2.h > > > > > > > > /* Grey formats */ > > > > #define V4L2_PIX_FMT_GREYv4l2_fourcc('G', 'R', 'E', 'Y') /* > > > > 8 Greyscale */ > > > > #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* > > > > 4 Greyscale */ > > > > #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* > > > > 6 Greyscale */ > > > > #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* > > > > 10 Greyscale */ > > > > #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* > > > > 12 Greyscale */ > > > > #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* > > > > 16 Greyscale */ > > > > #define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') > > > > /* 16 Greyscale BE */ > > > > > > > > > > > > Maybe we can add formats like these: > > > > > > > > include/uapi/drm/drm_fourcc.h > > > > > > > > #define DRM_FORMAT_MONOfourcc_code('Y', '0', '1', ' ') > > > > /* [0] Monochrome */ > > > > or > > > > #define DRM_FORMAT_Y1fourcc_code('Y', '0', '1', ' ') /* > > > > [0] Monochrome */ > > > > > > > > #define DRM_FORMAT_Y2fourcc_code('Y', '0', '2', ' ') /* > > > > [1:0] Greyscale */ > > > > > > > > Daniel, what do you think? > > > > > > 2 of the first 3 tinydrm drivers are monochrome (and I would like to > > > write a driver for the Seeed/Grove I2C OLED displays which are also > > > monochrome), so I think the 1bpp modes would definitely be useful. I > > > think there is enough userspace code still around that knows about > > > FB_VISUAL_MONO01 and FB_VISUAL_MONO10 that could use these. > > > > > > > Can you elaborate, would you use the display trough monochrome fbdev > > or through drm? > > I have a small collection of programs and libraries that work using > monochrome fbdev. I would like to just keep using them without having to > convert everything to drm. That probably means we'd need to extend fbdev emulation helpers in drm to support Monochrome modes better. Shouldn't be that much work really. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-
Re: [PATCH] drm/fb-helper: pass physical dimensions to fbdev
On Wed, Aug 02, 2017 at 08:37:56PM -0500, David Lechner wrote: > On 08/02/2017 06:28 PM, Daniel Vetter wrote: > > On Wed, Aug 2, 2017 at 6:37 PM, David Lechner wrote: > > > On 08/02/2017 04:46 AM, Daniel Vetter wrote: > > > > > > > > On Tue, Aug 01, 2017 at 10:26:41AM -0500, David Lechner wrote: > > > > > > > > > > The fbdev subsystem has a place for physical dimensions (width and > > > > > height > > > > > in mm) that is readable by userspace. Since DRM also knows these > > > > > dimensions, pass this information to the fbdev device. > > > > > > > > > > Signed-off-by: David Lechner > > > > > > > > > > > > Still in the wrong function. Also please add some notation about what > > > > you > > > > changed when resubmitting a patch (it took me a while to remember that I > > > > replied to you already). That makes patch reviewing more efficient. > > > > > > > > > > Sorry for being so dense. :-/ > > > > > > I did read your first reply at least 10 times. All of the terminology is > > > foreign to me, but after sleeping on it a few days, I think it is slowly > > > soaking into my brain. > > > > No problem, the code is fairly convoluted. One more question on your > > v3: From reading fbdev code I don't see any place that overwrites the > > physical dimensions except the fill_var helper function (which is > > called deep down from register_framebuffer). If we entirely remove the > > var.width/height assignments from that (including the -1 default) and > > move all of it into setup_crtcs, would that work? > > > I tried that, but in my case, drm_setup_crtcs() is only called once before > the fbdev is allocated. So, I got a kernel oops from dereferencing a null > pointer, which is why there is a null check for fb_helper->fbdev as part of > the if statement I added there. Since drm_setup_crtcs() is not called again, > the var.width and height are never set. fb_helper->fbdev is allocated in drm_fb_helper_alloc_fbi, which /should/ be called as the very first thing in setting up the entire fbdev stuff. If you're oopsing on that, something went wrong. We also set info->var in a few other places before calling register_framebuffer already (see the line that sets info->var.pixclock right before calling register_framebuffer). > I also noticed that there is another similar workaround/code duplication for > the framebuffer not being allocated in the first call to drm_setup_crtcs() > seen at the end of drm_fb_helper_single_fb_probe(). > > > > > I kinda don't like have the same logic in 2 completely different > > places, once for driver load and once for hotplug handling. That tends > > to cause bugs (because then no one bothers to test hotplug handling or > > the boot-up case properly). > > > > Would it be possible to split drm_setup_crtcs() into two functions, a top > half and a bottom half. During init (pseudo-code)... > > drm_begin_setup_crtcs() > drm_fb_helper_single_fb_probe() > drm_finish_setup_crtcs() > > and during hotplug event, just... > > drm_begin_setup_crtcs() > drm_finish_crtcs_bottom_half() > > I think it could solve both cases. I'm still not following where exactly and how you're blowing up. Can pls paste the backtrace of how that all blows up? Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/fb: Fix pointer dereference before null check.
On Wed, Aug 02, 2017 at 01:00:13PM -0500, David Lechner wrote: > fb_crtc is used before a null check, so move the use after the null check. > > This was just identified by inspection. I haven't actually observed a crash > here, so it is possible that the null check could be unnecessary. > > Signed-off-by: David Lechner Thanks, applied. -Daniel > --- > drivers/gpu/drm/drm_fb_helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index 2cc28f0..2d3f93e 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -2424,9 +2424,9 @@ static void drm_setup_crtcs(struct drm_fb_helper > *fb_helper, > struct drm_display_mode *mode = modes[i]; > struct drm_fb_helper_crtc *fb_crtc = crtcs[i]; > struct drm_fb_offset *offset = &offsets[i]; > - struct drm_mode_set *modeset = &fb_crtc->mode_set; > > if (mode && fb_crtc) { > + struct drm_mode_set *modeset = &fb_crtc->mode_set; > struct drm_connector *connector = > fb_helper->connector_info[i]->connector; > > -- > 2.7.4 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/fb-helper: pass physical dimensions to fbdev
On Thu, Aug 3, 2017 at 12:11 PM, Daniel Vetter wrote: > On Wed, Aug 02, 2017 at 08:37:56PM -0500, David Lechner wrote: >> On 08/02/2017 06:28 PM, Daniel Vetter wrote: >> > On Wed, Aug 2, 2017 at 6:37 PM, David Lechner wrote: >> > > On 08/02/2017 04:46 AM, Daniel Vetter wrote: >> > > > >> > > > On Tue, Aug 01, 2017 at 10:26:41AM -0500, David Lechner wrote: >> > > > > >> > > > > The fbdev subsystem has a place for physical dimensions (width and >> > > > > height >> > > > > in mm) that is readable by userspace. Since DRM also knows these >> > > > > dimensions, pass this information to the fbdev device. >> > > > > >> > > > > Signed-off-by: David Lechner >> > > > >> > > > >> > > > Still in the wrong function. Also please add some notation about what >> > > > you >> > > > changed when resubmitting a patch (it took me a while to remember that >> > > > I >> > > > replied to you already). That makes patch reviewing more efficient. >> > > > >> > > >> > > Sorry for being so dense. :-/ >> > > >> > > I did read your first reply at least 10 times. All of the terminology is >> > > foreign to me, but after sleeping on it a few days, I think it is slowly >> > > soaking into my brain. >> > >> > No problem, the code is fairly convoluted. One more question on your >> > v3: From reading fbdev code I don't see any place that overwrites the >> > physical dimensions except the fill_var helper function (which is >> > called deep down from register_framebuffer). If we entirely remove the >> > var.width/height assignments from that (including the -1 default) and >> > move all of it into setup_crtcs, would that work? >> >> >> I tried that, but in my case, drm_setup_crtcs() is only called once before >> the fbdev is allocated. So, I got a kernel oops from dereferencing a null >> pointer, which is why there is a null check for fb_helper->fbdev as part of >> the if statement I added there. Since drm_setup_crtcs() is not called again, >> the var.width and height are never set. > > fb_helper->fbdev is allocated in drm_fb_helper_alloc_fbi, which /should/ > be called as the very first thing in setting up the entire fbdev stuff. > If you're oopsing on that, something went wrong. We also set info->var in > a few other places before calling register_framebuffer already (see the > line that sets info->var.pixclock right before calling > register_framebuffer). > >> I also noticed that there is another similar workaround/code duplication for >> the framebuffer not being allocated in the first call to drm_setup_crtcs() >> seen at the end of drm_fb_helper_single_fb_probe(). Ok I screwed up, alloc_fbi is called from fb_probe, which is called only from helper_single_probe(). Sorry about all my confusion, sounds like we indeed have to duplicate this. Since the duplication is necessary, can you pls extract an update_var static helper function, which is called from both places? I'd put the call in drm_fb_helper_hotplugt_event and right before the register_framebuffer for the load path, not trying to be clever like I suggested and hiding it somewhere in drm_setup_crtcs. Sorry for going all over the place with this, but fbdev isn't really something I know all that well ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/i915: add const to bin_attribute
On Wed, Aug 02, 2017 at 10:50:47PM +0530, Bhumika Goyal wrote: > Add const to bin_attribute structures as they are only passed to the > functions sysfs_{remove/create}_bin_file or > device_{remove/create}_bin_file. The corresponding arguments are of > type const, so declare the structures to be const. > > Signed-off-by: Bhumika Goyal Applied, thanks. -Daniel > --- > drivers/gpu/drm/i915/i915_sysfs.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_sysfs.c > b/drivers/gpu/drm/i915/i915_sysfs.c > index 7fcf006..d61c872 100644 > --- a/drivers/gpu/drm/i915/i915_sysfs.c > +++ b/drivers/gpu/drm/i915/i915_sysfs.c > @@ -220,7 +220,7 @@ static int l3_access_valid(struct drm_i915_private > *dev_priv, loff_t offset) > return ret; > } > > -static struct bin_attribute dpf_attrs = { > +static const struct bin_attribute dpf_attrs = { > .attr = {.name = "l3_parity", .mode = (S_IRUSR | S_IWUSR)}, > .size = GEN7_L3LOG_SIZE, > .read = i915_l3_read, > @@ -229,7 +229,7 @@ static int l3_access_valid(struct drm_i915_private > *dev_priv, loff_t offset) > .private = (void *)0 > }; > > -static struct bin_attribute dpf_attrs_1 = { > +static const struct bin_attribute dpf_attrs_1 = { > .attr = {.name = "l3_parity_slice_1", .mode = (S_IRUSR | S_IWUSR)}, > .size = GEN7_L3LOG_SIZE, > .read = i915_l3_read, > @@ -532,7 +532,7 @@ static ssize_t error_state_write(struct file *file, > struct kobject *kobj, > return count; > } > > -static struct bin_attribute error_state_attr = { > +static const struct bin_attribute error_state_attr = { > .attr.name = "error", > .attr.mode = S_IRUSR | S_IWUSR, > .size = 0, > -- > 1.9.1 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/2] drm/bridge: add Silicon Image SiI9234 driver
Hi Maciej, Thank you for the patch. On Thursday 03 Aug 2017 09:45:22 Maciej Purski wrote: > SiI9234 transmitter converts eTMDS/HDMI signal to MHL 1.0. > It is controlled via I2C bus. Its interaction with other > devices in video pipeline is performed mainly on HW level. > The only interaction it does on device driver level is > filtering-out unsupported video modes, it exposes drm_bridge > interface to perform this operation. > > This patch is based on the code refactored by Tomasz Stanislawski > , which was initially developed by: > Adam Hampson > Erik Gilling > Shankar Bandal > Dharam Kumar > > Signed-off-by: Maciej Purski > --- > .../devicetree/bindings/display/bridge/sii9234.txt | 20 + > drivers/gpu/drm/bridge/Kconfig |8 + > drivers/gpu/drm/bridge/Makefile|1 + > drivers/gpu/drm/bridge/sii9234.c | 1019 + > 4 files changed, 1048 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/display/bridge/sii9234.txt create mode > 100644 drivers/gpu/drm/bridge/sii9234.c > > diff --git a/Documentation/devicetree/bindings/display/bridge/sii9234.txt > b/Documentation/devicetree/bindings/display/bridge/sii9234.txt new file > mode 100644 > index 000..2cdf286 > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/bridge/sii9234.txt DT reviewers might ask you to submit DT bindings as a separate patch. > @@ -0,0 +1,20 @@ > +SiI9234 Mobile HD Link Transmitter > + > +Required properties: > +- compatible : "sil,sii9234". > +- reg : I2C address for TPI interface, use 0x39 > +- vcc-supply : regulator that supplies the chip Is there a single power supply only ? Transceivers usually have at least one digital and one analog power supply. > +- interrupts, interrupt-parent: interrupt specifier of INT pin > +- reset-gpios: gpio specifier of RESET pin Is this mandatory to connect the reset pin to the SoC ? You should use the OF graph DT bindings (a.k.a. ports) to describe the data connections with the rest of the system. I'm not familiar with this chip, but I assume it should have one input port connected to the SoC and one output port connected to an HDMI connector DT node. > +Additional compatible properties are also allowed. How so ? :-) > + > +Example: > + sii9234@39 { > + compatible = "sil,sii9234"; > + reg = <0x39>; > + vcc-supply = <&vsil>; > + reset-gpios = <&gpf3 4 GPIO_ACTIVE_HIGH>; > + interrupt-parent = <&gpf3>; > + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; > + }; > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig > index adf9ae0..f5784e5 100644 > --- a/drivers/gpu/drm/bridge/Kconfig > +++ b/drivers/gpu/drm/bridge/Kconfig > @@ -100,6 +100,14 @@ config DRM_TI_TFP410 > ---help--- > Texas Instruments TFP410 DVI/HDMI Transmitter driver > > +config DRM_SII9234 > + tristate "Silicon Image SII9234 Driver" > + depends on I2C You can depend on OF too as the driver doesn't currently support any other method. > + help > + Say Y here if you want support for the MHL interface. > + It is an I2C driver, that detects connection of MHL bridge > + and starts encapsulation of HDMI signal. > + > source "drivers/gpu/drm/bridge/analogix/Kconfig" > > source "drivers/gpu/drm/bridge/adv7511/Kconfig" > diff --git a/drivers/gpu/drm/bridge/Makefile > b/drivers/gpu/drm/bridge/Makefile index defcf1e..e3d5eb0 100644 > --- a/drivers/gpu/drm/bridge/Makefile > +++ b/drivers/gpu/drm/bridge/Makefile > @@ -6,6 +6,7 @@ obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o > obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o > obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o > obj-$(CONFIG_DRM_SII902X) += sii902x.o > +obj-$(CONFIG_DRM_SII9234) += sii9234.o > obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o > obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ > obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ > diff --git a/drivers/gpu/drm/bridge/sii9234.c > b/drivers/gpu/drm/bridge/sii9234.c new file mode 100644 > index 000..9c436e7 > --- /dev/null > +++ b/drivers/gpu/drm/bridge/sii9234.c > @@ -0,0 +1,1019 @@ > +/* > + * Copyright (C) 2014 Samsung Electronics > + * > + * Author: Tomasz Stanislawski > + * > + * Based on sii9234 driver created by: > + *Adam Hampson > + *Erik Gilling > + *Shankar Bandal > + *Dharam Kumar > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You
Re: [PATCH] drm: todo: Avoid accidental crossreferences
On Mon, 31 Jul 2017, Daniel Vetter wrote: > On Mon, Jul 31, 2017 at 02:42:59PM +0200, Thierry Reding wrote: >> From: Thierry Reding >> >> RST uses underscores at the end of words to create crossreferences and >> it will accidentally try to link to tinydrm_ and drm_fb_ targets from >> the TODO, which is clearly not the intention in this context. >> >> Use backslashes to escape the special meaning of the underscore. > > Yeah that's one of the things where rst gets a bit in the way of just > plain text. Another one is * at the end ... Arguably it would be reasonable to quote prefixes even in plain text. For example, reference the "tinydrm_" prefix. BR, Jani. > > Reviewed-by: Daniel Vetter > >> >> Signed-off-by: Thierry Reding >> --- >> Documentation/gpu/todo.rst | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst >> index 1ae42006deea..22af55d06ab8 100644 >> --- a/Documentation/gpu/todo.rst >> +++ b/Documentation/gpu/todo.rst >> @@ -108,8 +108,8 @@ This would be especially useful for tinydrm: >>crtc state, clear that to the max values, x/y = 0 and w/h = MAX_INT, in >>__drm_atomic_helper_crtc_duplicate_state(). >> >> -- Move tinydrm_merge_clips into drm_framebuffer.c, dropping the tinydrm_ >> - prefix ofc and using drm_fb_. drm_framebuffer.c makes sense since this >> +- Move tinydrm_merge_clips into drm_framebuffer.c, dropping the tinydrm\_ >> + prefix ofc and using drm_fb\_. drm_framebuffer.c makes sense since this >>is a function useful to implement the fb->dirty function. >> >> - Create a new drm_fb_dirty function which does essentially what e.g. >> -- >> 2.13.3 >> >> ___ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Jani Nikula, Intel Open Source Technology Center ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [maintainer-tools PATCH v2 1/2] dim: Add apply and push shorthands for current branch
On Mon, 31 Jul 2017, Thierry Reding wrote: > From: Thierry Reding > > The new apply and push commands are shorthands for applying patches to > and pushing the current branch, respectively. There's been some talk about moving further in the direction of using the current branch and current directory, like git does. I think the historical reason for having to explicitly specify the branch is to avoid shooting oneself in the foot. To avoid that oops from a quick apply and push. The safety catch. I'm not opposed, but this is the reason. One comment below. BR, Jani. > > v2: use git symbolic-ref to find current branch (Daniel Vetter) > > Signed-off-by: Thierry Reding > --- > dim | 18 ++ > dim.rst | 8 > 2 files changed, 26 insertions(+) > > diff --git a/dim b/dim > index c0cbe352b165..1422b35e2471 100755 > --- a/dim > +++ b/dim > @@ -326,6 +326,11 @@ function git_fetch_helper # remote > fi > } > > +function git_current_branch > +{ > + git symbolic-ref -q --short HEAD > +} > + > function git_is_current_branch # branch > { > git branch --list $1 | grep -q '\*' > @@ -739,6 +744,11 @@ function dim_push_fixes > dim_push_branch drm-intel-fixes "$@" > } > > +function dim_push > +{ > + dim_push_branch $(git_current_branch) "$@" > +} > + > # ensure we're on branch $1, and apply patches. the rest of the arguments are > # passed to git am. > dim_alias_ab=apply-branch > @@ -930,6 +940,14 @@ function dim_apply_next_fixes > dim_apply_branch drm-intel-next-fixes "$@" > } > > +# apply patch to current branch, the rest of the arguments are passed to > +# git am > +dim_alias_am=apply > +function dim_apply > +{ > + dim_apply_branch $(git_current_branch) "$@" > +} > + > function commit_list_references > { > local commit remote log > diff --git a/dim.rst b/dim.rst > index c004c30ada17..fa9b587d73bb 100644 > --- a/dim.rst > +++ b/dim.rst > @@ -198,6 +198,10 @@ apply-queued [*git am arguments*] > **apply-branch** shorthands for *drm-intel-fixes*, *drm-intel-next-fixes*, > and > *drm-intel-next-queued* branches respectively. > > +apply [*git am arguments*] > +-- > +**apply-branch** shorthand for the current branch. > + > extract-tags *branch* [*git-rangeish*] > -- > This extracts various tags (e.g. Reviewed-by:) from emails and applies them > to the > @@ -232,6 +236,10 @@ push-queued [*git push arguments*] > **push-branch** shorthands for *drm-intel-fixes*, *drm-intel-next-fixes*, and > *drm-intel-next-queued* branches respectively. > > +push [*git push arguments*] > +--- > +**push** shorthand for the current branch. I think you mean **push-branch** shorthand. > + > rebuild-tip > --- > Rebuild and push the integration tree. -- Jani Nikula, Intel Open Source Technology Center ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 6/6] [v4] drm/i915: Add support for CCS modifiers
Hi, On 1 August 2017 at 17:58, Ben Widawsky wrote: > @@ -1240,6 +1253,19 @@ intel_sprite_plane_create(struct drm_i915_private > *dev_priv, > plane_formats = skl_plane_formats; > num_plane_formats = ARRAY_SIZE(skl_plane_formats); > modifiers = skl_plane_format_modifiers; > + } else if (INTEL_GEN(dev_priv) >= 9) { > + intel_plane->can_scale = true; > + state->scaler_id = -1; > + > + intel_plane->update_plane = skl_update_plane; > + intel_plane->disable_plane = skl_disable_plane; > + > + plane_formats = skl_plane_formats; > + num_plane_formats = ARRAY_SIZE(skl_plane_formats); > + if (pipe >= PIPE_C) if (pipe >= PIPE_C || plane >= PLANE_SPRITE1) cf. skl_check_ccs_aux_surface() which rejects CCS on anything other than PRIMARY/SPRITE0. I'll squash when pushing. Cheers, Daniel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/3] drm/msm: remove unused variable
A cleanup left behind an unused variable that we have to remove in order to avoid this harmless warning: drivers/gpu/drm/msm/adreno/a5xx_gpu.c: In function 'a5xx_zap_shader_init': drivers/gpu/drm/msm/adreno/a5xx_gpu.c:493:19: error: unused variable 'a5xx_gpu' [-Werror=unused-variable] Fixes: 8d6f08272b6f ("drm/msm: Remove uneeded platform dev members") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index ea0f6e5b3b1e..a0f69b2e593a 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -490,7 +490,6 @@ static int a5xx_zap_shader_init(struct msm_gpu *gpu) { static bool loaded; struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); - struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu); struct platform_device *pdev = gpu->pdev; int ret; -- 2.9.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/3] drm/msm: use %z format modifier for printing size_t
The return type of ARRAY_SIZE() is size_t, so we have to use %zu instead of %lu to avoid this warning: drivers/gpu/drm/msm/msm_gpu.c: In function 'msm_gpu_init': drivers/gpu/drm/msm/msm_gpu.c:742:31: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=] The warning it otherwise harmless as size_t is always the same size as unsigned long in all supported architectures, but gcc doesn't know that. Fixes: c2fceabca6d5 ("drm/msm: Support multiple ringbuffers") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/msm_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 1e44f8893490..66af5ac334ba 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -739,7 +739,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, } if (nr_rings > ARRAY_SIZE(gpu->rb)) { - DRM_DEV_INFO_ONCE(drm->dev, "Only creating %lu ringbuffers\n", + DRM_DEV_INFO_ONCE(drm->dev, "Only creating %zu ringbuffers\n", ARRAY_SIZE(gpu->rb)); nr_rings = ARRAY_SIZE(gpu->rb); } -- 2.9.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/3] drm/msm/mdp5: mark runtime_pm functions as __maybe_unused
When CONFIG_PM is disabled, we get harmless warnings about unused functions: drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:1025:12: error: 'mdp5_runtime_resume' defined but not used [-Werror=unused-function] static int mdp5_runtime_resume(struct device *dev) ^~~ drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:1015:12: error: 'mdp5_runtime_suspend' defined but not used [-Werror=unused-function] static int mdp5_runtime_suspend(struct device *dev) ^~~~ This marks both functions as __maybe_unused so the compiler can drop them silently. Fixes: d68fe15b1878 ("drm/msm/mdp5: Use runtime PM get/put API instead of toggling clocks") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c index 9f9d95f7c80f..f7c0698fec40 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c @@ -1012,7 +1012,7 @@ static int mdp5_dev_remove(struct platform_device *pdev) return 0; } -static int mdp5_runtime_suspend(struct device *dev) +static __maybe_unused int mdp5_runtime_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev); @@ -1022,7 +1022,7 @@ static int mdp5_runtime_suspend(struct device *dev) return mdp5_disable(mdp5_kms); } -static int mdp5_runtime_resume(struct device *dev) +static __maybe_unused int mdp5_runtime_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev); -- 2.9.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 20/29] drm/radeon: switch to drm_*{get,put} helpers
Am 03.08.2017 um 13:58 schrieb Cihangir Akturk: drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk Reviewed-by: Christian König --- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon/radeon_cursor.c | 6 +++--- drivers/gpu/drm/radeon/radeon_display.c | 12 ++-- drivers/gpu/drm/radeon/radeon_fb.c | 4 ++-- drivers/gpu/drm/radeon/radeon_gem.c | 30 +++--- drivers/gpu/drm/radeon/radeon_object.c | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 00b22af..ea0db26 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -437,7 +437,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error, bo if (bo == NULL) continue; - drm_gem_object_unreference_unlocked(&bo->gem_base); + drm_gem_object_put_unlocked(&bo->gem_base); } } kfree(parser->track); diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c index 4a4f953..9195227 100644 --- a/drivers/gpu/drm/radeon/radeon_cursor.c +++ b/drivers/gpu/drm/radeon/radeon_cursor.c @@ -307,7 +307,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, robj = gem_to_radeon_bo(obj); ret = radeon_bo_reserve(robj, false); if (ret != 0) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } /* Only 27 bit offset for legacy cursor */ @@ -317,7 +317,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, radeon_bo_unreserve(robj); if (ret) { DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } @@ -352,7 +352,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, radeon_bo_unpin(robj); radeon_bo_unreserve(robj); } - drm_gem_object_unreference_unlocked(radeon_crtc->cursor_bo); + drm_gem_object_put_unlocked(radeon_crtc->cursor_bo); } radeon_crtc->cursor_bo = obj; diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 17d3daf..adbf28c 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -282,7 +282,7 @@ static void radeon_unpin_work_func(struct work_struct *__work) } else DRM_ERROR("failed to reserve buffer after flip\n"); - drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); + drm_gem_object_put_unlocked(&work->old_rbo->gem_base); kfree(work); } @@ -519,7 +519,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, obj = old_radeon_fb->obj; /* take a reference to the old object */ - drm_gem_object_reference(obj); + drm_gem_object_get(obj); work->old_rbo = gem_to_radeon_bo(obj); new_radeon_fb = to_radeon_framebuffer(fb); @@ -618,7 +618,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, radeon_bo_unreserve(new_rbo); cleanup: - drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); + drm_gem_object_put_unlocked(&work->old_rbo->gem_base); dma_fence_put(work->fence); kfree(work); return r; @@ -1303,7 +1303,7 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb); - drm_gem_object_unreference_unlocked(radeon_fb->obj); + drm_gem_object_put_unlocked(radeon_fb->obj); drm_framebuffer_cleanup(fb); kfree(radeon_fb); } @@ -1363,14 +1363,14 @@ radeon_user_framebuffer_create(struct drm_device *dev, radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL); if (radeon_fb == NULL) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(-ENOMEM); } ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj); if (ret) { kfree(radeon_fb); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 356ad90..976d224 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/rade
Re: [PATCH 05/29] drm/atmel-hlcdc: switch to drm_*{get,put} helpers
On Thu, 3 Aug 2017 14:58:20 +0300 Cihangir Akturk wrote: > drm_*_reference() and drm_*_unreference() functions are just > compatibility alias for drm_*_get() and drm_*_put() adn should not be s/adn/and/ > used by new code. So convert all users of compatibility functions to use > the new APIs. > > Signed-off-by: Cihangir Akturk Acked-by: Boris Brezillon > --- > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > index 1124200..fc3f910 100644 > --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > @@ -809,7 +809,7 @@ static void atmel_hlcdc_plane_destroy(struct drm_plane *p) > struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p); > > if (plane->base.fb) > - drm_framebuffer_unreference(plane->base.fb); > + drm_framebuffer_put(plane->base.fb); > > drm_plane_cleanup(p); > } > @@ -958,7 +958,7 @@ static void atmel_hlcdc_plane_reset(struct drm_plane *p) > state = drm_plane_state_to_atmel_hlcdc_plane_state(p->state); > > if (state->base.fb) > - drm_framebuffer_unreference(state->base.fb); > + drm_framebuffer_put(state->base.fb); > > kfree(state); > p->state = NULL; > @@ -996,7 +996,7 @@ atmel_hlcdc_plane_atomic_duplicate_state(struct drm_plane > *p) > } > > if (copy->base.fb) > - drm_framebuffer_reference(copy->base.fb); > + drm_framebuffer_get(copy->base.fb); > > return ©->base; > } > @@ -1015,7 +1015,7 @@ static void > atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p, > } > > if (s->fb) > - drm_framebuffer_unreference(s->fb); > + drm_framebuffer_put(s->fb); > > kfree(state); > } ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 12/29] drm/i915: switch to drm_*{get,put} helpers
On Thu, 03 Aug 2017, Cihangir Akturk wrote: > drm_*_reference() and drm_*_unreference() functions are just > compatibility alias for drm_*_get() and drm_*_put() adn should not be > used by new code. So convert all users of compatibility functions to use > the new APIs. Please include the cocci script in the commit message. If you didn't use cocci, you should check it out! :) BR, Jani. > > Signed-off-by: Cihangir Akturk > --- > drivers/gpu/drm/i915/i915_gem_object.h | 10 +- > drivers/gpu/drm/i915/intel_display.c | 24 > drivers/gpu/drm/i915/intel_dp_mst.c| 2 +- > drivers/gpu/drm/i915/intel_fbdev.c | 4 ++-- > 4 files changed, 20 insertions(+), 20 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem_object.h > b/drivers/gpu/drm/i915/i915_gem_object.h > index 5b19a49..8f6c915 100644 > --- a/drivers/gpu/drm/i915/i915_gem_object.h > +++ b/drivers/gpu/drm/i915/i915_gem_object.h > @@ -257,25 +257,25 @@ __attribute__((nonnull)) > static inline struct drm_i915_gem_object * > i915_gem_object_get(struct drm_i915_gem_object *obj) > { > - drm_gem_object_reference(&obj->base); > + drm_gem_object_get(&obj->base); > return obj; > } > > __deprecated > -extern void drm_gem_object_reference(struct drm_gem_object *); > +extern void drm_gem_object_get(struct drm_gem_object *); > > __attribute__((nonnull)) > static inline void > i915_gem_object_put(struct drm_i915_gem_object *obj) > { > - __drm_gem_object_unreference(&obj->base); > + __drm_gem_object_put(&obj->base); > } > > __deprecated > -extern void drm_gem_object_unreference(struct drm_gem_object *); > +extern void drm_gem_object_put(struct drm_gem_object *); > > __deprecated > -extern void drm_gem_object_unreference_unlocked(struct drm_gem_object *); > +extern void drm_gem_object_put_unlocked(struct drm_gem_object *); > > static inline void i915_gem_object_lock(struct drm_i915_gem_object *obj) > { > diff --git a/drivers/gpu/drm/i915/intel_display.c > b/drivers/gpu/drm/i915/intel_display.c > index dec9e58..b4d03cf 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -2672,10 +2672,10 @@ update_state_fb(struct drm_plane *plane) > return; > > if (plane->state->fb) > - drm_framebuffer_unreference(plane->state->fb); > + drm_framebuffer_put(plane->state->fb); > plane->state->fb = plane->fb; > if (plane->state->fb) > - drm_framebuffer_reference(plane->state->fb); > + drm_framebuffer_get(plane->state->fb); > } > > static void > @@ -2746,7 +2746,7 @@ intel_find_initial_plane_obj(struct intel_crtc > *intel_crtc, > > if (intel_plane_ggtt_offset(state) == plane_config->base) { > fb = c->primary->fb; > - drm_framebuffer_reference(fb); > + drm_framebuffer_get(fb); > goto valid_fb; > } > } > @@ -2777,7 +2777,7 @@ intel_find_initial_plane_obj(struct intel_crtc > *intel_crtc, > intel_crtc->pipe, PTR_ERR(intel_state->vma)); > > intel_state->vma = NULL; > - drm_framebuffer_unreference(fb); > + drm_framebuffer_put(fb); > return; > } > > @@ -2798,7 +2798,7 @@ intel_find_initial_plane_obj(struct intel_crtc > *intel_crtc, > if (i915_gem_object_is_tiled(obj)) > dev_priv->preserve_bios_swizzle = true; > > - drm_framebuffer_reference(fb); > + drm_framebuffer_get(fb); > primary->fb = primary->state->fb = fb; > primary->crtc = primary->state->crtc = &intel_crtc->base; > > @@ -9668,7 +9668,7 @@ mode_fits_in_fbdev(struct drm_device *dev, > if (obj->base.size < mode->vdisplay * fb->pitches[0]) > return NULL; > > - drm_framebuffer_reference(fb); > + drm_framebuffer_get(fb); > return fb; > #else > return NULL; > @@ -9849,7 +9849,7 @@ int intel_get_load_detect_pipe(struct drm_connector > *connector, > if (ret) > goto fail; > > - drm_framebuffer_unreference(fb); > + drm_framebuffer_put(fb); > > ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode); > if (ret) > @@ -10159,7 +10159,7 @@ static void intel_unpin_work_fn(struct work_struct > *__work) > intel_frontbuffer_flip_complete(to_i915(dev), > > to_intel_plane(primary)->frontbuffer_bit); > intel_fbc_post_update(crtc); > - drm_framebuffer_unreference(work->old_fb); > + drm_framebuffer_put(work->old_fb); > > BUG_ON(atomic_read(&crtc->unpin_work_count) == 0); > atomic_dec(&crtc->unpin_work_count); > @@ -10799,7 +10799,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, > flush_workqueue(dev_priv->wq); > > /* Reference the objects for the scheduled work. */ > - drm_framebuffe
Re: [PATCH] drm/bridge/sii8620: add remote control support
Hi Maciej, This is my first time looking at anything input related, so pardon if I'm off the mark here. On 3 August 2017 at 08:44, Maciej Purski wrote: [...] > +static struct { > + u16 key; > + u16 extra_key; > + bool autorepeat; > +} rcp_keymap[] = { Ideally this would be "const" allowing the compiler to move the data to the .rodata section, making exploits a bit harder. Then again struct input_dev::keycode is "void *" so that cannot quite work atm. One could(?) toggle make that a const, updating the users. Many of them memcpy from const data into keycode, while others k[z]alloc and them memcpy. Might be worth listing these in the input-tree TODO list ;-) [...] > + set_bit(EV_KEY, i_dev->evbit); > + i_dev->name = "MHL Remote Control"; > + i_dev->keycode = rcp_keymap; > + i_dev->keycodesize = sizeof(u16); According to the docs "... keycodesize the size of each entry in it (in bytes)...". As such this should be sizeof(rcp_keymap[0]) At the same time, the code in input.c has a hidden assumption - keycode is an array of u8, u16 or u32 values. See functions input_fetch_keycode() and input_default_setkeycode() for details. In this patch, the size is 6 and everything will go crazy. Couple ideas come to mind: - enforce keycode layout - must be a simple u8/16/32 array. - add separate field for the size of "key", such that one can have more complex data stored in keycode. Of course, I could be completely wrong :-) HTH Emil ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/6] drm/rockchip: vop: no need wait vblank on crtc enable
Hi mark, 在 2017/7/31 17:49, Mark Yao 写道: Since atomic framework, crtc enable and disable are in pairs, no need to wait vblank. Signed-off-by: Mark Yao --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 36 - 1 file changed, 36 deletions(-) Reviewed-by: Sandy huang ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [maintainer-tools PATCH v2 1/2] dim: Add apply and push shorthands for current branch
On Thu, Aug 03, 2017 at 01:50:12PM +0300, Jani Nikula wrote: > On Mon, 31 Jul 2017, Thierry Reding wrote: > > From: Thierry Reding > > > > The new apply and push commands are shorthands for applying patches to > > and pushing the current branch, respectively. > > There's been some talk about moving further in the direction of using > the current branch and current directory, like git does. I think the > historical reason for having to explicitly specify the branch is to > avoid shooting oneself in the foot. To avoid that oops from a quick > apply and push. The safety catch. > > I'm not opposed, but this is the reason. Yeah, I think with all the new committer the common use-case has shifted a bit, where applying to the current branch is a reasonable thing to do. Also, worktrees help a bunch with that too. If it causes more troubles than it helps we can always go back to forcing explicit branch names. > One comment below. > > BR, > Jani. > > > > > > v2: use git symbolic-ref to find current branch (Daniel Vetter) > > > > Signed-off-by: Thierry Reding > > --- > > dim | 18 ++ > > dim.rst | 8 > > 2 files changed, 26 insertions(+) > > > > diff --git a/dim b/dim > > index c0cbe352b165..1422b35e2471 100755 > > --- a/dim > > +++ b/dim > > @@ -326,6 +326,11 @@ function git_fetch_helper # remote > > fi > > } > > > > +function git_current_branch > > +{ > > + git symbolic-ref -q --short HEAD > > +} > > + > > function git_is_current_branch # branch > > { > > git branch --list $1 | grep -q '\*' > > @@ -739,6 +744,11 @@ function dim_push_fixes > > dim_push_branch drm-intel-fixes "$@" > > } > > > > +function dim_push > > +{ > > + dim_push_branch $(git_current_branch) "$@" > > +} > > + > > # ensure we're on branch $1, and apply patches. the rest of the arguments > > are > > # passed to git am. > > dim_alias_ab=apply-branch > > @@ -930,6 +940,14 @@ function dim_apply_next_fixes > > dim_apply_branch drm-intel-next-fixes "$@" > > } > > > > +# apply patch to current branch, the rest of the arguments are passed to > > +# git am > > +dim_alias_am=apply > > +function dim_apply > > +{ > > + dim_apply_branch $(git_current_branch) "$@" > > +} > > + > > function commit_list_references > > { > > local commit remote log > > diff --git a/dim.rst b/dim.rst > > index c004c30ada17..fa9b587d73bb 100644 > > --- a/dim.rst > > +++ b/dim.rst > > @@ -198,6 +198,10 @@ apply-queued [*git am arguments*] > > **apply-branch** shorthands for *drm-intel-fixes*, *drm-intel-next-fixes*, > > and > > *drm-intel-next-queued* branches respectively. > > > > +apply [*git am arguments*] > > +-- > > +**apply-branch** shorthand for the current branch. > > + > > extract-tags *branch* [*git-rangeish*] > > -- > > This extracts various tags (e.g. Reviewed-by:) from emails and applies > > them to the > > @@ -232,6 +236,10 @@ push-queued [*git push arguments*] > > **push-branch** shorthands for *drm-intel-fixes*, *drm-intel-next-fixes*, > > and > > *drm-intel-next-queued* branches respectively. > > > > +push [*git push arguments*] > > +--- > > +**push** shorthand for the current branch. > > I think you mean **push-branch** shorthand. I'll fix this while applying. -Daniel > > > + > > rebuild-tip > > --- > > Rebuild and push the integration tree. > > -- > Jani Nikula, Intel Open Source Technology Center > ___ > Intel-gfx mailing list > intel-...@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH] dim: Continue also for dry runs
On Thu, 27 Jul 2017, Daniel Vetter wrote: > It's a bit silly to have to spec both -d and -f to see what dim would > all complain about. And dry-run should never cause bad side-effects. Ack. We don't do dry-run all that well in general, partly because you need to have one part actually succeed to make the rest succeed. And some things don't do dry-run at all. Those could bail out with an error right away. To the endless todo list... BR, Jani. > > Signed-off-by: Daniel Vetter > --- > dim | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/dim b/dim > index c0cbe352b165..96aaf7101d6b 100755 > --- a/dim > +++ b/dim > @@ -126,6 +126,8 @@ function warn_or_fail > { > if [[ $FORCE ]] ; then > echoerr "WARNING: $1, but continuing" > + elif [[ $DRY ]] ; then > + echoerr "WARNING: $1, but continuing dry-run" > else > echoerr "ERROR: $1, aborting" > exit 1 -- Jani Nikula, Intel Open Source Technology Center ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 28/29] drm/vmwgfx: switch to drm_*{get,put} helpers
On 08/03/2017 01:58 PM, Cihangir Akturk wrote: drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be s/adn/and/ used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 6f4cb46..d43dce9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -500,7 +500,7 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par, } if (cur_fb) { - drm_framebuffer_unreference(cur_fb); + drm_framebuffer_put(cur_fb); par->set_fb = NULL; } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 5ec24fd..fd4a988 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -316,7 +316,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, out_no_surface: ttm_read_unlock(&dev_priv->reservation_sem); out_no_ttm_lock: - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); out_no_fb: drm_modeset_unlock_all(dev); out_no_copy: @@ -393,7 +393,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, ttm_read_unlock(&dev_priv->reservation_sem); out_no_ttm_lock: - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); out_no_fb: drm_modeset_unlock_all(dev); out_no_copy: Apart from the above, Reviewed-by: Thomas Hellstrom (Assuming this gets pulled together with the whole series, not vmwgfx-next) Thanks, Thomas ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 12/29] drm/i915: switch to drm_*{get,put} helpers
On Thu, Aug 03, 2017 at 03:26:01PM +0300, Jani Nikula wrote: > On Thu, 03 Aug 2017, Cihangir Akturk wrote: > > drm_*_reference() and drm_*_unreference() functions are just > > compatibility alias for drm_*_get() and drm_*_put() adn should not be > > used by new code. So convert all users of compatibility functions to use > > the new APIs. > > Please include the cocci script in the commit message. If you didn't use > cocci, you should check it out! :) Yeah I assume you've created these with spatch/cocci, not with your own script. I trust cocci a lot more than any kind of scripting, and the coccie patch is already in there kernel (the commits you've cited in the cover letter contain it iirc). Thanks, Daniel > > BR, > Jani. > > > > > Signed-off-by: Cihangir Akturk > > --- > > drivers/gpu/drm/i915/i915_gem_object.h | 10 +- > > drivers/gpu/drm/i915/intel_display.c | 24 > > drivers/gpu/drm/i915/intel_dp_mst.c| 2 +- > > drivers/gpu/drm/i915/intel_fbdev.c | 4 ++-- > > 4 files changed, 20 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_gem_object.h > > b/drivers/gpu/drm/i915/i915_gem_object.h > > index 5b19a49..8f6c915 100644 > > --- a/drivers/gpu/drm/i915/i915_gem_object.h > > +++ b/drivers/gpu/drm/i915/i915_gem_object.h > > @@ -257,25 +257,25 @@ __attribute__((nonnull)) > > static inline struct drm_i915_gem_object * > > i915_gem_object_get(struct drm_i915_gem_object *obj) > > { > > - drm_gem_object_reference(&obj->base); > > + drm_gem_object_get(&obj->base); > > return obj; > > } > > > > __deprecated > > -extern void drm_gem_object_reference(struct drm_gem_object *); > > +extern void drm_gem_object_get(struct drm_gem_object *); > > > > __attribute__((nonnull)) > > static inline void > > i915_gem_object_put(struct drm_i915_gem_object *obj) > > { > > - __drm_gem_object_unreference(&obj->base); > > + __drm_gem_object_put(&obj->base); > > } > > > > __deprecated > > -extern void drm_gem_object_unreference(struct drm_gem_object *); > > +extern void drm_gem_object_put(struct drm_gem_object *); > > > > __deprecated > > -extern void drm_gem_object_unreference_unlocked(struct drm_gem_object *); > > +extern void drm_gem_object_put_unlocked(struct drm_gem_object *); > > > > static inline void i915_gem_object_lock(struct drm_i915_gem_object *obj) > > { > > diff --git a/drivers/gpu/drm/i915/intel_display.c > > b/drivers/gpu/drm/i915/intel_display.c > > index dec9e58..b4d03cf 100644 > > --- a/drivers/gpu/drm/i915/intel_display.c > > +++ b/drivers/gpu/drm/i915/intel_display.c > > @@ -2672,10 +2672,10 @@ update_state_fb(struct drm_plane *plane) > > return; > > > > if (plane->state->fb) > > - drm_framebuffer_unreference(plane->state->fb); > > + drm_framebuffer_put(plane->state->fb); > > plane->state->fb = plane->fb; > > if (plane->state->fb) > > - drm_framebuffer_reference(plane->state->fb); > > + drm_framebuffer_get(plane->state->fb); > > } > > > > static void > > @@ -2746,7 +2746,7 @@ intel_find_initial_plane_obj(struct intel_crtc > > *intel_crtc, > > > > if (intel_plane_ggtt_offset(state) == plane_config->base) { > > fb = c->primary->fb; > > - drm_framebuffer_reference(fb); > > + drm_framebuffer_get(fb); > > goto valid_fb; > > } > > } > > @@ -2777,7 +2777,7 @@ intel_find_initial_plane_obj(struct intel_crtc > > *intel_crtc, > > intel_crtc->pipe, PTR_ERR(intel_state->vma)); > > > > intel_state->vma = NULL; > > - drm_framebuffer_unreference(fb); > > + drm_framebuffer_put(fb); > > return; > > } > > > > @@ -2798,7 +2798,7 @@ intel_find_initial_plane_obj(struct intel_crtc > > *intel_crtc, > > if (i915_gem_object_is_tiled(obj)) > > dev_priv->preserve_bios_swizzle = true; > > > > - drm_framebuffer_reference(fb); > > + drm_framebuffer_get(fb); > > primary->fb = primary->state->fb = fb; > > primary->crtc = primary->state->crtc = &intel_crtc->base; > > > > @@ -9668,7 +9668,7 @@ mode_fits_in_fbdev(struct drm_device *dev, > > if (obj->base.size < mode->vdisplay * fb->pitches[0]) > > return NULL; > > > > - drm_framebuffer_reference(fb); > > + drm_framebuffer_get(fb); > > return fb; > > #else > > return NULL; > > @@ -9849,7 +9849,7 @@ int intel_get_load_detect_pipe(struct drm_connector > > *connector, > > if (ret) > > goto fail; > > > > - drm_framebuffer_unreference(fb); > > + drm_framebuffer_put(fb); > > > > ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode); > > if (ret) > > @@ -10159,7 +10159,7 @@ static void intel_unpin_work_fn(struct work_struct > > *__work) > > intel_frontbuffer_flip_complete(to_i915(dev), > > > > to_inte
Re: [PATCH 2/6] drm/rockchip: vop: fix iommu page fault when resume
Hi mark, 在 2017/7/31 17:49, Mark Yao 写道: Iommu would get page fault with following path: vop_disable: 1, disable all windows and set vop config done 2, vop enter to standy, all windows not works, but their registers are not clean, when you read window's enable bit, may found the window is enable. vop_enable: 1, memcpy(vop->regsbak, vop->regs, len) save current vop registers to vop->regsbak, then you can found window is enable on regsbak. 2, VOP_WIN_SET(vop, win, gate, 1); force enable window gate, but gate and enable are on same hardware register, then window enable bit rewrite to vop hardware. 3, vop power on, and vop might try to scan destroyed buffer, then iommu get page fault. Move windows disable after vop regsbak restore, then vop regsbak mechanism would keep tracing the modify, everything would be safe. Signed-off-by: Mark Yao --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 33 + 1 file changed, 15 insertions(+), 18 deletions(-) Reviewed-by: Sandy huang ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 28/29] drm/vmwgfx: switch to drm_*{get,put} helpers
On Thu, Aug 03, 2017 at 02:40:43PM +0200, Thomas Hellstrom wrote: > On 08/03/2017 01:58 PM, Cihangir Akturk wrote: > > drm_*_reference() and drm_*_unreference() functions are just > > compatibility alias for drm_*_get() and drm_*_put() adn should not be > > s/adn/and/ > > used by new code. So convert all users of compatibility functions to use > > the new APIs. > > > > Signed-off-by: Cihangir Akturk > > --- > > drivers/gpu/drm/vmwgfx/vmwgfx_fb.c| 2 +- > > drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 ++-- > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c > > b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c > > index 6f4cb46..d43dce9 100644 > > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c > > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c > > @@ -500,7 +500,7 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par, > > } > > if (cur_fb) { > > - drm_framebuffer_unreference(cur_fb); > > + drm_framebuffer_put(cur_fb); > > par->set_fb = NULL; > > } > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c > > b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c > > index 5ec24fd..fd4a988 100644 > > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c > > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c > > @@ -316,7 +316,7 @@ int vmw_present_ioctl(struct drm_device *dev, void > > *data, > > out_no_surface: > > ttm_read_unlock(&dev_priv->reservation_sem); > > out_no_ttm_lock: > > - drm_framebuffer_unreference(fb); > > + drm_framebuffer_put(fb); > > out_no_fb: > > drm_modeset_unlock_all(dev); > > out_no_copy: > > @@ -393,7 +393,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, > > void *data, > > ttm_read_unlock(&dev_priv->reservation_sem); > > out_no_ttm_lock: > > - drm_framebuffer_unreference(fb); > > + drm_framebuffer_put(fb); > > out_no_fb: > > drm_modeset_unlock_all(dev); > > out_no_copy: > > Apart from the above, > > Reviewed-by: Thomas Hellstrom > > (Assuming this gets pulled together with the whole series, not vmwgfx-next) Imo easier to pull this in through driver trees. It's going to take a bit until we can finally remove the wrappers, there's too many callers all around. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 100306] System randomly freezes or crashes to the login screen, glitches until rebooted
https://bugs.freedesktop.org/show_bug.cgi?id=100306 --- Comment #34 from MirceaKitsune --- Today I discovered that even when not toggling desktop effects at runtime, the freeze can still be mined into the system. I got a crash after 1 day of uptime, no toggling of desktop compositing required. I find it remarkable how the cause of the crash appears to have immediately changed after me making the comment above yesterday; I tested my theory that desktop effects are the root for 2 months, yet the moment I publish my observations the behavior changes in less than a day. This further makes me concerned that someone might be deliberately programming this crash using vulnerabilities in system components, solely for how strange this coincidence is. I'm still waiting for the developers to help investigate this further whatever the case, as I cannot find any explanation at this point. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[GIT PUL FOR v4.14] R-Car DU changes
Hi Dave, The following changes since commit e6742e1021a5cec55fab50a0b115c65217488eda: drm: linux-next: build failure after merge of the drm-misc tree (2017-07-27 08:27:11 +1000) are available in the git repository at: git://linuxtv.org/pinchartl/media.git tags/drm-next-du-20170803 for you to fetch changes up to a01ce6678bad548be4063286bfd12ccba3808a2e: drm: rcar-du: Use new iterator macros (2017-08-03 16:17:35 +0300) The branch contains patches for the VSP driver which would normally go through the V4L2 subsystem. As some DU patches depend on them (and as one of the patches in the series touches the two drivers), it was agreed with Mauro to get the whole series merged through your tree (all the patches that touch V4L2 carry his Acked-by). I have based the series on top of the v4.13-rc2 backmerge in your tree (plus one compilation fix from -next), as it depends on "drm: Add drm_atomic_helper_wait_for_flip_done()" that you have merged after v4.13-rc1. There is currently no patch in the linux-media, drm or drm-misc trees that conflict with the series. We have other VSP patches pending for v4.14 that will get merged through the V4L2 tree. If any conflict occurs, I'll make sure to base them on top of this tag, and tell Mauro to pull directly. Dan Carpenter (1): drm: rcar-du: Remove an unneeded NULL check Kieran Bingham (1): drm: rcar-du: Repair vblank for DRM page flips using the VSP Kuninori Morimoto (1): drm: rcar-du: Use of_graph_get_remote_endpoint() Laurent Pinchart (20): v4l: vsp1: Fill display list headers without holding dlm spinlock v4l: vsp1: Don't recycle active list at display start v4l: vsp1: Don't set WPF sink pointer v4l: vsp1: Store source and sink pointers as vsp1_entity v4l: vsp1: Don't create links for DRM pipeline v4l: vsp1: Add pipe index argument to the VSP-DU API v4l: vsp1: Add support for the BRS entity v4l: vsp1: Add support for new VSP2-BS, VSP2-DL and VSP2-D instances v4l: vsp1: Add support for multiple LIF instances v4l: vsp1: Add support for multiple DRM pipelines v4l: vsp1: Add support for header display lists in continuous mode drm: rcar-du: Fix comments to comply with the kernel coding style drm: rcar-du: Support multiple sources from the same VSP drm: rcar-du: Restrict DPLL duty cycle workaround to H3 ES1.x drm: rcar-du: Configure DPAD0 routing through last group on Gen3 drm: rcar-du: Setup planes before enabling CRTC to avoid flicker drm: rcar-du: Add HDMI outputs to R8A7796 device description drm: rcar-du: Use the VBK interrupt for vblank events drm: rcar-du: Wait for flip completion instead of vblank in commit tail drm: rcar-du: Fix race condition when disabling planes at CRTC stop Maarten Lankhorst (1): drm: rcar-du: Use new iterator macros drivers/gpu/drm/rcar-du/rcar_du_crtc.c| 189 ++--- drivers/gpu/drm/rcar-du/rcar_du_crtc.h| 17 ++- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 28 ++-- drivers/gpu/drm/rcar-du/rcar_du_group.c | 38 +++-- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 113 --- drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 12 +- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 114 --- drivers/gpu/drm/rcar-du/rcar_du_plane.h | 3 +- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 51 --- drivers/gpu/drm/rcar-du/rcar_du_vsp.h | 10 +- drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c| 2 +- drivers/media/platform/vsp1/vsp1.h| 7 +- drivers/media/platform/vsp1/vsp1_bru.c| 45 -- drivers/media/platform/vsp1/vsp1_bru.h| 4 +- drivers/media/platform/vsp1/vsp1_dl.c | 205 --- drivers/media/platform/vsp1/vsp1_dl.h | 1 - drivers/media/platform/vsp1/vsp1_drm.c| 286 + drivers/media/platform/vsp1/vsp1_drm.h| 38 ++--- drivers/media/platform/vsp1/vsp1_drv.c| 115 ++- drivers/media/platform/vsp1/vsp1_entity.c | 40 -- drivers/media/platform/vsp1/vsp1_entity.h | 5 +- drivers/media/platform/vsp1/vsp1_lif.c| 5 +- drivers/media/platform/vsp1/vsp1_lif.h| 2 +- drivers/media/platform/vsp1/vsp1_pipe.c | 27 ++-- drivers/media/platform/vsp1/vsp1_pipe.h | 2 +- drivers/media/platform/vsp1/vsp1_regs.h | 46 -- drivers/media/platform/vsp1/vsp1_video.c | 69 + drivers/media/platform/vsp1/vsp1_wpf.c| 4 +- include/media/vsp1.h | 12 +- 29 files changed, 949 insertions(+), 541 deletions(-) -- Regards, Laurent Pinchart ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/3] drm/vc4: Don't disable DSI clocks on component unload.
Den 02.08.2017 22.32, skrev Eric Anholt: The clocks are enabled/disabled at encoder enable/disable time, not at component load. Fixes a WARN_ON at boot if V3D fails to probe. Fixes: 4078f5757144 ("drm/vc4: Add DSI driver") Signed-off-by: Eric Anholt --- Acked-by: Noralf Trønnes drivers/gpu/drm/vc4/vc4_dsi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index 629d372633e6..13481bb6322f 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -1641,9 +1641,6 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, mipi_dsi_host_unregister(&dsi->dsi_host); - clk_disable_unprepare(dsi->pll_phy_clock); - clk_disable_unprepare(dsi->escape_clock); - if (dsi->port == 1) vc4->dsi1 = NULL; } ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] drm/vc4: Fix errant drm_bridge_remove() in DSI.
Den 02.08.2017 22.32, skrev Eric Anholt: drm_bridge_remove() is for unregistering a bridge driver, not for detaching a bridge from its consumer. Fixes: 656fa22f9cea ("drm/vc4: Switch DSI to the panel-bridge layer, and support bridges.") Signed-off-by: Eric Anholt --- Acked-by: Noralf Trønnes drivers/gpu/drm/vc4/vc4_dsi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index 13481bb6322f..d1e0dc908048 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -1636,7 +1636,6 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, pm_runtime_disable(dev); - drm_bridge_remove(dsi->bridge); vc4_dsi_encoder_destroy(dsi->encoder); mipi_dsi_host_unregister(&dsi->dsi_host); ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 4/8] drm: Nuke drm_atomic_helper_crtc_set_property
Acked-by: Thomas Hellstrom On 07/25/2017 10:01 AM, Daniel Vetter wrote: It's dead code because this is now handled in the core. Signed-off-by: Daniel Vetter Cc: Boris Brezillon Cc: Daniel Vetter Cc: Jani Nikula Cc: Sean Paul Cc: David Airlie Cc: Ben Skeggs Cc: Tomi Valkeinen Cc: Laurent Pinchart Cc: Alexey Brodkin Cc: Shawn Guo Cc: Eric Engestrom Cc: Chris Wilson Cc: "Ville Syrjälä" Cc: Rob Clark Cc: Philippe Cornu Cc: Masahiro Yamada Cc: Sushmita Susheelendra Cc: Archit Taneja Cc: intel-...@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Cc: Philipp Zabel Cc: Maxime Ripard Cc: Thomas Hellstrom --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 1 - drivers/gpu/drm/drm_atomic_helper.c | 55 - drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 - drivers/gpu/drm/i915/intel_display.c| 1 - drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c| 1 - drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c| 2 - drivers/gpu/drm/nouveau/nv50_display.c | 1 - drivers/gpu/drm/omapdrm/omap_crtc.c | 1 - include/drm/drm_atomic_helper.h | 3 -- 9 files changed, 66 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 4fbbeab5c5d4..d73281095fac 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -431,7 +431,6 @@ static const struct drm_crtc_funcs atmel_hlcdc_crtc_funcs = { .atomic_destroy_state = atmel_hlcdc_crtc_destroy_state, .enable_vblank = atmel_hlcdc_crtc_enable_vblank, .disable_vblank = atmel_hlcdc_crtc_disable_vblank, - .set_property = drm_atomic_helper_crtc_set_property, .gamma_set = drm_atomic_helper_legacy_gamma_set, }; diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 4a960c741e35..22245aa8b1aa 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2968,61 +2968,6 @@ int drm_atomic_helper_resume(struct drm_device *dev, EXPORT_SYMBOL(drm_atomic_helper_resume); /** - * drm_atomic_helper_crtc_set_property - helper for crtc properties - * @crtc: DRM crtc - * @property: DRM property - * @val: value of property - * - * Provides a default crtc set_property handler using the atomic driver - * interface. - * - * RETURNS: - * Zero on success, error code on failure - */ -int -drm_atomic_helper_crtc_set_property(struct drm_crtc *crtc, - struct drm_property *property, - uint64_t val) -{ - struct drm_atomic_state *state; - struct drm_crtc_state *crtc_state; - int ret = 0; - - state = drm_atomic_state_alloc(crtc->dev); - if (!state) - return -ENOMEM; - - /* ->set_property is always called with all locks held. */ - state->acquire_ctx = crtc->dev->mode_config.acquire_ctx; -retry: - crtc_state = drm_atomic_get_crtc_state(state, crtc); - if (IS_ERR(crtc_state)) { - ret = PTR_ERR(crtc_state); - goto fail; - } - - ret = drm_atomic_crtc_set_property(crtc, crtc_state, - property, val); - if (ret) - goto fail; - - ret = drm_atomic_commit(state); -fail: - if (ret == -EDEADLK) - goto backoff; - - drm_atomic_state_put(state); - return ret; - -backoff: - drm_atomic_state_clear(state); - drm_atomic_legacy_backoff(state); - - goto retry; -} -EXPORT_SYMBOL(drm_atomic_helper_crtc_set_property); - -/** * drm_atomic_helper_plane_set_property - helper for plane properties * @plane: DRM plane * @property: DRM property diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 706efd0c4190..961551135a39 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -567,7 +567,6 @@ static const struct drm_crtc_funcs ade_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .reset = drm_atomic_helper_crtc_reset, - .set_property = drm_atomic_helper_crtc_set_property, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, .enable_vblank = ade_crtc_enable_vblank, diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f7b128c33aa1..b4d0c5298a53 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12373,7 +12373,6 @@ static int intel_atomic_commit(struct drm_device *dev, static const struct drm_crtc_funcs intel_crtc_funcs = { .gamma_set = drm_atomic_helper_legacy_gamma_set,
[Bug 102014] Mesa git build broken by commit bc7f41e11d325280db12e7b9444501357bc13922
https://bugs.freedesktop.org/show_bug.cgi?id=102014 Nicolai Hähnle changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #9 from Nicolai Hähnle --- The build should be fixed again with commit 33f7d71d5358337f08ce0bb94f5e915bda77748c, so closing this bug. (Note additional patches are on their way which are required if you build only OpenCL.) FYI, there are also segfaults, which should be fixed by this series: https://patchwork.freedesktop.org/series/28311/ -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/4] drm: Only lastclose on unload for legacy drivers
On Thu, Aug 3, 2017 at 1:17 AM, Daniel Vetter wrote: > On Wed, Aug 2, 2017 at 10:50 PM, Alex Deucher wrote: >> On Wed, Aug 2, 2017 at 7:56 AM, Daniel Vetter wrote: >>> The only thing modern drivers are supposed to do in lastclose is >>> restore the fb emulation state. Which is entirely optional, and >>> there's really no reason to do that. So restrict it to legacy drivers >>> (where the driver cleanup essentially happens in lastclose). >> >> vga_switcheroo_process_delayed_switch() gets called in lastclose. >> Won't that need to get moved elsewhere for this to work? > > Hm right, I forgot the lazy way to do runtime pm by keeping the device > alive as long as anyone has an open fd for it ... This shouldn't be a > problem, since you need to unregister from vgaswitcheroo anyway on > unload. Maybe that blows up, I'll check the code and augment the patch > as needed. So I think there's 3 cases: - Trying to unload the module. You can't do that while anyone has the fd still open, so lastclose is guaranteeed to run. - Forcefully unbinding the driver through sysfs. Not any better, since the can_switch stuff checks for the open count, and so will delay the delayed switch no matter what. - Actual hotremoval: a) not implemented since none of the drivers taking part in vgaswitcheroo correctly unplug the drm device and b) you can't hotremove a chip from a laptop. So I think I'm not breaking this anymore than it probably already is :-) -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 23/29] drm/tilcdc: switch to drm_*{get,put} helpers
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki On 08/03/17 14:58, Cihangir Akturk wrote: > drm_*_reference() and drm_*_unreference() functions are just > compatibility alias for drm_*_get() and drm_*_put() adn should not be > used by new code. So convert all users of compatibility functions to use > the new APIs. > > Signed-off-by: Cihangir Akturk Acked-by: Jyri Sarha This appears to be a part of a larger series. So I guess it will go in via drm-misc. But if this is not the case just let me know and I'll add this to my next pull request. Best Regards, Jyri > --- > drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > index d524ed0..6e936dd 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > @@ -75,7 +75,7 @@ static void unref_worker(struct drm_flip_work *work, void > *val) > struct drm_device *dev = tilcdc_crtc->base.dev; > > mutex_lock(&dev->mode_config.mutex); > - drm_framebuffer_unreference(val); > + drm_framebuffer_put(val); > mutex_unlock(&dev->mode_config.mutex); > } > > @@ -456,7 +456,7 @@ static void tilcdc_crtc_set_mode(struct drm_crtc *crtc) > > set_scanout(crtc, fb); > > - drm_framebuffer_reference(fb); > + drm_framebuffer_get(fb); > > crtc->hwmode = crtc->state->adjusted_mode; > } > @@ -621,7 +621,7 @@ int tilcdc_crtc_update_fb(struct drm_crtc *crtc, > return -EBUSY; > } > > - drm_framebuffer_reference(fb); > + drm_framebuffer_get(fb); > > crtc->primary->fb = fb; > tilcdc_crtc->event = event; > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/29] drm: mali-dp: switch to drm_*{get,put} helpers
Hi Cihangir, On Thu, Aug 03, 2017 at 02:58:17PM +0300, Cihangir Akturk wrote: > drm_*_reference() and drm_*_unreference() functions are just > compatibility alias for drm_*_get() and drm_*_put() and should not be > used by new code. So convert all users of compatibility functions to use > the new APIs. Thank you for the patch! > > Signed-off-by: Cihangir Akturk Acked-by: Liviu Dudau I will pull the patch and send it to Dave. Best regards, Liviu > --- > drivers/gpu/drm/arm/malidp_planes.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/arm/malidp_planes.c > b/drivers/gpu/drm/arm/malidp_planes.c > index 600fa7b..cb71360 100644 > --- a/drivers/gpu/drm/arm/malidp_planes.c > +++ b/drivers/gpu/drm/arm/malidp_planes.c > @@ -57,7 +57,7 @@ static void malidp_de_plane_destroy(struct drm_plane *plane) > struct malidp_plane *mp = to_malidp_plane(plane); > > if (mp->base.fb) > - drm_framebuffer_unreference(mp->base.fb); > + drm_framebuffer_put(mp->base.fb); > > drm_plane_helper_disable(plane); > drm_plane_cleanup(plane); > -- > 2.7.4 > -- | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --- ¯\_(ツ)_/¯ ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/vc4: Advertise supported modifiers for planes
The IN_FORMATS blob allows the kernel to advertise to userspace which format/modifier combinations are supported, per plane. Use this to advertise that we support both T_TILED and linear. Signed-off-by: Daniel Stone --- drivers/gpu/drm/vc4/vc4_plane.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 2968b3ebb895..554325117a4e 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -863,6 +863,20 @@ vc4_update_plane(struct drm_plane *plane, ctx); } +static bool vc4_format_mod_supported(struct drm_plane *plane, +uint32_t format, +uint64_t modifier) +{ + /* This is easy: both tiled and linear are supported for all formats. */ + switch (modifier) { + case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: + case DRM_FORMAT_MOD_LINEAR: + return true; + default: + return false; + } +} + static const struct drm_plane_funcs vc4_plane_funcs = { .update_plane = vc4_update_plane, .disable_plane = drm_atomic_helper_disable_plane, @@ -871,6 +885,7 @@ static const struct drm_plane_funcs vc4_plane_funcs = { .reset = vc4_plane_reset, .atomic_duplicate_state = vc4_plane_duplicate_state, .atomic_destroy_state = vc4_plane_destroy_state, + .format_mod_supported = vc4_format_mod_supported, }; struct drm_plane *vc4_plane_init(struct drm_device *dev, @@ -882,6 +897,11 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, u32 num_formats = 0; int ret = 0; unsigned i; + static const uint64_t modifiers[] = { + DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED, + DRM_FORMAT_MOD_LINEAR, + DRM_FORMAT_MOD_INVALID + }; vc4_plane = devm_kzalloc(dev->dev, sizeof(*vc4_plane), GFP_KERNEL); @@ -902,7 +922,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, ret = drm_universal_plane_init(dev, plane, 0, &vc4_plane_funcs, formats, num_formats, - NULL, type, NULL); + modifiers, type, NULL); drm_plane_helper_add(plane, &vc4_plane_helper_funcs); -- 2.13.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 0/6] Support for LEGO MINDSTORMS EV3 LCD display
Den 02.08.2017 00.26, skrev David Lechner: On 08/01/2017 01:08 PM, Noralf Trønnes wrote: (cc: Daniel Vetter) Den 01.08.2017 18.51, skrev David Lechner: On 07/30/2017 12:14 PM, Noralf Trønnes wrote: Den 29.07.2017 21.40, skrev David Lechner: On 07/29/2017 02:17 PM, David Lechner wrote: The goal of this series is to get the built-in LCD of the LEGO MINDSTORMS EV3 working. But, most of the content here is building up the infrastructure to do that. Some general comments/questions: I have noticed that DRM doesn't really have support for monochrome displays. I'm guessing that is because no one really uses them anymore? The repaper driver was the first monochrome drm driver and I chose to present it to userspace as XRGB and convert it to monochrome. The reason for this is that everything, libraries, apps, plymouth (boot splash, no rgb565) supports it. I didn't see any point in adding a new monochrome drm format that didn't have, or probably wouldn't get userspace support (by libraries at least). The application of course needs to know this to get a good result. tinydrm_xrgb_to_gray8() does the conversion: https://cgit.freedesktop.org/drm/drm-misc/commit/drivers/gpu/drm/tinydrm?id=379ea9a1a59a5a32c8db6f164e80a3fd00cb3781 The LEGO EV3 display is just an LCD (not the backlit kind). It has two modes of operation. It can to 2bbp grayscale or it can do 1bpp monochrome. The grayscale isn't the best (looks splotchy in places), so it would be nice to be able to choose between these two modes. How would I implement something like that? Do you expect anyone to use grayscale if it doesn't look good? Maybe better to add it later if there's a demand for it. I don't expect many people to use it at all. The people that do will be hackers like me that want to see what it is capable of, so I think I will keep it grayscale by default. It looks like the best way to satisfy your needs is to add specific formats. Video for Linux have these: include/uapi/linux/videodev2.h /* Grey formats */ #define V4L2_PIX_FMT_GREYv4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */ #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ #define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */ Maybe we can add formats like these: include/uapi/drm/drm_fourcc.h #define DRM_FORMAT_MONOfourcc_code('Y', '0', '1', ' ') /* [0] Monochrome */ or #define DRM_FORMAT_Y1fourcc_code('Y', '0', '1', ' ') /* [0] Monochrome */ #define DRM_FORMAT_Y2fourcc_code('Y', '0', '2', ' ') /* [1:0] Greyscale */ Daniel, what do you think? 2 of the first 3 tinydrm drivers are monochrome (and I would like to write a driver for the Seeed/Grove I2C OLED displays which are also monochrome), so I think the 1bpp modes would definitely be useful. David, I'm curious about those displays what controller/interface they use. I have been hoping that it would be possible to use regmap as an abstraction for many of these controllers and their registers. For MIPI DCS it wasn't possible because it's command oriented with arguments. Since zero arguments is possible, a register with no value is nonsense, even though the regmap implementation happily let me do it. There's also the problem that regmap doesn't support registers with different widths. Which is a problem if all registers are 8-bit wide, except the GRAM register being 16-bit on RGB565 formats. regmap is especially helpful with controllers that also have gpios/keypad/touch/pwm, since the mfd (multi function device) subsystem has good support for sharing regmaps between drivers. Multi function devices are split into several drivers. Noralf. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 01/29] drm/amdgpu: switch to drm_*{get,put} helpers
Am 03.08.2017 um 13:58 schrieb Cihangir Akturk: drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() and should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 22 +++--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 6 +++--- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index f621ee1..2cf465f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c @@ -136,7 +136,7 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev, } bo = amdgpu_bo_ref(gem_to_amdgpu_bo(gobj)); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); usermm = amdgpu_ttm_tt_get_usermm(bo->tbo.ttm); if (usermm) { diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 5599c01..0b8406c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -54,7 +54,7 @@ static int amdgpu_cs_user_fence_chunk(struct amdgpu_cs_parser *p, *offset = data->offset; - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); if (amdgpu_ttm_tt_get_usermm(p->uf_entry.robj->tbo.ttm)) { amdgpu_bo_unref(&p->uf_entry.robj); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index cdf2ab2..6ad2432 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -482,7 +482,7 @@ static void amdgpu_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct amdgpu_framebuffer *amdgpu_fb = to_amdgpu_framebuffer(fb); - drm_gem_object_unreference_unlocked(amdgpu_fb->obj); + drm_gem_object_put_unlocked(amdgpu_fb->obj); drm_framebuffer_cleanup(fb); kfree(amdgpu_fb); } @@ -542,14 +542,14 @@ amdgpu_user_framebuffer_create(struct drm_device *dev, amdgpu_fb = kzalloc(sizeof(*amdgpu_fb), GFP_KERNEL); if (amdgpu_fb == NULL) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(-ENOMEM); } ret = amdgpu_framebuffer_init(dev, amdgpu_fb, mode_cmd, obj); if (ret) { kfree(amdgpu_fb); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c index c0d8c6f..f29a5fe 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c @@ -118,7 +118,7 @@ static void amdgpufb_destroy_pinned_object(struct drm_gem_object *gobj) amdgpu_bo_unpin(abo); amdgpu_bo_unreserve(abo); } - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); } static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, @@ -281,7 +281,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper, } if (fb && ret) { - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); drm_framebuffer_unregister_private(fb); drm_framebuffer_cleanup(fb); kfree(fb); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 621f739..2181cf1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -103,7 +103,7 @@ void amdgpu_gem_force_release(struct amdgpu_device *adev) spin_lock(&file->table_lock); idr_for_each_entry(&file->object_idr, gobj, handle) { WARN_ONCE(1, "And also active allocations!\n"); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); } idr_destroy(&file->object_idr); spin_unlock(&file->table_lock); @@ -275,7 +275,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, r = drm_gem_handle_create(filp, g
Re: [PATCH v13 5/7] vfio: ABI for mdev display dma-buf operation
On Thu, 3 Aug 2017 07:08:15 + "Zhang, Tina" wrote: > > -Original Message- > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Thursday, August 3, 2017 11:38 AM > > To: Zhang, Tina > > Cc: Tian, Kevin ; intel-...@lists.freedesktop.org; > > dri- > > de...@lists.freedesktop.org; kwankh...@nvidia.com; kra...@redhat.com; > > intel-gvt-...@lists.freedesktop.org; Wang, Zhi A ; Lv, > > Zhiyuan > > Subject: Re: [PATCH v13 5/7] vfio: ABI for mdev display dma-buf operation > > > > On Thu, 3 Aug 2017 03:17:09 + > > "Zhang, Tina" wrote: > > > > > > -Original Message- > > > > From: dri-devel [mailto:dri-devel-boun...@lists.freedesktop.org] On > > > > Behalf Of Alex Williamson > > > > Sent: Wednesday, August 2, 2017 5:18 AM > > > > To: Zhang, Tina > > > > Cc: Tian, Kevin ; kra...@redhat.com; intel- > > > > g...@lists.freedesktop.org; Wang, Zhi A ; > > > > kwankh...@nvidia.com; dri-devel@lists.freedesktop.org; intel-gvt- > > > > d...@lists.freedesktop.org; Lv, Zhiyuan > > > > Subject: Re: [PATCH v13 5/7] vfio: ABI for mdev display dma-buf > > > > operation > > > > > > > > On Tue, 25 Jul 2017 17:28:18 +0800 > > > > Tina Zhang wrote: > > > > > > > > > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user mode > > > > > query and get the plan and its related information. > > > > > > > > > > The dma-buf's life cycle is handled by user mode and tracked by > > > > > kernel. > > > > > The returned fd in struct vfio_device_query_gfx_plane can be a new > > > > > fd or an old fd of a re-exported dma-buf. Host User mode can check > > > > > the value of fd and to see if it needs to create new resource > > > > > according to the new fd or just use the existed resource related to > > > > > the old > > fd. > > > > > > > > > > Signed-off-by: Tina Zhang > > > > > --- > > > > > include/uapi/linux/vfio.h | 28 > > > > > 1 file changed, 28 insertions(+) > > > > > > > > > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > > > > > index ae46105..827a230 100644 > > > > > --- a/include/uapi/linux/vfio.h > > > > > +++ b/include/uapi/linux/vfio.h > > > > > @@ -502,6 +502,34 @@ struct vfio_pci_hot_reset { > > > > > > > > > > #define VFIO_DEVICE_PCI_HOT_RESET_IO(VFIO_TYPE, VFIO_BASE + > > > > 13) > > > > > > > > > > +/** > > > > > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + > > 14, > > > > > +struct vfio_device_query_gfx_plane) > > > > > + * > > > > > + * Set the drm_plane_type and retrieve information about the gfx > > > > > plane. > > > > > + * > > > > > + * Return: 0 on success, -errno on failure. > > > > > + */ > > > > > +struct vfio_device_gfx_plane_info { > > > > > + __u32 argsz; > > > > > + __u32 flags; > > > > > + /* in */ > > > > > + __u32 drm_plane_type; /* type of plane: DRM_PLANE_TYPE_* */ > > > > > + /* out */ > > > > > + __u32 drm_format; /* drm format of plane */ > > > > > + __u64 drm_format_mod; /* tiled mode */ > > > > > + __u32 width;/* width of plane */ > > > > > + __u32 height; /* height of plane */ > > > > > + __u32 stride; /* stride of plane */ > > > > > + __u32 size; /* size of plane in bytes, align on page*/ > > > > > + __u32 x_pos;/* horizontal position of cursor plane, upper > > > > > left corner > > > > in pixels */ > > > > > + __u32 y_pos;/* vertical position of cursor plane, upper > > > > > left corner in > > > > lines*/ > > > > > + __u32 region_index; > > > > > + __s32 fd; /* dma-buf fd */ > > > > > > > > How do I know which of these is valid, region_index or fd? Can I > > > > ask for one vs the other? What are the errno values to > > > > differentiate unsupported vs not initialized? Is there a "probe" > > > > flag that I can use to determine what the device supports without > > > > allocating > > those resources yet? > > > Dma-buf won't use region_index, which means region_index is zero all the > > time for dma-buf usage. > > > As we discussed, there won't be errno if not initialized, just keep all > > > fields zero. > > > I will add the comments about these in the next version. Thanks > > > > Zero is a valid region index. > If zero is valid, can we find out other invalid value? How about 0x? Unlikely, but also valid. Isn't this why we have a flags field in the structure, so we don't need to rely on implicit values as invalid. Also, all of the previously discussed usage models needs to be documented, either here in the header or in a Documentation/ file. Thanks, Alex ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/29] drm/atmel-hlcdc: switch to drm_*{get,put} helpers
On Thu, 3 Aug 2017 14:10:50 +0200 Boris Brezillon wrote: > On Thu, 3 Aug 2017 14:58:20 +0300 > Cihangir Akturk wrote: > > > drm_*_reference() and drm_*_unreference() functions are just > > compatibility alias for drm_*_get() and drm_*_put() adn should not be > > s/adn/and/ > > > used by new code. So convert all users of compatibility functions to use > > the new APIs. > > > > Signed-off-by: Cihangir Akturk > > Acked-by: Boris Brezillon Applied to drm-misc-next (as suggested by Daniel) after fixing the typo. Thanks, Boris > > > --- > > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 8 > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > > b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > > index 1124200..fc3f910 100644 > > --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > > +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > > @@ -809,7 +809,7 @@ static void atmel_hlcdc_plane_destroy(struct drm_plane > > *p) > > struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p); > > > > if (plane->base.fb) > > - drm_framebuffer_unreference(plane->base.fb); > > + drm_framebuffer_put(plane->base.fb); > > > > drm_plane_cleanup(p); > > } > > @@ -958,7 +958,7 @@ static void atmel_hlcdc_plane_reset(struct drm_plane *p) > > state = drm_plane_state_to_atmel_hlcdc_plane_state(p->state); > > > > if (state->base.fb) > > - drm_framebuffer_unreference(state->base.fb); > > + drm_framebuffer_put(state->base.fb); > > > > kfree(state); > > p->state = NULL; > > @@ -996,7 +996,7 @@ atmel_hlcdc_plane_atomic_duplicate_state(struct > > drm_plane *p) > > } > > > > if (copy->base.fb) > > - drm_framebuffer_reference(copy->base.fb); > > + drm_framebuffer_get(copy->base.fb); > > > > return ©->base; > > } > > @@ -1015,7 +1015,7 @@ static void > > atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p, > > } > > > > if (s->fb) > > - drm_framebuffer_unreference(s->fb); > > + drm_framebuffer_put(s->fb); > > > > kfree(state); > > } > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs.
On Mon, 3 Jul 2017 21:53:54 +0530 Arvind Yadav wrote: > drm_plane_helper_funcs and drm_plane_funcsare not supposed to change > at runtime. All functions working with drm_plane_helper_funcs and > drm_plane_funcs work with const. So mark the non-const structs as const. > > File size before: >text data bss dec hex filename >6072 596 066681a0c atmel_hlcdc_plane.o > > File size After adding 'const': >text data bss dec hex filename >6218 436 0665419fe atmel_hlcdc_plane.o > > Signed-off-by: Arvind Yadav Applied to drm-misc-next. Thanks, Boris > --- > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > index 29cc10d..ea72e1f 100644 > --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c > @@ -911,7 +911,7 @@ void atmel_hlcdc_plane_irq(struct atmel_hlcdc_plane > *plane) > desc->name); > } > > -static struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs = { > +static const struct drm_plane_helper_funcs > atmel_hlcdc_layer_plane_helper_funcs = { > .atomic_check = atmel_hlcdc_plane_atomic_check, > .atomic_update = atmel_hlcdc_plane_atomic_update, > .atomic_disable = atmel_hlcdc_plane_atomic_disable, > @@ -1020,7 +1020,7 @@ static void > atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p, > kfree(state); > } > > -static struct drm_plane_funcs layer_plane_funcs = { > +static const struct drm_plane_funcs layer_plane_funcs = { > .update_plane = drm_atomic_helper_update_plane, > .disable_plane = drm_atomic_helper_disable_plane, > .set_property = drm_atomic_helper_plane_set_property, ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Monochrome/greyscale and software dithering in the kernel
Hi, The tinydrm/repaper driver is monochrome, but I have just used an emulation format XRGB, since monochrome support is scarce in userspace. I'm using ITU BT.601 to convert from rgb to greyscale and then use the msb for monochrome. Now I'm asked if we can implement Floyd–Steinberg dithering in the driver to make it more useful, so userspace can work reasonably well with default tools/libs. I did have that in the first stage of the driver development, but decided against it, since I figured this was the responsibility of userspace not the kernel. But personally it doesn't really matter to me either way. So the question is, can I say yes to such an addition? Noralf. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 0/6] Support for LEGO MINDSTORMS EV3 LCD display
On 08/03/2017 09:07 AM, Noralf Trønnes wrote: Den 02.08.2017 00.26, skrev David Lechner: On 08/01/2017 01:08 PM, Noralf Trønnes wrote: (cc: Daniel Vetter) Den 01.08.2017 18.51, skrev David Lechner: On 07/30/2017 12:14 PM, Noralf Trønnes wrote: Den 29.07.2017 21.40, skrev David Lechner: On 07/29/2017 02:17 PM, David Lechner wrote: The goal of this series is to get the built-in LCD of the LEGO MINDSTORMS EV3 working. But, most of the content here is building up the infrastructure to do that. Some general comments/questions: I have noticed that DRM doesn't really have support for monochrome displays. I'm guessing that is because no one really uses them anymore? The repaper driver was the first monochrome drm driver and I chose to present it to userspace as XRGB and convert it to monochrome. The reason for this is that everything, libraries, apps, plymouth (boot splash, no rgb565) supports it. I didn't see any point in adding a new monochrome drm format that didn't have, or probably wouldn't get userspace support (by libraries at least). The application of course needs to know this to get a good result. tinydrm_xrgb_to_gray8() does the conversion: https://cgit.freedesktop.org/drm/drm-misc/commit/drivers/gpu/drm/tinydrm?id=379ea9a1a59a5a32c8db6f164e80a3fd00cb3781 The LEGO EV3 display is just an LCD (not the backlit kind). It has two modes of operation. It can to 2bbp grayscale or it can do 1bpp monochrome. The grayscale isn't the best (looks splotchy in places), so it would be nice to be able to choose between these two modes. How would I implement something like that? Do you expect anyone to use grayscale if it doesn't look good? Maybe better to add it later if there's a demand for it. I don't expect many people to use it at all. The people that do will be hackers like me that want to see what it is capable of, so I think I will keep it grayscale by default. It looks like the best way to satisfy your needs is to add specific formats. Video for Linux have these: include/uapi/linux/videodev2.h /* Grey formats */ #define V4L2_PIX_FMT_GREYv4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */ #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ #define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */ Maybe we can add formats like these: include/uapi/drm/drm_fourcc.h #define DRM_FORMAT_MONOfourcc_code('Y', '0', '1', ' ') /* [0] Monochrome */ or #define DRM_FORMAT_Y1fourcc_code('Y', '0', '1', ' ') /* [0] Monochrome */ #define DRM_FORMAT_Y2fourcc_code('Y', '0', '2', ' ') /* [1:0] Greyscale */ Daniel, what do you think? 2 of the first 3 tinydrm drivers are monochrome (and I would like to write a driver for the Seeed/Grove I2C OLED displays which are also monochrome), so I think the 1bpp modes would definitely be useful. David, I'm curious about those displays what controller/interface they use. I have been hoping that it would be possible to use regmap as an abstraction for many of these controllers and their registers. The particular display I have is this one: http://wiki.seeed.cc/Grove-OLED_Display_1.12inch/ It looks like it uses a command/data scheme like the MIPI displays, but doesn't use any of the standard values for the commands. The controller can do parallel, SPI and I2C, but the display I have is wired for I2C. For MIPI DCS it wasn't possible because it's command oriented with arguments. Since zero arguments is possible, a register with no value is nonsense, even though the regmap implementation happily let me do it. There's also the problem that regmap doesn't support registers with different widths. Which is a problem if all registers are 8-bit wide, except the GRAM register being 16-bit on RGB565 formats. regmap is especially helpful with controllers that also have gpios/keypad/touch/pwm, since the mfd (multi function device) subsystem has good support for sharing regmaps between drivers. Multi function devices are split into several drivers. Noralf. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: Monochrome/greyscale and software dithering in the kernel
On 08/03/2017 09:58 AM, Noralf Trønnes wrote: Hi, The tinydrm/repaper driver is monochrome, but I have just used an emulation format XRGB, since monochrome support is scarce in userspace. I'm using ITU BT.601 to convert from rgb to greyscale and then use the msb for monochrome. Now I'm asked if we can implement Floyd–Steinberg dithering in the driver to make it more useful, so userspace can work reasonably well with default tools/libs. I did have that in the first stage of the driver development, but decided against it, since I figured this was the responsibility of userspace not the kernel. But personally it doesn't really matter to me either way. So the question is, can I say yes to such an addition? IMHO, if we add monochorme/grayscale support to DRM, then I think using dithering for the "compatibility mode" XRGB emulation would be a good idea. But until then, I don't think I would like it because unless you are displaying photos it will probably causes some noticeable distortion. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 23/29] drm/tilcdc: switch to drm_*{get,put} helpers
On Thu, Aug 3, 2017 at 3:56 PM, Jyri Sarha wrote: > > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki > > On 08/03/17 14:58, Cihangir Akturk wrote: >> drm_*_reference() and drm_*_unreference() functions are just >> compatibility alias for drm_*_get() and drm_*_put() adn should not be >> used by new code. So convert all users of compatibility functions to use >> the new APIs. >> >> Signed-off-by: Cihangir Akturk > > Acked-by: Jyri Sarha > > This appears to be a part of a larger series. So I guess it will go in > via drm-misc. But if this is not the case just let me know and I'll add > this to my next pull request. Only if you join drm-misc and push it there yourself :-) In general I prefer driver maintainers pick up their stuff for patch series which don't have depencies like this here, otherwise, why exactly do we have driver maintainers. Thanks, Daniel > > Best Regards, > Jyri > >> --- >> drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c >> b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c >> index d524ed0..6e936dd 100644 >> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c >> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c >> @@ -75,7 +75,7 @@ static void unref_worker(struct drm_flip_work *work, void >> *val) >> struct drm_device *dev = tilcdc_crtc->base.dev; >> >> mutex_lock(&dev->mode_config.mutex); >> - drm_framebuffer_unreference(val); >> + drm_framebuffer_put(val); >> mutex_unlock(&dev->mode_config.mutex); >> } >> >> @@ -456,7 +456,7 @@ static void tilcdc_crtc_set_mode(struct drm_crtc *crtc) >> >> set_scanout(crtc, fb); >> >> - drm_framebuffer_reference(fb); >> + drm_framebuffer_get(fb); >> >> crtc->hwmode = crtc->state->adjusted_mode; >> } >> @@ -621,7 +621,7 @@ int tilcdc_crtc_update_fb(struct drm_crtc *crtc, >> return -EBUSY; >> } >> >> - drm_framebuffer_reference(fb); >> + drm_framebuffer_get(fb); >> >> crtc->primary->fb = fb; >> tilcdc_crtc->event = event; >> > > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: Monochrome/greyscale and software dithering in the kernel
On Thu, Aug 3, 2017 at 5:24 PM, David Lechner wrote: > On 08/03/2017 09:58 AM, Noralf Trønnes wrote: >> >> Hi, >> >> The tinydrm/repaper driver is monochrome, but I have just used an >> emulation format XRGB, since monochrome support is scarce in >> userspace. I'm using ITU BT.601 to convert from rgb to greyscale and >> then use the msb for monochrome. >> >> Now I'm asked if we can implement Floyd–Steinberg dithering in the driver >> to make it more useful, so userspace can work reasonably well with >> default tools/libs. I did have that in the first stage of the driver >> development, but decided against it, since I figured this was the >> responsibility of userspace not the kernel. But personally it doesn't >> really matter to me either way. >> >> So the question is, can I say yes to such an addition? >> > > IMHO, if we add monochorme/grayscale support to DRM, then I think using > dithering for the "compatibility mode" XRGB emulation would be a good > idea. But until then, I don't think I would like it because unless you are > displaying photos it will probably causes some noticeable distortion. I'd suggest for monochrome displays we forgo dithering entirely. The XRGB stuff is just there to make sure userspace can expect that format to work, but that's it. If you want your greyscale to look good, then pls directly render greyscale in userspace. There's 15+ years of history on why drm doesn't do any rendering in the kernel, and there's reasons for that. XRGB really was an exception since otherwise normal distro's won't even boot up, but that's going to be the _only_ exception. And we're going to make it work with the minimal amount of kernel code, i.e. no fancing dithering, scaling, interpolation or anything like that. Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: Monochrome/greyscale and software dithering in the kernel
Den 03.08.2017 17.46, skrev Daniel Vetter: On Thu, Aug 3, 2017 at 5:24 PM, David Lechner wrote: On 08/03/2017 09:58 AM, Noralf Trønnes wrote: Hi, The tinydrm/repaper driver is monochrome, but I have just used an emulation format XRGB, since monochrome support is scarce in userspace. I'm using ITU BT.601 to convert from rgb to greyscale and then use the msb for monochrome. Now I'm asked if we can implement Floyd–Steinberg dithering in the driver to make it more useful, so userspace can work reasonably well with default tools/libs. I did have that in the first stage of the driver development, but decided against it, since I figured this was the responsibility of userspace not the kernel. But personally it doesn't really matter to me either way. So the question is, can I say yes to such an addition? IMHO, if we add monochorme/grayscale support to DRM, then I think using dithering for the "compatibility mode" XRGB emulation would be a good idea. But until then, I don't think I would like it because unless you are displaying photos it will probably causes some noticeable distortion. I'd suggest for monochrome displays we forgo dithering entirely. The XRGB stuff is just there to make sure userspace can expect that format to work, but that's it. If you want your greyscale to look good, then pls directly render greyscale in userspace. There's 15+ years of history on why drm doesn't do any rendering in the kernel, and there's reasons for that. XRGB really was an exception since otherwise normal distro's won't even boot up, but that's going to be the _only_ exception. And we're going to make it work with the minimal amount of kernel code, i.e. no fancing dithering, scaling, interpolation or anything like that. Thanks for clarifying, now I have some real arguments instead of just a hunch. Noralf. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 0/2] drm/fb-helper: pass physical dimensions to fbdev
v1 changes (from RFC): * Use loop to get info from first connected connector instead of just the first connector. v2 changes: * Update width in height in drm_setup_crtcs() also to handle hotplug events. v3 changes: * Add new patch to handle post-fb allocation crcts setup. * Use new drm_setup_crtcs_fb() function from new patch to avoid duplication of code. David Lechner (2): drm/fb-helper: add new drm_setup_crtcs_fb() function drm/fb-helper: pass physical dimensions to fbdev drivers/gpu/drm/drm_fb_helper.c | 45 - 1 file changed, 31 insertions(+), 14 deletions(-) -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 2/2] drm/fb-helper: pass physical dimensions to fbdev
The fbdev subsystem has a place for physical dimensions (width and height in mm) that is readable by userspace. Since DRM also knows these dimensions, pass this information to the fbdev device. This has to be done in drm_setup_crtcs_fb() instead of drm_setup_crtcs() because fb_helper->fbdev may be NULL in drm_setup_crtcs(). Signed-off-by: David Lechner --- drivers/gpu/drm/drm_fb_helper.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 24a721a..a98bf86 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1882,8 +1882,6 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe info->var.xoffset = 0; info->var.yoffset = 0; info->var.activate = FB_ACTIVATE_NOW; - info->var.height = -1; - info->var.width = -1; switch (fb->format->depth) { case 8: @@ -2435,11 +2433,24 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper, */ static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper) { + struct fb_info *info = fb_helper->fbdev; int i; for (i = 0; i < fb_helper->crtc_count; i++) if (fb_helper->crtc_info[i].mode_set.num_connectors) fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; + + drm_fb_helper_for_each_connector(fb_helper, i) { + struct drm_connector *connector = + fb_helper->connector_info[i]->connector; + + /* use first connected connector for the physical dimensions */ + if (connector->status == connector_status_connected) { + info->var.height = connector->display_info.width_mm; + info->var.width = connector->display_info.height_mm; + break; + } + } } /* Note: Drops fb_helper->lock before returning. */ -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 1/2] drm/fb-helper: add new drm_setup_crtcs_fb() function
This adds a new drm_setup_crtcs_fb() function to handle the parts of drm_setup_crtcs() that touch fb_helper->fb and fb_helper->fbdev. When drm_setup_crtcs() is called during initialization, these fields are NULL because they have not been allocated yet. There is currently a hack at the end of drm_fb_helper_single_fb_probe() that sets fb_helper->fb, so it is moved to the new drm_setup_crtcs_fb() function. This is also done in preparation for addition setup that requires access to fb_helper->fbdev. Signed-off-by: David Lechner --- drivers/gpu/drm/drm_fb_helper.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index b2a01d1..24a721a 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1821,17 +1821,6 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, if (ret < 0) return ret; - /* -* Set the fb pointer - usually drm_setup_crtcs does this for hotplug -* events, but at init time drm_setup_crtcs needs to be called before -* the fb is allocated (since we need to figure out the desired size of -* the fb before we can allocate it ...). Hence we need to fix things up -* here again. -*/ - for (i = 0; i < fb_helper->crtc_count; i++) - if (fb_helper->crtc_info[i].mode_set.num_connectors) - fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; - return 0; } @@ -2426,7 +2415,6 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper, fb_crtc->desired_mode); drm_connector_get(connector); modeset->connectors[modeset->num_connectors++] = connector; - modeset->fb = fb_helper->fb; modeset->x = offset->x; modeset->y = offset->y; } @@ -2438,6 +2426,22 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper, kfree(enabled); } +/* + * This is a continuation of drm_setup_crtcs() that sets up anything related + * to the framebuffer. During initialization, drm_setup_crtcs() is called before + * the framebuffer has been allocated (fb_helper->fb and fb_helper->fbdev). + * So, any setup that touches those fields needs to be done here instead of in + * drm_setup_crtcs(). + */ +static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper) +{ + int i; + + for (i = 0; i < fb_helper->crtc_count; i++) + if (fb_helper->crtc_info[i].mode_set.num_connectors) + fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; +} + /* Note: Drops fb_helper->lock before returning. */ static int __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper, @@ -2463,6 +2467,7 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper, return ret; } + drm_setup_crtcs_fb(fb_helper); fb_helper->deferred_setup = false; @@ -2591,6 +2596,7 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) DRM_DEBUG_KMS("\n"); drm_setup_crtcs(fb_helper, fb_helper->fb->width, fb_helper->fb->height); + drm_setup_crtcs_fb(fb_helper); mutex_unlock(&fb_helper->lock); drm_fb_helper_set_par(fb_helper->fbdev); -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/5] drm/syncobj: add sync_file interaction.
Quoting Dave Airlie (2017-05-12 01:34:55) > @@ -385,6 +434,13 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, > void *data, > if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ)) > return -ENODEV; > > + if (args->flags & > DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE_FENCE) > + return drm_syncobj_import_sync_file_fence(file_private, > + args->fd, > + args->handle); > + else if (args->flags) > + return -EINVAL; Argh, what I missed before was that importing from a sync_file reuses the handle, but importing from a syncobj fd creates a new handle. Just venting my ocd. It would be nice if the interface was consistent, and I can see arguments for both approaches (just not a good argument as to why they should differ). A compromise would be a flag to create/reuse handle (or if handle=0, create, if handle!=0 resuse). -Chris ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 20/29] drm/radeon: switch to drm_*{get,put} helpers
On Thu, Aug 3, 2017 at 8:08 AM, Christian König wrote: > Am 03.08.2017 um 13:58 schrieb Cihangir Akturk: >> >> drm_*_reference() and drm_*_unreference() functions are just >> compatibility alias for drm_*_get() and drm_*_put() adn should not be >> used by new code. So convert all users of compatibility functions to use >> the new APIs. >> >> Signed-off-by: Cihangir Akturk > > > Reviewed-by: Christian König > Applied this and the radeon one. Thanks! Alex > >> --- >> drivers/gpu/drm/radeon/radeon_cs.c | 2 +- >> drivers/gpu/drm/radeon/radeon_cursor.c | 6 +++--- >> drivers/gpu/drm/radeon/radeon_display.c | 12 ++-- >> drivers/gpu/drm/radeon/radeon_fb.c | 4 ++-- >> drivers/gpu/drm/radeon/radeon_gem.c | 30 >> +++--- >> drivers/gpu/drm/radeon/radeon_object.c | 2 +- >> 6 files changed, 28 insertions(+), 28 deletions(-) >> >> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c >> b/drivers/gpu/drm/radeon/radeon_cs.c >> index 00b22af..ea0db26 100644 >> --- a/drivers/gpu/drm/radeon/radeon_cs.c >> +++ b/drivers/gpu/drm/radeon/radeon_cs.c >> @@ -437,7 +437,7 @@ static void radeon_cs_parser_fini(struct >> radeon_cs_parser *parser, int error, bo >> if (bo == NULL) >> continue; >> - >> drm_gem_object_unreference_unlocked(&bo->gem_base); >> + drm_gem_object_put_unlocked(&bo->gem_base); >> } >> } >> kfree(parser->track); >> diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c >> b/drivers/gpu/drm/radeon/radeon_cursor.c >> index 4a4f953..9195227 100644 >> --- a/drivers/gpu/drm/radeon/radeon_cursor.c >> +++ b/drivers/gpu/drm/radeon/radeon_cursor.c >> @@ -307,7 +307,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, >> robj = gem_to_radeon_bo(obj); >> ret = radeon_bo_reserve(robj, false); >> if (ret != 0) { >> - drm_gem_object_unreference_unlocked(obj); >> + drm_gem_object_put_unlocked(obj); >> return ret; >> } >> /* Only 27 bit offset for legacy cursor */ >> @@ -317,7 +317,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, >> radeon_bo_unreserve(robj); >> if (ret) { >> DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret); >> - drm_gem_object_unreference_unlocked(obj); >> + drm_gem_object_put_unlocked(obj); >> return ret; >> } >> @@ -352,7 +352,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, >> radeon_bo_unpin(robj); >> radeon_bo_unreserve(robj); >> } >> - >> drm_gem_object_unreference_unlocked(radeon_crtc->cursor_bo); >> + drm_gem_object_put_unlocked(radeon_crtc->cursor_bo); >> } >> radeon_crtc->cursor_bo = obj; >> diff --git a/drivers/gpu/drm/radeon/radeon_display.c >> b/drivers/gpu/drm/radeon/radeon_display.c >> index 17d3daf..adbf28c 100644 >> --- a/drivers/gpu/drm/radeon/radeon_display.c >> +++ b/drivers/gpu/drm/radeon/radeon_display.c >> @@ -282,7 +282,7 @@ static void radeon_unpin_work_func(struct work_struct >> *__work) >> } else >> DRM_ERROR("failed to reserve buffer after flip\n"); >> - drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); >> + drm_gem_object_put_unlocked(&work->old_rbo->gem_base); >> kfree(work); >> } >> @@ -519,7 +519,7 @@ static int radeon_crtc_page_flip_target(struct >> drm_crtc *crtc, >> obj = old_radeon_fb->obj; >> /* take a reference to the old object */ >> - drm_gem_object_reference(obj); >> + drm_gem_object_get(obj); >> work->old_rbo = gem_to_radeon_bo(obj); >> new_radeon_fb = to_radeon_framebuffer(fb); >> @@ -618,7 +618,7 @@ static int radeon_crtc_page_flip_target(struct >> drm_crtc *crtc, >> radeon_bo_unreserve(new_rbo); >> cleanup: >> - drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); >> + drm_gem_object_put_unlocked(&work->old_rbo->gem_base); >> dma_fence_put(work->fence); >> kfree(work); >> return r; >> @@ -1303,7 +1303,7 @@ static void radeon_user_framebuffer_destroy(struct >> drm_framebuffer *fb) >> { >> struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb); >> - drm_gem_object_unreference_unlocked(radeon_fb->obj); >> + drm_gem_object_put_unlocked(radeon_fb->obj); >> drm_framebuffer_cleanup(fb); >> kfree(radeon_fb); >> } >> @@ -1363,14 +1363,14 @@ radeon_user_framebuffer_create(struct drm_device >> *dev, >> radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL); >> if (radeon_fb == NULL) { >> - drm_gem_object_unreference_unlocked(obj); >> + drm_gem_object_put_unlocked(obj); >> return ERR_PTR(-ENOMEM); >> } >> ret = radeon_framebuffer_init(dev, radeon_
Re: [PATCH] i915: Add support for drm syncobjs
Quoting Jason Ekstrand (2017-07-05 22:15:09) > On Wed, Jul 5, 2017 at 2:13 PM, Jason Ekstrand wrote: > > This commit adds support for waiting on or signaling DRM syncobjs as > part of execbuf. It does so by hijacking the currently unused cliprects > pointer to instead point to an array of i915_gem_exec_fence structs > which containe a DRM syncobj and a flags parameter which specifies > whether to wait on it or to signal it. This implementation > theoretically allows for both flags to be set in which case it waits on > the dma_fence that was in the syncobj and then immediately replaces it > with the dma_fence from the current execbuf. > > v2: > - Rebase on new syncobj API > v3: > - Pull everything out into helpers > - Do all allocation in gem_execbuffer2 > - Pack the flags in the bottom 2 bits of the drm_syncobj* Just noticed, no sign off. Could you please check https://developercertificate.org/ and apply your Signed-off-by, just a reply will do. > +static int await_fence_array(struct i915_execbuffer *eb, > + struct drm_syncobj **fences) > +{ > + const unsigned int nfences = eb->args->num_cliprects; > + unsigned int n; > + int err; > + > + for (n = 0; n < nfences; n++) { > + struct drm_syncobj *syncobj; > + unsigned int flags; > + > + syncobj = ptr_unpack_bits(fences[n], &flags, 2); > + if (!(flags & I915_EXEC_FENCE_WAIT)) > + continue; > + > + err = i915_gem_request_await_dma_fence(eb->request, > + syncobj->fence); > > > Is there a race here? What happens if some other process replaces the fence > between the syncobj->fence lookup and gem_request_await_dma_fence taking its > reference? Yes. It's inherently racy be via from objects, dmabuf or explicit fences. We obtain a snapshot of fences, and the only condition we must impose is that they are not cyclic - i.e. we must complete the snapshot of all fences before exposing our new &request->fence to the world. As to the race where the fence pointed to may change whilst we inspect it, there is nothing we can do to prevent that nor define what the right behaviour is. It is up to userspace to apply its own execution barriers if it requires strict control over the ordering of fences, i.e. what does if mean if client B changed the fence whilst client A was executing? Should client A use the original fence or the new fence? If it matters, the two clients need to coordinate usage of their shared fence. -Chris ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 0/6] Support for LEGO MINDSTORMS EV3 LCD display
On Thu, Aug 3, 2017 at 6:18 PM, David Lechner wrote: > The particular display I have is this one: > http://wiki.seeed.cc/Grove-OLED_Display_1.12inch/ > > It looks like it uses a command/data scheme like the MIPI displays, but > doesn't use any of the standard values for the commands. The controller can > do parallel, SPI and I2C, but the display I have is wired for I2C. It looks very similar to ssd1306. Some description refers to ssd1308. -- With Best Regards, Andy Shevchenko ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 0/6] Support for LEGO MINDSTORMS EV3 LCD display
On Thu, Aug 3, 2017 at 8:09 PM, Andy Shevchenko wrote: > On Thu, Aug 3, 2017 at 6:18 PM, David Lechner wrote: > >> The particular display I have is this one: >> http://wiki.seeed.cc/Grove-OLED_Display_1.12inch/ >> >> It looks like it uses a command/data scheme like the MIPI displays, but >> doesn't use any of the standard values for the commands. The controller can >> do parallel, SPI and I2C, but the display I have is wired for I2C. > > It looks very similar to ssd1306. Some description refers to ssd1308. http://www.mouser.com/catalog/specsheets/Seeed_104030008.pdf -- With Best Regards, Andy Shevchenko ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 6/6] drm/i915: Add support for CCS modifiers
On 17-08-03 10:08:51, Daniel Vetter wrote: On Wed, Aug 2, 2017 at 5:43 PM, Ben Widawsky wrote: On 17-08-02 12:14:15, Daniel Vetter wrote: On Tue, Aug 01, 2017 at 09:14:50AM -0700, Ben Widawsky wrote: On 17-07-31 10:29:55, Daniel Vetter wrote: > On Sat, Jul 29, 2017 at 09:25:50AM -0700, Ben Widawsky wrote: > > On 17-07-29 13:53:10, Daniel Stone wrote: > > > Hi Ben, > > > > > > On 26 July 2017 at 19:08, Ben Widawsky wrote: > > > > + } else if (INTEL_GEN(dev_priv) >= 9) { > > > > intel_primary_formats = skl_primary_formats; > > > > num_formats = ARRAY_SIZE(skl_primary_formats); > > > > - modifiers = skl_format_modifiers; > > > > + if (pipe >= PIPE_C) > > > > + modifiers = skl_format_modifiers_ccs; > > > > + else > > > > + modifiers = skl_format_modifiers_noccs; > > > > > > Shouldn't that be (pipe < PIPE_C)? > > > > > > Cheers, > > > Daniel > > > > Yep. It was wrong in v7 too :/. I have it fixed locally. > > Shouldn't the igt catch this, or does it not try to exercise all the > plane/crtc combos there are? > -Daniel I don't know whether or not IGT should have caught this, but it wouldn't have because I had been sending these without Ville's patches, so my patches alone don't even build (since his patches defined the modifiers). You can run igt testcases locally. I expect you to do that, at least for the stuff you're touching. Does this mean there's no igts for this at all? -Daniel I haven't been running IGT locally, so I don't know if they touch this path. We've done all testing so far with kmscube, X, and weston; then measure the overall bandwidth. In this case, I'd stop testing these since Jason/Daniel took over my other patches. I don't even know how to locally make sure I get a display on pipe C. You could easily make an IGT make sure that you get back the right list of modifiers for a given pipe on a given GEN. Probably should do one. That's not a terribly interesting testcase (we have none of this kind I think). But I thought there was a CCS igt that created some simple compressed buffers and tried to display them, and then checked it all looked good using crcs, i.e. an actual functional testcase, and that should have caught the mislisten on pipe C (if it bothered to test all planes that expose the CCS modifier). Iirc Ville had that. We do need that for merging the kernel side. Thanks, Daniel Yeah, we did have that already - just nothing for blobifiers specifically. It sounds like igt_ccs is broken at the moment. -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 6/6] [v4] drm/i915: Add support for CCS modifiers
On 17-08-03 12:00:56, Daniel Stone wrote: Hi, On 1 August 2017 at 17:58, Ben Widawsky wrote: @@ -1240,6 +1253,19 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv, plane_formats = skl_plane_formats; num_plane_formats = ARRAY_SIZE(skl_plane_formats); modifiers = skl_plane_format_modifiers; + } else if (INTEL_GEN(dev_priv) >= 9) { + intel_plane->can_scale = true; + state->scaler_id = -1; + + intel_plane->update_plane = skl_update_plane; + intel_plane->disable_plane = skl_disable_plane; + + plane_formats = skl_plane_formats; + num_plane_formats = ARRAY_SIZE(skl_plane_formats); + if (pipe >= PIPE_C) if (pipe >= PIPE_C || plane >= PLANE_SPRITE1) cf. skl_check_ccs_aux_surface() which rejects CCS on anything other than PRIMARY/SPRITE0. I'll squash when pushing. Cheers, Daniel Okay, thanks. With universal planes however, I don't think we need such a restriction, but whatevs ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 23/29] drm/tilcdc: switch to drm_*{get,put} helpers
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki On 08/03/17 18:42, Daniel Vetter wrote: > On Thu, Aug 3, 2017 at 3:56 PM, Jyri Sarha wrote: >> >> On 08/03/17 14:58, Cihangir Akturk wrote: >>> drm_*_reference() and drm_*_unreference() functions are just >>> compatibility alias for drm_*_get() and drm_*_put() adn should not be >>> used by new code. So convert all users of compatibility functions to use >>> the new APIs. >>> >>> Signed-off-by: Cihangir Akturk >> Acked-by: Jyri Sarha >> >> This appears to be a part of a larger series. So I guess it will go in >> via drm-misc. But if this is not the case just let me know and I'll add >> this to my next pull request. > Only if you join drm-misc and push it there yourself :-) > > In general I prefer driver maintainers pick up their stuff for patch > series which don't have depencies like this here, otherwise, why > exactly do we have driver maintainers. > I assumed that the series would deprecate drm_framebuffer_unreference() and -reference() aliases (if we are cleaning things up, why wouldn't we go all the way?). But if that is not the case, then by all means I'll pick the patch for a 4.14 tilcdc pull request. Cheers, Jyri ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/4] drm: Only lastclose on unload for legacy drivers
On Thu, Aug 3, 2017 at 9:54 AM, Daniel Vetter wrote: > On Thu, Aug 3, 2017 at 1:17 AM, Daniel Vetter wrote: >> On Wed, Aug 2, 2017 at 10:50 PM, Alex Deucher wrote: >>> On Wed, Aug 2, 2017 at 7:56 AM, Daniel Vetter >>> wrote: The only thing modern drivers are supposed to do in lastclose is restore the fb emulation state. Which is entirely optional, and there's really no reason to do that. So restrict it to legacy drivers (where the driver cleanup essentially happens in lastclose). >>> >>> vga_switcheroo_process_delayed_switch() gets called in lastclose. >>> Won't that need to get moved elsewhere for this to work? >> >> Hm right, I forgot the lazy way to do runtime pm by keeping the device >> alive as long as anyone has an open fd for it ... This shouldn't be a >> problem, since you need to unregister from vgaswitcheroo anyway on >> unload. Maybe that blows up, I'll check the code and augment the patch >> as needed. > > So I think there's 3 cases: > - Trying to unload the module. You can't do that while anyone has the > fd still open, so lastclose is guaranteeed to run. > - Forcefully unbinding the driver through sysfs. Not any better, since > the can_switch stuff checks for the open count, and so will delay the > delayed switch no matter what. > - Actual hotremoval: a) not implemented since none of the drivers > taking part in vgaswitcheroo correctly unplug the drm device and b) > you can't hotremove a chip from a laptop. > > So I think I'm not breaking this anymore than it probably already is :-) Thanks. This series is: Reviewed-by: Alex Deucher > -Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCHv5 3/3] ARM:drm ivip Intel FPGA Video and Image Processing Suite
On 08/02/2017 10:01 PM, Hean Loong, Ong wrote: > From: Ong Hean Loong > Really needs a short commit description. > Signed-off-by: Ong Hean Loong > --- > V5: > *Fix Comments > > V4: > *Fix Comments > > V3: > *Changes to fixing drm_simple_pipe > *Used drm_fb_cma_get_gem_addr > > V2: > *Adding drm_simple_display_pipe_init > > --- > > diff --git a/drivers/gpu/drm/ivip/Kconfig b/drivers/gpu/drm/ivip/Kconfig > new file mode 100644 > index 000..9a8c5ce > --- /dev/null > +++ b/drivers/gpu/drm/ivip/Kconfig > @@ -0,0 +1,13 @@ > +config DRM_IVIP > +tristate "Intel FGPA Video and Image Processing" > +depends on DRM && OF > +select DRM_GEM_CMA_HELPER > +select DRM_KMS_HELPER > +select DRM_KMS_FB_HELPER > +select DRM_KMS_CMA_HELPER > +help > +Choose this option if you have a Intel FPGA Arria 10 system an Intel > +and above with a Display Port IP. This does not support legacy > +Intel FPGA Cyclone V display port. Currently only single frame > +buffer is supported. Note that ACPI and X_86 architecture is yet > +to be supported.If M is selected the module would be called ivip. supoorted. If M will > diff --git a/drivers/gpu/drm/ivip/Makefile b/drivers/gpu/drm/ivip/Makefile > new file mode 100644 > index 000..95291c6 > --- /dev/null > +++ b/drivers/gpu/drm/ivip/Makefile > @@ -0,0 +1,9 @@ > +# > +# Makefile for the drm device driver. This driver provides support for the > +# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. > + > +ccflags-y := -Iinclude/drm > + > +obj-$(CONFIG_DRM_IVIP) += ivip.o > +ivip-objs := intel_vip_of.o intel_vip_core.o \ > +intel_vip_conn.o Please indent continuation lines in Makefiles. -- ~Randy ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 05/29] drm/atmel-hlcdc: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 1124200..fc3f910 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -809,7 +809,7 @@ static void atmel_hlcdc_plane_destroy(struct drm_plane *p) struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p); if (plane->base.fb) - drm_framebuffer_unreference(plane->base.fb); + drm_framebuffer_put(plane->base.fb); drm_plane_cleanup(p); } @@ -958,7 +958,7 @@ static void atmel_hlcdc_plane_reset(struct drm_plane *p) state = drm_plane_state_to_atmel_hlcdc_plane_state(p->state); if (state->base.fb) - drm_framebuffer_unreference(state->base.fb); + drm_framebuffer_put(state->base.fb); kfree(state); p->state = NULL; @@ -996,7 +996,7 @@ atmel_hlcdc_plane_atomic_duplicate_state(struct drm_plane *p) } if (copy->base.fb) - drm_framebuffer_reference(copy->base.fb); + drm_framebuffer_get(copy->base.fb); return ©->base; } @@ -1015,7 +1015,7 @@ static void atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p, } if (s->fb) - drm_framebuffer_unreference(s->fb); + drm_framebuffer_put(s->fb); kfree(state); } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 21/29] drm/rockchip: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/rockchip/rockchip_drm_fb.c| 6 +++--- drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 4 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 81f9548..a933b58 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c @@ -48,7 +48,7 @@ static void rockchip_drm_fb_destroy(struct drm_framebuffer *fb) int i; for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++) - drm_gem_object_unreference_unlocked(rockchip_fb->obj[i]); + drm_gem_object_put_unlocked(rockchip_fb->obj[i]); drm_framebuffer_cleanup(fb); kfree(rockchip_fb); @@ -144,7 +144,7 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, width * drm_format_plane_cpp(mode_cmd->pixel_format, i); if (obj->size < min_size) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); ret = -EINVAL; goto err_gem_object_unreference; } @@ -161,7 +161,7 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, err_gem_object_unreference: for (i--; i >= 0; i--) - drm_gem_object_unreference_unlocked(objs[i]); + drm_gem_object_put_unlocked(objs[i]); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c b/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c index ce946b9..724579e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c @@ -173,7 +173,7 @@ void rockchip_drm_fbdev_fini(struct drm_device *dev) drm_fb_helper_unregister_fbi(helper); if (helper->fb) - drm_framebuffer_unreference(helper->fb); + drm_framebuffer_put(helper->fb); drm_fb_helper_fini(helper); } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index b74ac71..9f880d0 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -383,7 +383,7 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, goto err_handle_create; /* drop reference from allocate - handle holds it now. */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return rk_obj; @@ -414,7 +414,7 @@ int rockchip_gem_dumb_map_offset(struct drm_file *file_priv, DRM_DEBUG_KMS("offset = 0x%llx\n", *offset); out: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 5d45033..12e17e6 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1065,7 +1065,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, if (old_plane_state->fb == plane->state->fb) continue; - drm_framebuffer_reference(old_plane_state->fb); + drm_framebuffer_get(old_plane_state->fb); drm_flip_work_queue(&vop->fb_unref_work, old_plane_state->fb); set_bit(VOP_PENDING_FB_UNREF, &vop->pending); WARN_ON(drm_crtc_vblank_get(crtc) != 0); @@ -1189,7 +1189,7 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) struct drm_framebuffer *fb = val; drm_crtc_vblank_put(&vop->crtc); - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); } static void vop_handle_vblank(struct vop *vop) -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 08/29] drm/etnaviv: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/etnaviv/etnaviv_drv.c| 8 drivers/gpu/drm/etnaviv/etnaviv_gem.c| 20 ++-- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 91e17ae..2cb4773 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -316,7 +316,7 @@ static int etnaviv_ioctl_gem_cpu_prep(struct drm_device *dev, void *data, ret = etnaviv_gem_cpu_prep(obj, args->op, &TS(args->timeout)); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } @@ -337,7 +337,7 @@ static int etnaviv_ioctl_gem_cpu_fini(struct drm_device *dev, void *data, ret = etnaviv_gem_cpu_fini(obj); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } @@ -357,7 +357,7 @@ static int etnaviv_ioctl_gem_info(struct drm_device *dev, void *data, return -ENOENT; ret = etnaviv_gem_mmap_offset(obj, &args->offset); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } @@ -446,7 +446,7 @@ static int etnaviv_ioctl_gem_wait(struct drm_device *dev, void *data, ret = etnaviv_gem_wait_bo(gpu, obj, timeout); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index 9a3bea7..e36fbb9 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -265,7 +265,7 @@ void etnaviv_gem_mapping_reference(struct etnaviv_vram_mapping *mapping) { struct etnaviv_gem_object *etnaviv_obj = mapping->object; - drm_gem_object_reference(&etnaviv_obj->base); + drm_gem_object_get(&etnaviv_obj->base); mutex_lock(&etnaviv_obj->lock); WARN_ON(mapping->use == 0); @@ -282,7 +282,7 @@ void etnaviv_gem_mapping_unreference(struct etnaviv_vram_mapping *mapping) mapping->use -= 1; mutex_unlock(&etnaviv_obj->lock); - drm_gem_object_unreference_unlocked(&etnaviv_obj->base); + drm_gem_object_put_unlocked(&etnaviv_obj->base); } struct etnaviv_vram_mapping *etnaviv_gem_mapping_get( @@ -358,7 +358,7 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get( return ERR_PTR(ret); /* Take a reference on the object */ - drm_gem_object_reference(obj); + drm_gem_object_get(obj); return mapping; } @@ -671,7 +671,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev, return obj; fail: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(ret); } @@ -688,14 +688,14 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file, ret = etnaviv_gem_obj_add(dev, obj); if (ret < 0) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } ret = drm_gem_handle_create(file, obj, handle); /* drop reference from allocate - handle holds it now */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } @@ -712,7 +712,7 @@ struct drm_gem_object *etnaviv_gem_new(struct drm_device *dev, ret = etnaviv_gem_obj_add(dev, obj); if (ret < 0) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(ret); } @@ -800,7 +800,7 @@ static void __etnaviv_gem_userptr_get_pages(struct work_struct *_work) } mutex_unlock(&etnaviv_obj->lock); - drm_gem_object_unreference_unlocked(&etnaviv_obj->base); + drm_gem_object_put_unlocked(&etnaviv_obj->base); mmput(work->mm); put_task_struct(work->task); @@ -858,7 +858,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj) } get_task_struct(current); - drm_gem_object_reference(&etnaviv_obj->base); + drm_gem_object_get(&etnaviv_obj->base); work->mm = mm; work->task = current; @@ -924,6 +924,6 @@ int etnaviv_gem_new_userptr(struct drm_device *dev, struct drm_file *file, ret = drm_gem_handle_create(file, &etnaviv_obj->base, handle); unreference: /* drop reference from al
[PATCH 26/29] drm/vgem: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/vgem/vgem_drv.c | 4 ++-- drivers/gpu/drm/vgem/vgem_fence.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index 18f401b..8a68fc2 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -183,7 +183,7 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev, return ERR_CAST(obj); ret = drm_gem_handle_create(file, &obj->base, handle); - drm_gem_object_unreference_unlocked(&obj->base); + drm_gem_object_put_unlocked(&obj->base); if (ret) goto err; @@ -238,7 +238,7 @@ static int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev, *offset = drm_vma_node_offset_addr(&obj->vma_node); unref: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index 3109c83..8fd52f2 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c @@ -213,7 +213,7 @@ int vgem_fence_attach_ioctl(struct drm_device *dev, dma_fence_put(fence); } err: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 23/29] drm/tilcdc: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index d524ed0..6e936dd 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -75,7 +75,7 @@ static void unref_worker(struct drm_flip_work *work, void *val) struct drm_device *dev = tilcdc_crtc->base.dev; mutex_lock(&dev->mode_config.mutex); - drm_framebuffer_unreference(val); + drm_framebuffer_put(val); mutex_unlock(&dev->mode_config.mutex); } @@ -456,7 +456,7 @@ static void tilcdc_crtc_set_mode(struct drm_crtc *crtc) set_scanout(crtc, fb); - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); crtc->hwmode = crtc->state->adjusted_mode; } @@ -621,7 +621,7 @@ int tilcdc_crtc_update_fb(struct drm_crtc *crtc, return -EBUSY; } - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); crtc->primary->fb = fb; tilcdc_crtc->event = event; -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 03/29] drm/armada: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/armada/armada_crtc.c| 22 +++--- drivers/gpu/drm/armada/armada_drv.c | 2 +- drivers/gpu/drm/armada/armada_fb.c | 8 drivers/gpu/drm/armada/armada_fbdev.c | 6 +++--- drivers/gpu/drm/armada/armada_gem.c | 14 +++--- drivers/gpu/drm/armada/armada_overlay.c | 4 ++-- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 4fe19fd..8c6366e 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -298,7 +298,7 @@ static void armada_drm_crtc_finish_fb(struct armada_crtc *dcrtc, if (force) { /* Display is disabled, so just drop the old fb */ - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); return; } @@ -321,7 +321,7 @@ static void armada_drm_crtc_finish_fb(struct armada_crtc *dcrtc, * the best. The worst that will happen is the buffer gets * reused before it has finished being displayed. */ - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); } static void armada_drm_vblank_off(struct armada_crtc *dcrtc) @@ -587,7 +587,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc, unsigned i; bool interlaced; - drm_framebuffer_reference(crtc->primary->fb); + drm_framebuffer_get(crtc->primary->fb); interlaced = !!(adj->flags & DRM_MODE_FLAG_INTERLACE); @@ -728,7 +728,7 @@ static int armada_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, MAX_SCHEDULE_TIMEOUT); /* Take a reference to the new fb as we're using it */ - drm_framebuffer_reference(crtc->primary->fb); + drm_framebuffer_get(crtc->primary->fb); /* Update the base in the CRTC */ armada_drm_crtc_update_regs(dcrtc, regs); @@ -752,7 +752,7 @@ void armada_drm_crtc_plane_disable(struct armada_crtc *dcrtc, * primary plane. */ if (plane->fb) - drm_framebuffer_unreference(plane->fb); + drm_framebuffer_put(plane->fb); /* Power down the Y/U/V FIFOs */ sram_para1 = CFG_PDWN16x66 | CFG_PDWN32x66; @@ -957,13 +957,13 @@ static int armada_drm_crtc_cursor_set(struct drm_crtc *crtc, /* Must be a kernel-mapped object */ if (!obj->addr) { - drm_gem_object_unreference_unlocked(&obj->obj); + drm_gem_object_put_unlocked(&obj->obj); return -EINVAL; } if (obj->obj.size < w * h * 4) { DRM_ERROR("buffer is too small\n"); - drm_gem_object_unreference_unlocked(&obj->obj); + drm_gem_object_put_unlocked(&obj->obj); return -ENOMEM; } } @@ -971,7 +971,7 @@ static int armada_drm_crtc_cursor_set(struct drm_crtc *crtc, if (dcrtc->cursor_obj) { dcrtc->cursor_obj->update = NULL; dcrtc->cursor_obj->update_data = NULL; - drm_gem_object_unreference_unlocked(&dcrtc->cursor_obj->obj); + drm_gem_object_put_unlocked(&dcrtc->cursor_obj->obj); } dcrtc->cursor_obj = obj; dcrtc->cursor_w = w; @@ -1007,7 +1007,7 @@ static void armada_drm_crtc_destroy(struct drm_crtc *crtc) struct armada_private *priv = crtc->dev->dev_private; if (dcrtc->cursor_obj) - drm_gem_object_unreference_unlocked(&dcrtc->cursor_obj->obj); + drm_gem_object_put_unlocked(&dcrtc->cursor_obj->obj); priv->dcrtc[dcrtc->num] = NULL; drm_crtc_cleanup(&dcrtc->crtc); @@ -1055,12 +1055,12 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc, * Ensure that we hold a reference on the new framebuffer. * This has to match the behaviour in mode_set. */ - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); ret = armada_drm_crtc_queue_frame_work(dcrtc, work); if (ret) { /* Undo our reference above */ - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); kfree(work); return ret; } diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index e618fab..46cee21 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -26,7 +26,7 @@ static void armada_drm_unref_work(struct work_struct *work) struct drm_framebuffer *fb;
Re: [PATCH 12/29] drm/i915: switch to drm_*{get,put} helpers
On Thu, Aug 03, 2017 at 02:49:03PM +0200, Daniel Vetter wrote: > On Thu, Aug 03, 2017 at 03:26:01PM +0300, Jani Nikula wrote: > > On Thu, 03 Aug 2017, Cihangir Akturk wrote: > > > drm_*_reference() and drm_*_unreference() functions are just > > > compatibility alias for drm_*_get() and drm_*_put() adn should not be > > > used by new code. So convert all users of compatibility functions to use > > > the new APIs. > > > > Please include the cocci script in the commit message. If you didn't use > > cocci, you should check it out! :) > > Yeah I assume you've created these with spatch/cocci, not with your own > script. I trust cocci a lot more than any kind of scripting, and the > coccie patch is already in there kernel (the commits you've cited in the > cover letter contain it iirc). I wrote a simple shell script, which you can see in the cover letter. But you are right I take function list from scripts/coccinelle/api/drm-get-put.cocci file. Daniel Should I use coccinelle to generate patches and resend a v2? If so, do i need to include reviewed-by and acked-by tags to patches myself? Thanks. > Thanks, Daniel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 00/29] DRM API conversions
This patch set replaces the occurrences of drm_*_reference() and drm_*_unreference() with the new drm_*_get() and drm_*_put() functions. All patches in the series do the same thing, converting to the new APIs. I created patches per DRM driver as suggested by Daniel Vetter. Background: In the kernel, reference counting APIs use *_get(), *_put() style naming to reference-count the objects. But DRM subsystem uses a different naming for them such as *_reference(), *_unreference() which is inconsistent with the other reference counting APIs in the kernel. To solve this consistency issue, Thierry Reding introduced a couple of functions and compatibility aliases in the following commits for them. commit 020a218f95bd3ceff7dd1022ff7ebc0497bc7bf9 Author: Thierry Reding Date: Tue Feb 28 15:46:38 2017 +0100 drm: Introduce drm_mode_object_{get,put}() commit ad09360750afa18a0a0ce0253d6ea6033abc22e7 Author: Thierry Reding Date: Tue Feb 28 15:46:39 2017 +0100 drm: Introduce drm_connector_{get,put}() commit a4a69da06bc11a937a6e417938b1bb698ee1fa46 Author: Thierry Reding Date: Tue Feb 28 15:46:40 2017 +0100 drm: Introduce drm_framebuffer_{get,put}() commit e6b62714e87c8811d5564b6a0738dcde63a51774 Author: Thierry Reding Date: Tue Feb 28 15:46:41 2017 +0100 drm: Introduce drm_gem_object_{get,put}() commit 6472e5090be7c78749a3c279b4faae87ab835c40 Author: Thierry Reding Date: Tue Feb 28 15:46:42 2017 +0100 drm: Introduce drm_property_blob_{get,put}() This patch set was generated using the following shell script: #!/bin/sh path=$1 do_replace() { local pattern=$1 local replacement=$2 git grep -lw "${pattern}" -- "${path}/*.[hc]" |\ xargs -r sed -i "s/\b$pattern\b/$replacement/g" } do_replace drm_mode_object_reference drm_mode_object_get do_replace drm_mode_object_unreference drm_mode_object_put do_replace drm_connector_reference drm_connector_get do_replace drm_connector_unreference drm_connector_put do_replace drm_framebuffer_reference drm_framebuffer_get do_replace drm_framebuffer_unreference drm_framebuffer_put do_replace drm_gem_object_reference drm_gem_object_get do_replace drm_gem_object_unreference drm_gem_object_put do_replace __drm_gem_object_unreference __drm_gem_object_put do_replace drm_gem_object_unreference_unlocked drm_gem_object_put_unlocked do_replace drm_property_reference_blob drm_property_blob_get do_replace drm_property_unreference_blob drm_property_blob_put Cihangir Akturk (29): drm/amdgpu: switch to drm_*{get,put} helpers drm: mali-dp: switch to drm_*{get,put} helpers drm/armada: switch to drm_*{get,put} helpers drm/ast: switch to drm_*{get,put} helpers drm/atmel-hlcdc: switch to drm_*{get,put} helpers drm/bochs: switch to drm_*{get,put} helpers drm/cirrus: switch to drm_*{get,put} helpers drm/etnaviv: switch to drm_*{get,put} helpers drm/exynos: switch to drm_*{get,put} helpers drm/gma500: switch to drm_*{get,put} helpers drm/hisilicon: switch to drm_*{get,put} helpers drm/i915: switch to drm_*{get,put} helpers drm/imx: switch to drm_*{get,put} helpers drm/mediatek: switch to drm_*{get,put} helpers drm/mgag200: switch to drm_*{get,put} helpers drm/msm: switch to drm_*{get,put} helpers drm/nouveau: switch to drm_*{get,put} helpers drm/omap: switch to drm_*{get,put} helpers drm/qxl: switch to drm_*{get,put} helpers drm/radeon: switch to drm_*{get,put} helpers drm/rockchip: switch to drm_*{get,put} helpers drm/tegra: switch to drm_*{get,put} helpers drm/tilcdc: switch to drm_*{get,put} helpers drm/udl: switch to drm_*{get,put} helpers drm/vc4: switch to drm_*{get,put} helpers drm/vgem: switch to drm_*{get,put} helpers drm/virtio: switch to drm_*{get,put} helpers drm/vmwgfx: switch to drm_*{get,put} helpers staging: vboxvideo: switch to drm_*{get,put} helpers drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c| 4 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 22 - drivers/gpu/drm/amd/amdgpu/dce_v10_0.c| 6 ++--- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c| 6 ++--- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 6 ++--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 6 ++--- drivers/gpu/drm/arm/malidp_planes.c | 2 +- drivers/gpu/drm/armada/armada_crtc.c | 22 - drivers/gpu/drm/armada/armada_drv.c | 2 +- drivers/gpu/drm/armada/armada_fb.c| 8 +++--- drivers/gpu/drm/armada/armada_fbdev.c | 6 ++--- drivers/gpu/drm/armada/armada_gem.c | 14 +-- drivers/gpu/drm/armada/armada_overlay.c | 4 +-- drivers/gpu/drm/ast/ast_fb.c | 2 +- drivers/gpu/drm/ast/ast_main.c| 10 drivers/g
[PATCH 09/29] drm/exynos: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/exynos/exynos_drm_fb.c| 4 ++-- drivers/gpu/drm/exynos/exynos_drm_gem.c | 12 ++-- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index d48fd7c..3dccdee 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -80,7 +80,7 @@ static void exynos_drm_fb_destroy(struct drm_framebuffer *fb) continue; obj = &exynos_fb->exynos_gem[i]->base; - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); } kfree(exynos_fb); @@ -172,7 +172,7 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, err: while (i--) - drm_gem_object_unreference_unlocked(&exynos_gem[i]->base); + drm_gem_object_put_unlocked(&exynos_gem[i]->base); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index c23479b..1c8d2f9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -143,7 +143,7 @@ static int exynos_drm_gem_handle_create(struct drm_gem_object *obj, DRM_DEBUG_KMS("gem handle = 0x%x\n", *handle); /* drop reference from allocate - handle holds it now. */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } @@ -186,7 +186,7 @@ unsigned long exynos_drm_gem_get_size(struct drm_device *dev, exynos_gem = to_exynos_gem(obj); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return exynos_gem->size; } @@ -320,13 +320,13 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev, return; } - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); /* * decrease obj->refcount one more time because we has already * increased it at exynos_drm_gem_get_dma_addr(). */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); } static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem *exynos_gem, @@ -374,7 +374,7 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data, args->flags = exynos_gem->flags; args->size = exynos_gem->size; - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } @@ -444,7 +444,7 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv, *offset = drm_vma_node_offset_addr(&obj->vma_node); DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 611b6fd..c19de47 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -132,7 +132,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane) if (plane->state) { exynos_state = to_exynos_plane_state(plane->state); if (exynos_state->base.fb) - drm_framebuffer_unreference(exynos_state->base.fb); + drm_framebuffer_put(exynos_state->base.fb); kfree(exynos_state); plane->state = NULL; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 18/29] drm/omap: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/omapdrm/omap_drv.c| 2 +- drivers/gpu/drm/omapdrm/omap_fb.c | 4 ++-- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c| 4 ++-- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 022029e..d005a07 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -393,7 +393,7 @@ static int ioctl_gem_info(struct drm_device *dev, void *data, args->size = omap_gem_mmap_size(obj); args->offset = omap_gem_mmap_offset(obj); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index ddf7a45..549196d 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -91,7 +91,7 @@ static void omap_framebuffer_destroy(struct drm_framebuffer *fb) for (i = 0; i < n; i++) { struct plane *plane = &omap_fb->planes[i]; - drm_gem_object_unreference_unlocked(plane->bo); + drm_gem_object_put_unlocked(plane->bo); } kfree(omap_fb); @@ -380,7 +380,7 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, error: while (--i > 0) - drm_gem_object_unreference_unlocked(bos[i]); + drm_gem_object_put_unlocked(bos[i]); return fb; } diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index daf81a0..7f10f03 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -149,7 +149,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, /* note: if fb creation failed, we can't rely on fb destroy * to unref the bo: */ - drm_gem_object_unreference_unlocked(fbdev->bo); + drm_gem_object_put_unlocked(fbdev->bo); ret = PTR_ERR(fb); goto fail; } diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 5c5c86d..062fb57 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -665,7 +665,7 @@ int omap_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, *offset = omap_gem_mmap_offset(obj); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); fail: return ret; @@ -1299,7 +1299,7 @@ int omap_gem_new_handle(struct drm_device *dev, struct drm_file *file, } /* drop reference from allocate - handle holds it now */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c index 863a881..17cc3ab 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c @@ -189,7 +189,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, * Importing dmabuf exported from out own gem increases * refcount on gem itself instead of f_count of dmabuf. */ - drm_gem_object_reference(obj); + drm_gem_object_get(obj); return obj; } } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 19/29] drm/qxl: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- drivers/gpu/drm/qxl/qxl_dumb.c| 2 +- drivers/gpu/drm/qxl/qxl_fb.c | 6 +++--- drivers/gpu/drm/qxl/qxl_gem.c | 2 +- drivers/gpu/drm/qxl/qxl_ioctl.c | 4 ++-- drivers/gpu/drm/qxl/qxl_object.c | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 03fe182..7aa5097 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -306,7 +306,7 @@ void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb); - drm_gem_object_unreference_unlocked(qxl_fb->obj); + drm_gem_object_put_unlocked(qxl_fb->obj); drm_framebuffer_cleanup(fb); kfree(qxl_fb); } @@ -1109,7 +1109,7 @@ qxl_user_framebuffer_create(struct drm_device *dev, ret = qxl_framebuffer_init(dev, qxl_fb, mode_cmd, obj, &qxl_fb_funcs); if (ret) { kfree(qxl_fb); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return NULL; } diff --git a/drivers/gpu/drm/qxl/qxl_dumb.c b/drivers/gpu/drm/qxl/qxl_dumb.c index 5e65d5d..a0c9e73 100644 --- a/drivers/gpu/drm/qxl/qxl_dumb.c +++ b/drivers/gpu/drm/qxl/qxl_dumb.c @@ -81,6 +81,6 @@ int qxl_mode_dumb_mmap(struct drm_file *file_priv, return -ENOENT; qobj = gem_to_qxl_bo(gobj); *offset_p = qxl_bo_mmap_offset(qobj); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return 0; } diff --git a/drivers/gpu/drm/qxl/qxl_fb.c b/drivers/gpu/drm/qxl/qxl_fb.c index 573e7e9..47a25b0 100644 --- a/drivers/gpu/drm/qxl/qxl_fb.c +++ b/drivers/gpu/drm/qxl/qxl_fb.c @@ -95,7 +95,7 @@ static void qxlfb_destroy_pinned_object(struct drm_gem_object *gobj) qxl_bo_kunmap(qbo); qxl_bo_unpin(qbo); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); } int qxl_get_handle_for_primary_fb(struct qxl_device *qdev, @@ -320,11 +320,11 @@ static int qxlfb_create(struct qxl_fbdev *qfbdev, qxl_bo_unpin(qbo); } if (fb && ret) { - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); drm_framebuffer_cleanup(fb); kfree(fb); } - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return ret; } diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm/qxl/qxl_gem.c index 85f5467..f5c1e78 100644 --- a/drivers/gpu/drm/qxl/qxl_gem.c +++ b/drivers/gpu/drm/qxl/qxl_gem.c @@ -98,7 +98,7 @@ int qxl_gem_object_create_with_handle(struct qxl_device *qdev, return r; /* drop reference from allocate - handle holds it now */ *qobj = gem_to_qxl_bo(gobj); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return 0; } diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c index 0b82a87..dfefd45 100644 --- a/drivers/gpu/drm/qxl/qxl_ioctl.c +++ b/drivers/gpu/drm/qxl/qxl_ioctl.c @@ -121,7 +121,7 @@ static int qxlhw_handle_to_bo(struct drm_file *file_priv, uint64_t handle, qobj = gem_to_qxl_bo(gobj); ret = qxl_release_list_add(release, qobj); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); if (ret) return ret; @@ -342,7 +342,7 @@ static int qxl_update_area_ioctl(struct drm_device *dev, void *data, qxl_bo_unreserve(qobj); out: - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return ret; } diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 9a7eef7..cdf1455 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -211,13 +211,13 @@ void qxl_bo_unref(struct qxl_bo **bo) if ((*bo) == NULL) return; - drm_gem_object_unreference_unlocked(&(*bo)->gem_base); + drm_gem_object_put_unlocked(&(*bo)->gem_base); *bo = NULL; } struct qxl_bo *qxl_bo_ref(struct qxl_bo *bo) { - drm_gem_object_reference(&bo->gem_base); + drm_gem_object_get(&bo->gem_base); return bo; } @@ -316,7 +316,7 @@ void qxl_bo_force_delete(struct qxl_device *qdev) list_del_init(&bo->list); mutex_unlock(&qdev->gem.mutex); /* this should unref the ttm bo */ - drm_gem_object_unreference_unlocked(&bo->gem_bas
Re: [PATCH 17/29] drm/nouveau: switch to drm_*{get,put} helpers
Looks good to me! Reviewed-by: Tobias Klausmann On 8/3/17 1:58 PM, Cihangir Akturk wrote: > drm_*_reference() and drm_*_unreference() functions are just > compatibility alias for drm_*_get() and drm_*_put() adn should not be > used by new code. So convert all users of compatibility functions to use > the new APIs. > > Signed-off-by: Cihangir Akturk > --- > drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 +- > drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +- > drivers/gpu/drm/nouveau/nouveau_display.c | 8 > drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- > drivers/gpu/drm/nouveau/nouveau_gem.c | 14 +++--- > drivers/gpu/drm/nouveau/nv50_display.c| 2 +- > 6 files changed, 15 insertions(+), 15 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c > b/drivers/gpu/drm/nouveau/dispnv04/crtc.c > index 4b4b0b4..18b4be1 100644 > --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c > +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c > @@ -1019,7 +1019,7 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct > drm_file *file_priv, > nv_crtc->cursor.set_offset(nv_crtc, nv_crtc->cursor.offset); > nv_crtc->cursor.show(nv_crtc, true); > out: > - drm_gem_object_unreference_unlocked(gem); > + drm_gem_object_put_unlocked(gem); > return ret; > } > > diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c > b/drivers/gpu/drm/nouveau/nouveau_abi16.c > index f98f800..3e9db5a 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c > +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c > @@ -136,7 +136,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, > if (chan->ntfy) { > nouveau_bo_vma_del(chan->ntfy, &chan->ntfy_vma); > nouveau_bo_unpin(chan->ntfy); > - drm_gem_object_unreference_unlocked(&chan->ntfy->gem); > + drm_gem_object_put_unlocked(&chan->ntfy->gem); > } > > if (chan->heap.block_size) > diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c > b/drivers/gpu/drm/nouveau/nouveau_display.c > index 8d1df56..a68fe1a 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_display.c > +++ b/drivers/gpu/drm/nouveau/nouveau_display.c > @@ -206,7 +206,7 @@ nouveau_user_framebuffer_destroy(struct drm_framebuffer > *drm_fb) > struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb); > > if (fb->nvbo) > - drm_gem_object_unreference_unlocked(&fb->nvbo->gem); > + drm_gem_object_put_unlocked(&fb->nvbo->gem); > > drm_framebuffer_cleanup(drm_fb); > kfree(fb); > @@ -267,7 +267,7 @@ nouveau_user_framebuffer_create(struct drm_device *dev, > if (ret == 0) > return &fb->base; > > - drm_gem_object_unreference_unlocked(gem); > + drm_gem_object_put_unlocked(gem); > return ERR_PTR(ret); > } > > @@ -947,7 +947,7 @@ nouveau_display_dumb_create(struct drm_file *file_priv, > struct drm_device *dev, > return ret; > > ret = drm_gem_handle_create(file_priv, &bo->gem, &args->handle); > - drm_gem_object_unreference_unlocked(&bo->gem); > + drm_gem_object_put_unlocked(&bo->gem); > return ret; > } > > @@ -962,7 +962,7 @@ nouveau_display_dumb_map_offset(struct drm_file > *file_priv, > if (gem) { > struct nouveau_bo *bo = nouveau_gem_object(gem); > *poffset = drm_vma_node_offset_addr(&bo->bo.vma_node); > - drm_gem_object_unreference_unlocked(gem); > + drm_gem_object_put_unlocked(gem); > return 0; > } > > diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c > b/drivers/gpu/drm/nouveau/nouveau_fbcon.c > index 2665a07..6c9e1ec 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c > +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c > @@ -451,7 +451,7 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct > nouveau_fbdev *fbcon) > nouveau_bo_vma_del(nouveau_fb->nvbo, &nouveau_fb->vma); > nouveau_bo_unmap(nouveau_fb->nvbo); > nouveau_bo_unpin(nouveau_fb->nvbo); > - drm_framebuffer_unreference(&nouveau_fb->base); > + drm_framebuffer_put(&nouveau_fb->base); > } > > return 0; > diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c > b/drivers/gpu/drm/nouveau/nouveau_gem.c > index 2170534..653425c 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_gem.c > +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c > @@ -281,7 +281,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, > } > > /* drop reference from allocate - handle holds it now */ > - drm_gem_object_unreference_unlocked(&nvbo->gem); > + drm_gem_object_put_unlocked(&nvbo->gem); > return ret; > } > > @@ -350,7 +350,7 @@ validate_fini_no_ticket(struct validate_op *op, struct > nouveau_fence *fence, > list_del(&nvbo->entry); > nvbo->reserved_by = NULL; > ttm_bo_unreserve_ticket(&nvbo->bo, &op->ticket); > - drm_
[PATCH 07/29] drm/cirrus: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 +- drivers/gpu/drm/cirrus/cirrus_main.c | 10 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c index 7fa58ee..c0b9a29 100644 --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c @@ -252,7 +252,7 @@ static int cirrus_fbdev_destroy(struct drm_device *dev, drm_fb_helper_unregister_fbi(&gfbdev->helper); if (gfb->obj) { - drm_gem_object_unreference_unlocked(gfb->obj); + drm_gem_object_put_unlocked(gfb->obj); gfb->obj = NULL; } diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c index e7fc95f..b5f5285 100644 --- a/drivers/gpu/drm/cirrus/cirrus_main.c +++ b/drivers/gpu/drm/cirrus/cirrus_main.c @@ -18,7 +18,7 @@ static void cirrus_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct cirrus_framebuffer *cirrus_fb = to_cirrus_framebuffer(fb); - drm_gem_object_unreference_unlocked(cirrus_fb->obj); + drm_gem_object_put_unlocked(cirrus_fb->obj); drm_framebuffer_cleanup(fb); kfree(fb); } @@ -67,13 +67,13 @@ cirrus_user_framebuffer_create(struct drm_device *dev, cirrus_fb = kzalloc(sizeof(*cirrus_fb), GFP_KERNEL); if (!cirrus_fb) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(-ENOMEM); } ret = cirrus_framebuffer_init(dev, cirrus_fb, mode_cmd, obj); if (ret) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); kfree(cirrus_fb); return ERR_PTR(ret); } @@ -261,7 +261,7 @@ int cirrus_dumb_create(struct drm_file *file, return ret; ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); if (ret) return ret; @@ -310,7 +310,7 @@ cirrus_dumb_mmap_offset(struct drm_file *file, bo = gem_to_cirrus_bo(obj); *offset = cirrus_bo_mmap_offset(bo); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 10/29] drm/gma500: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/gma500/framebuffer.c | 4 ++-- drivers/gpu/drm/gma500/gem.c | 4 ++-- drivers/gpu/drm/gma500/gma_display.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 7da70b6..5d22d33 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -541,7 +541,7 @@ static int psb_fbdev_destroy(struct drm_device *dev, struct psb_fbdev *fbdev) drm_framebuffer_cleanup(&psbfb->base); if (psbfb->gtt) - drm_gem_object_unreference_unlocked(&psbfb->gtt->gem); + drm_gem_object_put_unlocked(&psbfb->gtt->gem); return 0; } @@ -639,7 +639,7 @@ static void psb_user_framebuffer_destroy(struct drm_framebuffer *fb) /* Let DRM do its clean up */ drm_framebuffer_cleanup(fb); /* We are no longer using the resource in GEM */ - drm_gem_object_unreference_unlocked(&r->gem); + drm_gem_object_put_unlocked(&r->gem); kfree(fb); } diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 7da061a..b14ae9b 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -73,7 +73,7 @@ int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev, goto out; *offset = drm_vma_node_offset_addr(&obj->vma_node); out: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } @@ -123,7 +123,7 @@ int psb_gem_create(struct drm_file *file, struct drm_device *dev, u64 size, return ret; } /* We have the initial and handle reference but need only one now */ - drm_gem_object_unreference_unlocked(&r->gem); + drm_gem_object_put_unlocked(&r->gem); *handlep = handle; return 0; } diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index e7fd356..ce02400 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -363,7 +363,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); psb_gtt_unpin(gt); - drm_gem_object_unreference_unlocked(gma_crtc->cursor_obj); + drm_gem_object_put_unlocked(gma_crtc->cursor_obj); gma_crtc->cursor_obj = NULL; } return 0; @@ -439,7 +439,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, if (gma_crtc->cursor_obj) { gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); psb_gtt_unpin(gt); - drm_gem_object_unreference_unlocked(gma_crtc->cursor_obj); + drm_gem_object_put_unlocked(gma_crtc->cursor_obj); } gma_crtc->cursor_obj = obj; @@ -447,7 +447,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, return ret; unref_cursor: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 13/29] drm/imx: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/imx/ipuv3-crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 5456c15..f04ef74 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -114,7 +114,7 @@ static void imx_drm_crtc_reset(struct drm_crtc *crtc) if (crtc->state) { if (crtc->state->mode_blob) - drm_property_unreference_blob(crtc->state->mode_blob); + drm_property_blob_put(crtc->state->mode_blob); state = to_imx_crtc_state(crtc->state); memset(state, 0, sizeof(*state)); -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 14/29] drm/mediatek: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/mediatek/mtk_drm_fb.c | 4 ++-- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_fb.c b/drivers/gpu/drm/mediatek/mtk_drm_fb.c index d4246c9..0d8d506 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_fb.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_fb.c @@ -58,7 +58,7 @@ static void mtk_drm_fb_destroy(struct drm_framebuffer *fb) drm_framebuffer_cleanup(fb); - drm_gem_object_unreference_unlocked(mtk_fb->gem_obj); + drm_gem_object_put_unlocked(mtk_fb->gem_obj); kfree(mtk_fb); } @@ -160,6 +160,6 @@ struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev, return &mtk_fb->base; unreference: - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index 7abc550..961cbf5 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -122,7 +122,7 @@ int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev, goto err_handle_create; /* drop reference from allocate - handle holds it now. */ - drm_gem_object_unreference_unlocked(&mtk_gem->base); + drm_gem_object_put_unlocked(&mtk_gem->base); return 0; @@ -152,7 +152,7 @@ int mtk_drm_gem_dumb_map_offset(struct drm_file *file_priv, DRM_DEBUG_KMS("offset = 0x%llx\n", *offset); out: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 24/29] drm/udl: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/udl/udl_fb.c | 6 +++--- drivers/gpu/drm/udl/udl_gem.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index 4a65003..8de6a18 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c @@ -309,7 +309,7 @@ static void udl_user_framebuffer_destroy(struct drm_framebuffer *fb) struct udl_framebuffer *ufb = to_udl_fb(fb); if (ufb->obj) - drm_gem_object_unreference_unlocked(&ufb->obj->base); + drm_gem_object_put_unlocked(&ufb->obj->base); drm_framebuffer_cleanup(fb); kfree(ufb); @@ -404,7 +404,7 @@ static int udlfb_create(struct drm_fb_helper *helper, return ret; out_gfree: - drm_gem_object_unreference_unlocked(&ufbdev->ufb.obj->base); + drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base); out: return ret; } @@ -420,7 +420,7 @@ static void udl_fbdev_destroy(struct drm_device *dev, drm_fb_helper_fini(&ufbdev->helper); drm_framebuffer_unregister_private(&ufbdev->ufb.base); drm_framebuffer_cleanup(&ufbdev->ufb.base); - drm_gem_object_unreference_unlocked(&ufbdev->ufb.obj->base); + drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base); } int udl_fbdev_init(struct drm_device *dev) diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c index db9cece..dee6bd9 100644 --- a/drivers/gpu/drm/udl/udl_gem.c +++ b/drivers/gpu/drm/udl/udl_gem.c @@ -52,7 +52,7 @@ udl_gem_create(struct drm_file *file, return ret; } - drm_gem_object_unreference_unlocked(&obj->base); + drm_gem_object_put_unlocked(&obj->base); *handle_p = handle; return 0; } @@ -234,7 +234,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev, *offset = drm_vma_node_offset_addr(&gobj->base.vma_node); out: - drm_gem_object_unreference(&gobj->base); + drm_gem_object_put(&gobj->base); unlock: mutex_unlock(&dev->struct_mutex); return ret; -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 17/29] drm/nouveau: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 8 drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 14 +++--- drivers/gpu/drm/nouveau/nv50_display.c| 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index 4b4b0b4..18b4be1 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -1019,7 +1019,7 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, nv_crtc->cursor.set_offset(nv_crtc, nv_crtc->cursor.offset); nv_crtc->cursor.show(nv_crtc, true); out: - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return ret; } diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index f98f800..3e9db5a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c @@ -136,7 +136,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, if (chan->ntfy) { nouveau_bo_vma_del(chan->ntfy, &chan->ntfy_vma); nouveau_bo_unpin(chan->ntfy); - drm_gem_object_unreference_unlocked(&chan->ntfy->gem); + drm_gem_object_put_unlocked(&chan->ntfy->gem); } if (chan->heap.block_size) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 8d1df56..a68fe1a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -206,7 +206,7 @@ nouveau_user_framebuffer_destroy(struct drm_framebuffer *drm_fb) struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb); if (fb->nvbo) - drm_gem_object_unreference_unlocked(&fb->nvbo->gem); + drm_gem_object_put_unlocked(&fb->nvbo->gem); drm_framebuffer_cleanup(drm_fb); kfree(fb); @@ -267,7 +267,7 @@ nouveau_user_framebuffer_create(struct drm_device *dev, if (ret == 0) return &fb->base; - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return ERR_PTR(ret); } @@ -947,7 +947,7 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev, return ret; ret = drm_gem_handle_create(file_priv, &bo->gem, &args->handle); - drm_gem_object_unreference_unlocked(&bo->gem); + drm_gem_object_put_unlocked(&bo->gem); return ret; } @@ -962,7 +962,7 @@ nouveau_display_dumb_map_offset(struct drm_file *file_priv, if (gem) { struct nouveau_bo *bo = nouveau_gem_object(gem); *poffset = drm_vma_node_offset_addr(&bo->bo.vma_node); - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return 0; } diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 2665a07..6c9e1ec 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -451,7 +451,7 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *fbcon) nouveau_bo_vma_del(nouveau_fb->nvbo, &nouveau_fb->vma); nouveau_bo_unmap(nouveau_fb->nvbo); nouveau_bo_unpin(nouveau_fb->nvbo); - drm_framebuffer_unreference(&nouveau_fb->base); + drm_framebuffer_put(&nouveau_fb->base); } return 0; diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 2170534..653425c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -281,7 +281,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, } /* drop reference from allocate - handle holds it now */ - drm_gem_object_unreference_unlocked(&nvbo->gem); + drm_gem_object_put_unlocked(&nvbo->gem); return ret; } @@ -350,7 +350,7 @@ validate_fini_no_ticket(struct validate_op *op, struct nouveau_fence *fence, list_del(&nvbo->entry); nvbo->reserved_by = NULL; ttm_bo_unreserve_ticket(&nvbo->bo, &op->ticket); - drm_gem_object_unreference_unlocked(&nvbo->gem); + drm_gem_object_put_unlocked(&nvbo->gem); } } @@ -396,14 +396,14 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv, nvbo = no
[PATCH 04/29] drm/ast: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/ast/ast_fb.c | 2 +- drivers/gpu/drm/ast/ast_main.c | 10 +- drivers/gpu/drm/ast/ast_mode.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c index 4ad4acd..8f5fedc 100644 --- a/drivers/gpu/drm/ast/ast_fb.c +++ b/drivers/gpu/drm/ast/ast_fb.c @@ -287,7 +287,7 @@ static void ast_fbdev_destroy(struct drm_device *dev, drm_fb_helper_unregister_fbi(&afbdev->helper); if (afb->obj) { - drm_gem_object_unreference_unlocked(afb->obj); + drm_gem_object_put_unlocked(afb->obj); afb->obj = NULL; } drm_fb_helper_fini(&afbdev->helper); diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 262c2c0..cb05e8e 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -387,7 +387,7 @@ static void ast_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct ast_framebuffer *ast_fb = to_ast_framebuffer(fb); - drm_gem_object_unreference_unlocked(ast_fb->obj); + drm_gem_object_put_unlocked(ast_fb->obj); drm_framebuffer_cleanup(fb); kfree(fb); } @@ -429,13 +429,13 @@ ast_user_framebuffer_create(struct drm_device *dev, ast_fb = kzalloc(sizeof(*ast_fb), GFP_KERNEL); if (!ast_fb) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(-ENOMEM); } ret = ast_framebuffer_init(dev, ast_fb, mode_cmd, obj); if (ret) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); kfree(ast_fb); return ERR_PTR(ret); } @@ -627,7 +627,7 @@ int ast_dumb_create(struct drm_file *file, return ret; ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); if (ret) return ret; @@ -675,7 +675,7 @@ ast_dumb_mmap_offset(struct drm_file *file, bo = gem_to_ast_bo(obj); *offset = ast_bo_mmap_offset(bo); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index aaef0a6..dd74c32 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -948,7 +948,7 @@ static void ast_cursor_fini(struct drm_device *dev) { struct ast_private *ast = dev->dev_private; ttm_bo_kunmap(&ast->cache_kmap); - drm_gem_object_unreference_unlocked(ast->cursor_cache); + drm_gem_object_put_unlocked(ast->cursor_cache); } int ast_mode_init(struct drm_device *dev) @@ -1213,10 +1213,10 @@ static int ast_cursor_set(struct drm_crtc *crtc, ast_show_cursor(crtc); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; fail: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 02/29] drm: mali-dp: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() and should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/arm/malidp_planes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 600fa7b..cb71360 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -57,7 +57,7 @@ static void malidp_de_plane_destroy(struct drm_plane *plane) struct malidp_plane *mp = to_malidp_plane(plane); if (mp->base.fb) - drm_framebuffer_unreference(mp->base.fb); + drm_framebuffer_put(mp->base.fb); drm_plane_helper_disable(plane); drm_plane_cleanup(plane); -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 2/4] drm: rcar-du: Wait for flip completion instead of vblank in commit tail
Hi Laurent, On 29/07/17 22:08, Laurent Pinchart wrote: > Page flips can take more than one vertical blanking to complete if > arming the page flips races with the vertical blanking interrupt. > Waiting for one vblank to complete the atomic commit in the commit tail > handler is thus incorrect, and can lead to framebuffers being released > while still being scanned out. > > Fix this by waiting for flip completion instead, using the > drm_atomic_helper_wait_for_flip_done() helper. > > Fixes: 0d230422d256 ("drm: rcar-du: Register a completion callback with VSP1") > Signed-off-by: Laurent Pinchart > --- > drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > b/drivers/gpu/drm/rcar-du/rcar_du_kms.c > index b91257dee98f..221e22922396 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c > @@ -262,7 +262,7 @@ static void rcar_du_atomic_commit_tail(struct > drm_atomic_state *old_state) > drm_atomic_helper_commit_modeset_enables(dev, old_state); > > drm_atomic_helper_commit_hw_done(old_state); > - drm_atomic_helper_wait_for_vblanks(dev, old_state); > + drm_atomic_helper_wait_for_flip_done(dev, old_state); Ahh yes, that makes sense! Reviewed-by: Kieran Bingham > drm_atomic_helper_cleanup_planes(dev, old_state); > } > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 11/29] drm/hisilicon: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 4 ++-- drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 8 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c index f5ac80d..c1034af 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c @@ -158,7 +158,7 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper, out_unreserve_ttm_bo: ttm_bo_unreserve(&bo->bo); out_unref_gem: - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return ret; } @@ -173,7 +173,7 @@ static void hibmc_fbdev_destroy(struct hibmc_fbdev *fbdev) drm_fb_helper_fini(fbh); if (gfb) - drm_framebuffer_unreference(&gfb->fb); + drm_framebuffer_put(&gfb->fb); } static const struct drm_fb_helper_funcs hibmc_fbdev_helper_funcs = { diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c index ac457c7..3518167 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c @@ -444,7 +444,7 @@ int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, } ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); if (ret) { DRM_ERROR("failed to unreference GEM object: %d\n", ret); return ret; @@ -479,7 +479,7 @@ int hibmc_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, bo = gem_to_hibmc_bo(obj); *offset = hibmc_bo_mmap_offset(bo); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } @@ -487,7 +487,7 @@ static void hibmc_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct hibmc_framebuffer *hibmc_fb = to_hibmc_framebuffer(fb); - drm_gem_object_unreference_unlocked(hibmc_fb->obj); + drm_gem_object_put_unlocked(hibmc_fb->obj); drm_framebuffer_cleanup(fb); kfree(hibmc_fb); } @@ -543,7 +543,7 @@ hibmc_user_framebuffer_create(struct drm_device *dev, hibmc_fb = hibmc_framebuffer_init(dev, mode_cmd, obj); if (IS_ERR(hibmc_fb)) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR((long)hibmc_fb); } return &hibmc_fb->fb; -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 20/29] drm/radeon: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon/radeon_cursor.c | 6 +++--- drivers/gpu/drm/radeon/radeon_display.c | 12 ++-- drivers/gpu/drm/radeon/radeon_fb.c | 4 ++-- drivers/gpu/drm/radeon/radeon_gem.c | 30 +++--- drivers/gpu/drm/radeon/radeon_object.c | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 00b22af..ea0db26 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -437,7 +437,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error, bo if (bo == NULL) continue; - drm_gem_object_unreference_unlocked(&bo->gem_base); + drm_gem_object_put_unlocked(&bo->gem_base); } } kfree(parser->track); diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c index 4a4f953..9195227 100644 --- a/drivers/gpu/drm/radeon/radeon_cursor.c +++ b/drivers/gpu/drm/radeon/radeon_cursor.c @@ -307,7 +307,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, robj = gem_to_radeon_bo(obj); ret = radeon_bo_reserve(robj, false); if (ret != 0) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } /* Only 27 bit offset for legacy cursor */ @@ -317,7 +317,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, radeon_bo_unreserve(robj); if (ret) { DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } @@ -352,7 +352,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, radeon_bo_unpin(robj); radeon_bo_unreserve(robj); } - drm_gem_object_unreference_unlocked(radeon_crtc->cursor_bo); + drm_gem_object_put_unlocked(radeon_crtc->cursor_bo); } radeon_crtc->cursor_bo = obj; diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 17d3daf..adbf28c 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -282,7 +282,7 @@ static void radeon_unpin_work_func(struct work_struct *__work) } else DRM_ERROR("failed to reserve buffer after flip\n"); - drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); + drm_gem_object_put_unlocked(&work->old_rbo->gem_base); kfree(work); } @@ -519,7 +519,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, obj = old_radeon_fb->obj; /* take a reference to the old object */ - drm_gem_object_reference(obj); + drm_gem_object_get(obj); work->old_rbo = gem_to_radeon_bo(obj); new_radeon_fb = to_radeon_framebuffer(fb); @@ -618,7 +618,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, radeon_bo_unreserve(new_rbo); cleanup: - drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); + drm_gem_object_put_unlocked(&work->old_rbo->gem_base); dma_fence_put(work->fence); kfree(work); return r; @@ -1303,7 +1303,7 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb); - drm_gem_object_unreference_unlocked(radeon_fb->obj); + drm_gem_object_put_unlocked(radeon_fb->obj); drm_framebuffer_cleanup(fb); kfree(radeon_fb); } @@ -1363,14 +1363,14 @@ radeon_user_framebuffer_create(struct drm_device *dev, radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL); if (radeon_fb == NULL) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(-ENOMEM); } ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj); if (ret) { kfree(radeon_fb); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 356ad90..976d224 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c @@ -118,7 +118,7 @@ static void radeonfb_destroy_pin
[PATCH 25/29] drm/vc4: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/vc4/vc4_bo.c | 12 ++-- drivers/gpu/drm/vc4/vc4_crtc.c | 6 +++--- drivers/gpu/drm/vc4/vc4_gem.c | 14 +++--- drivers/gpu/drm/vc4/vc4_kms.c | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 487f964..ee10152 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -273,7 +273,7 @@ int vc4_dumb_create(struct drm_file *file_priv, return PTR_ERR(bo); ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); - drm_gem_object_unreference_unlocked(&bo->base.base); + drm_gem_object_put_unlocked(&bo->base.base); return ret; } @@ -488,7 +488,7 @@ int vc4_create_bo_ioctl(struct drm_device *dev, void *data, return PTR_ERR(bo); ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); - drm_gem_object_unreference_unlocked(&bo->base.base); + drm_gem_object_put_unlocked(&bo->base.base); return ret; } @@ -508,7 +508,7 @@ int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, /* The mmap offset was set up at BO allocation time. */ args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node); - drm_gem_object_unreference_unlocked(gem_obj); + drm_gem_object_put_unlocked(gem_obj); return 0; } @@ -564,7 +564,7 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); fail: - drm_gem_object_unreference_unlocked(&bo->base.base); + drm_gem_object_put_unlocked(&bo->base.base); return ret; } @@ -611,7 +611,7 @@ int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, bo = to_vc4_bo(gem_obj); bo->t_format = t_format; - drm_gem_object_unreference_unlocked(gem_obj); + drm_gem_object_put_unlocked(gem_obj); return 0; } @@ -646,7 +646,7 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, else args->modifier = DRM_FORMAT_MOD_NONE; - drm_gem_object_unreference_unlocked(gem_obj); + drm_gem_object_put_unlocked(gem_obj); return 0; } diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index a12cc7e..41fa025 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -757,7 +757,7 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) } drm_crtc_vblank_put(crtc); - drm_framebuffer_unreference(flip_state->fb); + drm_framebuffer_put(flip_state->fb); kfree(flip_state); up(&vc4->async_modeset); @@ -786,7 +786,7 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, if (!flip_state) return -ENOMEM; - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); flip_state->fb = fb; flip_state->crtc = crtc; flip_state->event = event; @@ -794,7 +794,7 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, /* Make sure all other async modesetes have landed. */ ret = down_interruptible(&vc4->async_modeset); if (ret) { - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); kfree(flip_state); return ret; } diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index d5b821a..2ffe0d0 100644 --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4/vc4_gem.c @@ -55,7 +55,7 @@ vc4_free_hang_state(struct drm_device *dev, struct vc4_hang_state *state) unsigned int i; for (i = 0; i < state->user_state.bo_count; i++) - drm_gem_object_unreference_unlocked(state->bo[i]); + drm_gem_object_put_unlocked(state->bo[i]); kfree(state); } @@ -188,12 +188,12 @@ vc4_save_hang_state(struct drm_device *dev) continue; for (j = 0; j < exec[i]->bo_count; j++) { - drm_gem_object_reference(&exec[i]->bo[j]->base); + drm_gem_object_get(&exec[i]->bo[j]->base); kernel_state->bo[j + prev_idx] = &exec[i]->bo[j]->base; } list_for_each_entry(bo, &exec[i]->unref_list, unref_head) { - drm_gem_object_reference(&bo->base.base); + drm_gem_object_get(&bo->base.base); kernel_state->bo[j + prev_idx] = &bo->base.base; j++; } @@ -697,7 +697,7 @@ vc4_cl_lookup_bos(struct drm_device *dev, spin_unlock(&file_priv->tab
[PATCH 12/29] drm/i915: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/i915/i915_gem_object.h | 10 +- drivers/gpu/drm/i915/intel_display.c | 24 drivers/gpu/drm/i915/intel_dp_mst.c| 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_object.h b/drivers/gpu/drm/i915/i915_gem_object.h index 5b19a49..8f6c915 100644 --- a/drivers/gpu/drm/i915/i915_gem_object.h +++ b/drivers/gpu/drm/i915/i915_gem_object.h @@ -257,25 +257,25 @@ __attribute__((nonnull)) static inline struct drm_i915_gem_object * i915_gem_object_get(struct drm_i915_gem_object *obj) { - drm_gem_object_reference(&obj->base); + drm_gem_object_get(&obj->base); return obj; } __deprecated -extern void drm_gem_object_reference(struct drm_gem_object *); +extern void drm_gem_object_get(struct drm_gem_object *); __attribute__((nonnull)) static inline void i915_gem_object_put(struct drm_i915_gem_object *obj) { - __drm_gem_object_unreference(&obj->base); + __drm_gem_object_put(&obj->base); } __deprecated -extern void drm_gem_object_unreference(struct drm_gem_object *); +extern void drm_gem_object_put(struct drm_gem_object *); __deprecated -extern void drm_gem_object_unreference_unlocked(struct drm_gem_object *); +extern void drm_gem_object_put_unlocked(struct drm_gem_object *); static inline void i915_gem_object_lock(struct drm_i915_gem_object *obj) { diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index dec9e58..b4d03cf 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2672,10 +2672,10 @@ update_state_fb(struct drm_plane *plane) return; if (plane->state->fb) - drm_framebuffer_unreference(plane->state->fb); + drm_framebuffer_put(plane->state->fb); plane->state->fb = plane->fb; if (plane->state->fb) - drm_framebuffer_reference(plane->state->fb); + drm_framebuffer_get(plane->state->fb); } static void @@ -2746,7 +2746,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, if (intel_plane_ggtt_offset(state) == plane_config->base) { fb = c->primary->fb; - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); goto valid_fb; } } @@ -2777,7 +2777,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, intel_crtc->pipe, PTR_ERR(intel_state->vma)); intel_state->vma = NULL; - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); return; } @@ -2798,7 +2798,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, if (i915_gem_object_is_tiled(obj)) dev_priv->preserve_bios_swizzle = true; - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); primary->fb = primary->state->fb = fb; primary->crtc = primary->state->crtc = &intel_crtc->base; @@ -9668,7 +9668,7 @@ mode_fits_in_fbdev(struct drm_device *dev, if (obj->base.size < mode->vdisplay * fb->pitches[0]) return NULL; - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); return fb; #else return NULL; @@ -9849,7 +9849,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, if (ret) goto fail; - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode); if (ret) @@ -10159,7 +10159,7 @@ static void intel_unpin_work_fn(struct work_struct *__work) intel_frontbuffer_flip_complete(to_i915(dev), to_intel_plane(primary)->frontbuffer_bit); intel_fbc_post_update(crtc); - drm_framebuffer_unreference(work->old_fb); + drm_framebuffer_put(work->old_fb); BUG_ON(atomic_read(&crtc->unpin_work_count) == 0); atomic_dec(&crtc->unpin_work_count); @@ -10799,7 +10799,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, flush_workqueue(dev_priv->wq); /* Reference the objects for the scheduled work. */ - drm_framebuffer_reference(work->old_fb); + drm_framebuffer_get(work->old_fb); crtc->primary->fb = fb; update_state_fb(crtc->primary); @@ -10913,7 +10913,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, update_state_fb(crtc->primary); i915_gem_object_put(obj); - drm_framebuff
[PATCH 27/29] drm/virtio: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/virtio/virtgpu_display.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 14 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index d51bd45..ef2d450 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -53,7 +53,7 @@ static void virtio_gpu_user_framebuffer_destroy(struct drm_framebuffer *fb) struct virtio_gpu_framebuffer *virtio_gpu_fb = to_virtio_gpu_framebuffer(fb); - drm_gem_object_unreference_unlocked(virtio_gpu_fb->obj); + drm_gem_object_put_unlocked(virtio_gpu_fb->obj); drm_framebuffer_cleanup(fb); kfree(virtio_gpu_fb); } @@ -326,7 +326,7 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev, ret = virtio_gpu_framebuffer_init(dev, virtio_gpu_fb, mode_cmd, obj); if (ret) { kfree(virtio_gpu_fb); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return NULL; } diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index cc025d8..78da210 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -72,7 +72,7 @@ int virtio_gpu_gem_create(struct drm_file *file, *obj_p = &obj->gem_base; /* drop reference from allocate - handle holds it now */ - drm_gem_object_unreference_unlocked(&obj->gem_base); + drm_gem_object_put_unlocked(&obj->gem_base); *handle_p = handle; return 0; @@ -137,7 +137,7 @@ int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, return -ENOENT; obj = gem_to_virtio_gpu_obj(gobj); *offset_p = virtio_gpu_object_mmap_offset(obj); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return 0; } diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index b94bd54..461f81a 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -86,7 +86,7 @@ static void virtio_gpu_unref_list(struct list_head *head) bo = buf->bo; qobj = container_of(bo, struct virtio_gpu_object, tbo); - drm_gem_object_unreference_unlocked(&qobj->gem_base); + drm_gem_object_put_unlocked(&qobj->gem_base); } } @@ -261,7 +261,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data, ret = virtio_gpu_object_attach(vgdev, qobj, res_id, NULL); } else { /* use a gem reference since unref list undoes them */ - drm_gem_object_reference(&qobj->gem_base); + drm_gem_object_get(&qobj->gem_base); mainbuf.bo = &qobj->tbo; list_add(&mainbuf.head, &validate_list); @@ -304,7 +304,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data, } return ret; } - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); rc->res_handle = res_id; /* similiar to a VM address */ rc->bo_handle = handle; @@ -341,7 +341,7 @@ static int virtio_gpu_resource_info_ioctl(struct drm_device *dev, void *data, ri->size = qobj->gem_base.size; ri->res_handle = qobj->hw_res_handle; - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return 0; } @@ -389,7 +389,7 @@ static int virtio_gpu_transfer_from_host_ioctl(struct drm_device *dev, out_unres: virtio_gpu_object_unreserve(qobj); out: - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return ret; } @@ -439,7 +439,7 @@ static int virtio_gpu_transfer_to_host_ioctl(struct drm_device *dev, void *data, out_unres: virtio_gpu_object_unreserve(qobj); out: - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return ret; } @@ -462,7 +462,7 @@ static int virtio_gpu_wait_ioctl(struct drm_device *dev, void *data, nowait = true; ret = virtio_gpu_object_wait(qobj, nowait); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return ret; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 15/29] drm/mgag200: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/mgag200/mgag200_cursor.c | 2 +- drivers/gpu/drm/mgag200/mgag200_fb.c | 4 ++-- drivers/gpu/drm/mgag200/mgag200_main.c | 10 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c index 2ac3fcb..968e203 100644 --- a/drivers/gpu/drm/mgag200/mgag200_cursor.c +++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c @@ -248,7 +248,7 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc, out_unreserve1: mgag200_bo_unreserve(pixels_2); out_unref: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; } diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c index 5d3b1fa..b0594e1 100644 --- a/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c @@ -233,7 +233,7 @@ static int mgag200fb_create(struct drm_fb_helper *helper, err_alloc_fbi: vfree(sysram); err_sysram: - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); return ret; } @@ -246,7 +246,7 @@ static int mga_fbdev_destroy(struct drm_device *dev, drm_fb_helper_unregister_fbi(&mfbdev->helper); if (mfb->obj) { - drm_gem_object_unreference_unlocked(mfb->obj); + drm_gem_object_put_unlocked(mfb->obj); mfb->obj = NULL; } drm_fb_helper_fini(&mfbdev->helper); diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index dce8a3e..780f983 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -18,7 +18,7 @@ static void mga_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct mga_framebuffer *mga_fb = to_mga_framebuffer(fb); - drm_gem_object_unreference_unlocked(mga_fb->obj); + drm_gem_object_put_unlocked(mga_fb->obj); drm_framebuffer_cleanup(fb); kfree(fb); } @@ -59,13 +59,13 @@ mgag200_user_framebuffer_create(struct drm_device *dev, mga_fb = kzalloc(sizeof(*mga_fb), GFP_KERNEL); if (!mga_fb) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(-ENOMEM); } ret = mgag200_framebuffer_init(dev, mga_fb, mode_cmd, obj); if (ret) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); kfree(mga_fb); return ERR_PTR(ret); } @@ -317,7 +317,7 @@ int mgag200_dumb_create(struct drm_file *file, return ret; ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); if (ret) return ret; @@ -366,6 +366,6 @@ mgag200_dumb_mmap_offset(struct drm_file *file, bo = gem_to_mga_bo(obj); *offset = mgag200_bo_mmap_offset(bo); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 28/29] drm/vmwgfx: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 6f4cb46..d43dce9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -500,7 +500,7 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par, } if (cur_fb) { - drm_framebuffer_unreference(cur_fb); + drm_framebuffer_put(cur_fb); par->set_fb = NULL; } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 5ec24fd..fd4a988 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -316,7 +316,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, out_no_surface: ttm_read_unlock(&dev_priv->reservation_sem); out_no_ttm_lock: - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); out_no_fb: drm_modeset_unlock_all(dev); out_no_copy: @@ -393,7 +393,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, ttm_read_unlock(&dev_priv->reservation_sem); out_no_ttm_lock: - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); out_no_fb: drm_modeset_unlock_all(dev); out_no_copy: -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 06/29] drm/bochs: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_mm.c| 10 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index c38deff..502f9d9 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c @@ -145,7 +145,7 @@ static int bochs_fbdev_destroy(struct bochs_device *bochs) drm_fb_helper_unregister_fbi(&bochs->fb.helper); if (gfb->obj) { - drm_gem_object_unreference_unlocked(gfb->obj); + drm_gem_object_put_unlocked(gfb->obj); gfb->obj = NULL; } diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c index c4cadb6..881b784 100644 --- a/drivers/gpu/drm/bochs/bochs_mm.c +++ b/drivers/gpu/drm/bochs/bochs_mm.c @@ -417,7 +417,7 @@ int bochs_dumb_create(struct drm_file *file, struct drm_device *dev, return ret; ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); if (ret) return ret; @@ -457,7 +457,7 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, bo = gem_to_bochs_bo(obj); *offset = bochs_bo_mmap_offset(bo); - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } @@ -467,7 +467,7 @@ static void bochs_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct bochs_framebuffer *bochs_fb = to_bochs_framebuffer(fb); - drm_gem_object_unreference_unlocked(bochs_fb->obj); + drm_gem_object_put_unlocked(bochs_fb->obj); drm_framebuffer_cleanup(fb); kfree(fb); } @@ -518,13 +518,13 @@ bochs_user_framebuffer_create(struct drm_device *dev, bochs_fb = kzalloc(sizeof(*bochs_fb), GFP_KERNEL); if (!bochs_fb) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(-ENOMEM); } ret = bochs_framebuffer_init(dev, bochs_fb, mode_cmd, obj); if (ret) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); kfree(bochs_fb); return ERR_PTR(ret); } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 16/29] drm/msm: switch to drm_*{get,put} helpers
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 10 +- drivers/gpu/drm/msm/adreno/a5xx_power.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 6 +++--- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++-- drivers/gpu/drm/msm/msm_drv.c | 8 drivers/gpu/drm/msm/msm_fb.c | 4 ++-- drivers/gpu/drm/msm/msm_fbdev.c | 2 +- drivers/gpu/drm/msm/msm_gem.c | 8 drivers/gpu/drm/msm/msm_gem_submit.c | 4 ++-- drivers/gpu/drm/msm/msm_gpu.c | 4 ++-- drivers/gpu/drm/msm/msm_ringbuffer.c | 2 +- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index b4b54f1..12d0f9c 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -303,7 +303,7 @@ static struct drm_gem_object *a5xx_ucode_load_bo(struct msm_gpu *gpu, ptr = msm_gem_get_vaddr(bo); if (!ptr) { - drm_gem_object_unreference(bo); + drm_gem_object_put(bo); return ERR_PTR(-ENOMEM); } @@ -311,7 +311,7 @@ static struct drm_gem_object *a5xx_ucode_load_bo(struct msm_gpu *gpu, int ret = msm_gem_get_iova(bo, gpu->aspace, iova); if (ret) { - drm_gem_object_unreference(bo); + drm_gem_object_put(bo); return ERR_PTR(ret); } } @@ -697,19 +697,19 @@ static void a5xx_destroy(struct msm_gpu *gpu) if (a5xx_gpu->pm4_bo) { if (a5xx_gpu->pm4_iova) msm_gem_put_iova(a5xx_gpu->pm4_bo, gpu->aspace); - drm_gem_object_unreference_unlocked(a5xx_gpu->pm4_bo); + drm_gem_object_put_unlocked(a5xx_gpu->pm4_bo); } if (a5xx_gpu->pfp_bo) { if (a5xx_gpu->pfp_iova) msm_gem_put_iova(a5xx_gpu->pfp_bo, gpu->aspace); - drm_gem_object_unreference_unlocked(a5xx_gpu->pfp_bo); + drm_gem_object_put_unlocked(a5xx_gpu->pfp_bo); } if (a5xx_gpu->gpmu_bo) { if (a5xx_gpu->gpmu_iova) msm_gem_put_iova(a5xx_gpu->gpmu_bo, gpu->aspace); - drm_gem_object_unreference_unlocked(a5xx_gpu->gpmu_bo); + drm_gem_object_put_unlocked(a5xx_gpu->gpmu_bo); } adreno_gpu_cleanup(adreno_gpu); diff --git a/drivers/gpu/drm/msm/adreno/a5xx_power.c b/drivers/gpu/drm/msm/adreno/a5xx_power.c index 87af6ee..620 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_power.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_power.c @@ -330,7 +330,7 @@ void a5xx_gpmu_ucode_init(struct msm_gpu *gpu) if (a5xx_gpu->gpmu_iova) msm_gem_put_iova(a5xx_gpu->gpmu_bo, gpu->aspace); if (a5xx_gpu->gpmu_bo) - drm_gem_object_unreference(a5xx_gpu->gpmu_bo); + drm_gem_object_put(a5xx_gpu->gpmu_bo); a5xx_gpu->gpmu_bo = NULL; a5xx_gpu->gpmu_iova = 0; diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index f1ab270..15de821 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -433,7 +433,7 @@ void adreno_gpu_cleanup(struct adreno_gpu *adreno_gpu) if (adreno_gpu->memptrs_iova) msm_gem_put_iova(adreno_gpu->memptrs_bo, gpu->aspace); - drm_gem_object_unreference_unlocked(adreno_gpu->memptrs_bo); + drm_gem_object_put_unlocked(adreno_gpu->memptrs_bo); } release_firmware(adreno_gpu->pm4); release_firmware(adreno_gpu->pfp); diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c index 615e1de..4680b70 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c @@ -129,7 +129,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val) struct msm_kms *kms = &mdp4_kms->base.base; msm_gem_put_iova(val, kms->aspace); - drm_gem_object_unreference_unlocked(val); + drm_gem_object_put_unlocked(val); } static void mdp4_crtc_destroy(struct drm_crtc *crtc) @@ -373,7 +373,7 @@ static void update_cursor(struct drm_crtc *crtc) if (next_bo) { /* take a obj ref + iova ref when we start scanning out: */ - drm_gem_object_reference(next_bo); +