Re: [linux-sunxi] [PATCH] drm/panel: simple: Fix width and height for Olimex LCD-OLinuXino-4.3TS

2017-08-03 Thread Chen-Yu Tsai
On Thu, Jul 20, 2017 at 6:29 PM, Jonathan Liu  wrote:
> The physical size of the panel is 105.5 (W) x 67.2 (H) x 4.05 (D) mm
> but the active display area is 95.04 (W) x 53.856 (H) mm.
>
> The width and height should be set to the active display area.
>
> Signed-off-by: Jonathan Liu 

You probably want:

Fixes: cf5c9e6dc70d ("drm/panel: simple: Add timings for the Olimex
  LCD-OLinuXino-4.3TS")

Otherwise,

Reviewed-by: Chen-Yu Tsai 

against the panel datasheet linked from Olimex's product page.
This should probably go in through drm-misc?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [linux-sunxi] [PATCH 10/13] [NOT FOR REVIEW NOW] clk: sunxi: Add CLK_SET_RATE_PARENT flag for H3 HDMI clock

2017-08-03 Thread Chen-Yu Tsai
Hi,

On Tue, Aug 1, 2017 at 9:13 PM, Icenowy Zheng  wrote:
> From: Jernej Skrabec 
>
> When setting the HDMI clock of H3, the PLL_VIDEO clock needs to be set.
>
> Add CLK_SET_RATE_PARENT flag for H3 HDMI clock.
>
> Signed-off-by: Jernej Skrabec 
> Signed-off-by: Icenowy Zheng 
> ---
>  drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c 
> b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
> index b1127e8629d9..2ebb3d865b01 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
> @@ -474,7 +474,7 @@ static SUNXI_CCU_GATE(avs_clk,  "avs",
>   "osc24M",
>
>  static const char * const hdmi_parents[] = { "pll-video" };
>  static SUNXI_CCU_M_WITH_MUX_GATE(hdmi_clk, "hdmi", hdmi_parents,
> -0x150, 0, 4, 24, 2, BIT(31), 0);
> +0x150, 0, 4, 24, 2, BIT(31), 
> CLK_SET_RATE_PARENT);

Line is longer than 80 characters.

This looks independent enough so I've merged this for 4.14 with the
offending line wrapped and the following tag added:

Fixes: 0577e4853bfb ("clk: sunxi-ng: Add H3 clocks")

ChenYu

>
>  static SUNXI_CCU_GATE(hdmi_ddc_clk,"hdmi-ddc", "osc24M",
>   0x154, BIT(31), 0);
> --
> 2.13.0
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
___
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

2017-08-03 Thread Michel Dänzer
On 03/08/17 10:54 PM, 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.

Are you sure that this is working as intended?
https://bugs.freedesktop.org/show_bug.cgi?id=100399 sounds like
unbinding works even while Xorg is using the DRM device.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [linux-sunxi] [PATCH 03/13] drm: sun4i: add support for H3's TCON

2017-08-03 Thread Chen-Yu Tsai
On Tue, Aug 1, 2017 at 9:12 PM, Icenowy Zheng  wrote:
> From: Icenowy Zheng 
>
> Allwinner H3 has two special TCONs without channel 0.
>
> Add support for this kind of TCON.
>
> Signed-off-by: Icenowy Zheng 

Ideally you would split this into two patches. The first one would add
the quirks support for TCONs without channel 0. I can also use this for
the A80. The second would add the H3 TCON.

ChenYu
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101731] System freeze with AMDGPU when playing The Witcher 3

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101731

--- Comment #22 from Shmerl  ---
Did anyone try to reproduce this bug with AMD kernel that supports display code
(i.e. one with Vega support)?

-- 
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 v1.1] drm/rockchip: fix race with kms hotplug and fbdev

2017-08-03 Thread Sandy Huang

Hi Mark,

在 2017/8/1 16:11, Mark Yao 写道:

According to the kerneldoc[0], should do fbdev setup before calling
drm_kms_helper_poll_init(), otherwise, Kms hotplug event may race
into fbdev helper initial, and fb_helper->dev may be NULL pointer,
that would cause the bug:
[0.735411] [0200] *pgd=f6ffe003, *pud=f6ffe003, 
*pmd=
[0.736156] Internal error: Oops: 9605 [#1] PREEMPT SMP
[0.736648] Modules linked in:
[0.736930] CPU: 2 PID: 20 Comm: kworker/2:0 Not tainted 4.4.41 #20
[0.737480] Hardware name: Rockchip RK3399 Board rev2 (BOX) (DT)
[0.738020] Workqueue: events cdn_dp_pd_event_work
[0.738447] task: ffc0f21f3100 ti: ffc0f2218000 task.ti: 
ffc0f2218000
[0.739109] PC is at mutex_lock+0x14/0x44
[0.739469] LR is at drm_fb_helper_hotplug_event+0x30/0x114
[0.756253] [] mutex_lock+0x14/0x44
[0.756260] [] drm_fb_helper_hotplug_event+0x30/0x114
[0.756271] [] rockchip_drm_output_poll_changed+0x18/0x20
[0.756280] [] drm_kms_helper_hotplug_event+0x28/0x34
[0.756286] [] cdn_dp_pd_event_work+0x394/0x3c4
[0.756295] [] process_one_work+0x218/0x3e0
[0.756302] [] worker_thread+0x2e8/0x404
[0.756308] [] kthread+0xe8/0xf0
[0.756316] [] ret_from_fork+0x10/0x40

[0]: https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms-helpers.html

Signed-off-by: Mark Yao 
---
Changes in v1.1:
- According to the kerneldoc, fix the race bug in generic way.

  drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 13 ++---
  1 file changed, 6 insertions(+), 7 deletions(-)


Reviewed-by: Sandy huang 

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101976] glmark2 random blank or background only screen freeze over mesa3d 17.1 and 17.3 with radeon rx550 AMD POLARIS12

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101976

--- Comment #8 from Pablo Estigarribia  ---
(In reply to Pablo Estigarribia from comment #7)
> I have tried now two more combinations (in /etc/environment to stabilize
> gnome session):
> 
> MESA_GL_VERSION_OVERRIDE=3.0
> MESA_GL_VERSION_OVERRIDE=3.1 
> 
> Up to GL 3.0, everything works fine and stable, glmark2 and gnome session. 
> 
> With 3.1 or any other higher glmark2 shows only black content on the window
> opened when I use MESA_GL_VERSION_OVERRIDE=3.1 glmark2 in same session that
> I openned using /etc/environment. 
> 
> If I change to: 
> 
> MESA_GL_VERSION_OVERRIDE=3.1 in /etc/environment, then also gnome session
> (after login in gdm) got "gdm background" with screen freezed video.

after new tests I got error also with 3.0, still doing more tests.

-- 
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 101976] glmark2 random blank or background only screen freeze over mesa3d 17.1 and 17.3 with radeon rx550 AMD POLARIS12

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101976

--- Comment #7 from Pablo Estigarribia  ---
I have tried now two more combinations (in /etc/environment to stabilize gnome
session):

MESA_GL_VERSION_OVERRIDE=3.0
MESA_GL_VERSION_OVERRIDE=3.1 

Up to GL 3.0, everything works fine and stable, glmark2 and gnome session. 

With 3.1 or any other higher glmark2 shows only black content on the window
opened when I use MESA_GL_VERSION_OVERRIDE=3.1 glmark2 in same session that I
openned using /etc/environment. 

If I change to: 

MESA_GL_VERSION_OVERRIDE=3.1 in /etc/environment, then also gnome session
(after login in gdm) got "gdm background" with screen freezed video.

-- 
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 v5 03/14] drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths

2017-08-03 Thread Peter Rosin
On 2017-07-14 15:54, Daniel Vetter wrote:
> On Thu, Jul 13, 2017 at 06:25:27PM +0200, Peter Rosin wrote:
>> The legacy path implements setcmap in terms of crtc .gamma_set.
>>
>> The atomic path implements setcmap by directly updating the crtc gamma_lut
>> property.
>>
>> This has a couple of benefits:
>> - it makes the redundant fb helpers .load_lut, .gamma_set and .gamma_get
>>   completely obsolete. They are now unused and subject for removal.
>> - atomic drivers that support clut modes get fbdev support for those from
>>   the drm core. This includes atmel-hlcdc, but perhaps others as well?
>>
>> Signed-off-by: Peter Rosin 
> 
> Ok, I merged the core parts. I'll wait with the driver stuff for a bit
> more (maybe 1-2 weeks) for more acks. Pls remind me in case I forget to
> pull them in.
> 
> Thanks a lot for doing this, great work!
> -Daniel

I don't see the rest it in drm-misc-next and you asked for it, so ping :-)

Cheers,
Peter
___
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

2017-08-03 Thread David Lechner

On 08/03/2017 08:08 PM, David Lechner wrote:

On 08/03/2017 03:11 PM, Noralf Trønnes wrote:


Den 03.08.2017 19.11, skrev Andy Shevchenko:

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



That pdf refers to another one: 
http://wiki.seeed.cc/Grove-OLED_Display_0.96inch/
There's an fbdev driver that supports ssd1305, ssd1306, ssd1307 and 
ssd1309:
https://www.kernel.org/doc/Documentation/devicetree/bindings/display/ssd1307fb.txt 

http://elixir.free-electrons.com/linux/latest/source/drivers/video/fbdev/ssd1307fb.c 


Maybe the ssd1308 will work with that driver...



The display I have uses a ssd1327 controller. It is 16-bit grayscale. 
The ssd130x are all 1-bit monochrome. So, probably more like the ssd1325 
driver in fbftf.


correction, 4-bit grayscale
___
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

2017-08-03 Thread David Lechner

On 08/03/2017 03:11 PM, Noralf Trønnes wrote:


Den 03.08.2017 19.11, skrev Andy Shevchenko:

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



That pdf refers to another one: 
http://wiki.seeed.cc/Grove-OLED_Display_0.96inch/
There's an fbdev driver that supports ssd1305, ssd1306, ssd1307 and 
ssd1309:
https://www.kernel.org/doc/Documentation/devicetree/bindings/display/ssd1307fb.txt 

http://elixir.free-electrons.com/linux/latest/source/drivers/video/fbdev/ssd1307fb.c 


Maybe the ssd1308 will work with that driver...



The display I have uses a ssd1327 controller. It is 16-bit grayscale. 
The ssd130x are all 1-bit monochrome. So, probably more like the ssd1325 
driver in fbftf.

___
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.

2017-08-03 Thread Dave Airlie
On 4 August 2017 at 09:22, Chris Wilson  wrote:
> Quoting Dave Airlie (2017-08-04 00:01:10)
>> On 4 August 2017 at 02:25, Chris Wilson  wrote:
>> > 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).
>>
>> The interface is consistent for the objects.
>>
>> With a sync_fd import you import the state into an existing syncobj.
>>
>> With a syncobj import you import the object into the current process state
>> (so get a new handle).
>
> You can say the same for either path though, e.g.
>
> With a sync fd import you import the fence into the current process state
> (so get a new handle).

You import the fence, not the sync_fd. There is a difference here. A syncobj
has a fence underlying it, it makes sense to import a new fence state into
an existing object. It doesn't make sense to import a new syncobj into an
existing object. It would be like importing a GEM object into a GEM object.

I expect document it and be done is the best answer unless we can come up
with a userspace use case that really expects the other behaviour.

Dave.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 5/6] drm/rockchip: vop: report error when check resource error

2017-08-03 Thread Sandy Huang

Hi mark,

在 2017/7/31 17:49, Mark Yao 写道:

The user would be confused while facing a error commit without
any error report.

Signed-off-by: Mark Yao 
---
  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index fa0d9f7..999c2e0 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -674,8 +674,10 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
 * Src.x1 can be odd when do clip, but yuv plane start point
 * need align with 2 pixel.
 */
-   if (is_yuv_support(fb->format->format) && ((state->src.x1 >> 16) % 2))
+   if (is_yuv_support(fb->format->format) && ((state->src.x1 >> 16) % 2)) {
+   DRM_ERROR("Invalid Source: Yuv format not support odd xpos\n");
return -EINVAL;
+   }
  
  	return 0;

  }



Reviewed-by: Sandy huang 

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 4/6] drm/rockchip: vop: round_up pitches to word align

2017-08-03 Thread Sandy Huang



在 2017/7/31 17:49, Mark Yao 写道:

VOP pitch register is word align, need align to word.

VOP_WIN0_VIR:
   bit[31:16] win0_vir_stride_uv
 Number of words of Win0 uv Virtual width
   bit[15:0] win0_vir_width
 Number of words of Win0 yrgb Virtual width
 ARGB888 : win0_vir_width
 RGB888 : (win0_vir_width*3/4) + (win0_vir_width%3)
 RGB565 : ceil(win0_vir_width/2)
 YUV : ceil(win0_vir_width/4)

Signed-off-by: Mark Yao 
---
  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)



Reviewed-by: Sandy huang 

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/6] drm/rockchip: vop: fix NV12 video display error

2017-08-03 Thread Sandy Huang

Hi mark,

在 2017/7/31 17:49, Mark Yao 写道:

fixup the scale calculation formula on the case
src_height == (dst_height/2).

Signed-off-by: Mark Yao 
---
  drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
index af1091f..56bbd2e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
@@ -299,6 +299,9 @@ static inline uint16_t scl_get_bili_dn_vskip(int src_h, int 
dst_h,
  
  	act_height = (src_h + vskiplines - 1) / vskiplines;
  
+	if (act_height == dst_h)

+   return GET_SCL_FT_BILI_DN(src_h, dst_h) / vskiplines;
+
return GET_SCL_FT_BILI_DN(act_height, dst_h);
  }
  



Reviewed-by: Sandy huang 

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 2/2] ARM: dts: exynos: Add HDMI and Sil9234 to Trats2 board

2017-08-03 Thread Krzysztof Kozlowski
On Thu, Aug 03, 2017 at 09:45:23AM +0200, Maciej Purski wrote:
> This patch adds HDMI and Sil9234 MHL converter to Trats2 board.

Just "Add HDMI...", without this patch.

Except few minor nitpicks below, looks good. After fixing I will take it
once bindings got accepted.

> 
> 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 = < 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 = < 4 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> + vin-supply = <_reg>;

I think the supply is V_BAT, not buck7.

> + };
>   };
>  
>   gpio-keys {
> @@ -229,6 +239,34 @@
>   };
>   };
>  
> + i2c-mhl {
> + compatible = "i2c-gpio";
> + gpios = < 4 GPIO_ACTIVE_HIGH  6 GPIO_ACTIVE_HIGH>;
> + i2c-gpio,delay-us = <100>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + pinctrl-0 = <_mhl_bus>;
> + pinctrl-names = "default";
> + status = "okay";
> +
> + sii9234: sii9234@39 {

The name of node should be rather generic (ePAPR: "The name of a node
should be somewhat generic, reflecting the function of the device and
not its precise programming model").

So maybe "sii9234: hdmi-bridge@39"?

> + compatible = "sil,sii9234";
> + vcc-supply = <>;
> + reset-gpios = < 4 GPIO_ACTIVE_HIGH>;
> + interrupt-parent = <>;
> + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
> + reg = <0x39>;
> +
> +

One empty line instead of two.

> + port {
> + mhl_to_hdmi: endpoint {
> + remote-endpoint = <_to_mhl>;
> + };
> + };
> + };
> + };
> +
>   camera: camera {
>   pinctrl-0 = <_port_a_clk_active _port_b_clk_active>;
>   pinctrl-names = "default";
> @@ -522,6 +560,31 @@
>   status = "okay";
>  };
>  
> + {
> + hpd-gpios = < 7 GPIO_ACTIVE_HIGH>;
> + pinctrl-names = "default";
> + pinctrl-0 = <_hpd>;
> + hdmi-en-supply = <>;
> + vdd-supply = <_reg>;
> + vdd_osc-supply = <_reg>;
> + vdd_pll-supply = <_reg>;
> + ddc = <_5>;
> + status = "okay";
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@1 {
> + reg = <1>;
> + hdmi_to_mhl: endpoint {
> + remote-endpoint = <_to_hdmi>;
> + };
> + };
> + };
> +

Unnecessary empty line.

> +};
> +
>   {
>   vusb_d-supply = <_reg>;
>   vusb_a-supply = <_reg>;
> @@ -600,6 +663,11 @@
>   };
>  };
>  
> +
> +_5 {
> + status = "okay";
> +};

Could you describe more what is on i2c_5 and i2c_8? Is it relevant to
this patch?

> +
>  _7 {
>   samsung,i2c-sda-delay = <100>;
>   samsung,i2c-slave-addr = <0x10>;
> @@ -894,12 +962,20 @@
>   };
>  };
>  
> +_8 {
> + status = "okay";
> +};
> +
>   {
>   pinctrl-0 = <_bus>;
>   pinctrl-names = "default";
>   status = "okay";
>  };
>  
> + {
> + status = "okay";
> +};
> +
>  _0 {
>   num-slots = <1>;
>   broken-cd;
> @@ -926,6 +1002,18 @@
>   pinctrl-names = "default";
>   pinctrl-0 = <>;
>  
> + mhl_int: mhl-int {
> + samsung,pins = "gpf3-5";
> + samsung,pin-pud = <0>;

Please use defines from dt-bindings/pinctrl/samsung.h

> + };
> +
> + i2c_mhl_bus: i2c-mhl-bus {
> + samsung,pins = "gpf0-4", "gpf0-6";
> + samsung,pin-function = <2>;
> + samsung,pin-pud = <1>;
> + samsung,pin-drv = <0>;

The same.

Best regards,
Krzysztof
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/4] dt-bindings: adi,adv7511.txt: document cec clock

2017-08-03 Thread Rob Herring
On Sun, Jul 30, 2017 at 03:07:40PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> Document the cec clock binding.
> 
> Signed-off-by: Hans Verkuil 
> ---
>  Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt | 4 
>  1 file changed, 4 insertions(+)

Acked-by: Rob Herring 
___
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.

2017-08-03 Thread Chris Wilson
Quoting Dave Airlie (2017-08-04 00:01:10)
> On 4 August 2017 at 02:25, Chris Wilson  wrote:
> > 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).
> 
> The interface is consistent for the objects.
> 
> With a sync_fd import you import the state into an existing syncobj.
> 
> With a syncobj import you import the object into the current process state
> (so get a new handle).

You can say the same for either path though, e.g.

With a sync fd import you import the fence into the current process state
(so get a new handle).

One process is using explict sync file fencing, presumably passing it to
kms and other consumers,and passes it to a second process that prefers to
use syncobj and so encapsulates it.
 
> I can't think of a use case for anything else, maybe having a sync_fd state
> imported into a new syncobj? but not sure it really helps.

Yes, I expect taking a sync_file fd and generating a new syncobj is just
as desired as taking a syncobj fd and generating a new synbocj.
Conversely, importing a syncobj fd into a preallocated syncobj makes
just as much sense as for a sync_file fd.
 
> Userspace should be using different paths to get to these interfaces.

Still the interfaces are different for no good reason, which certainly
makes for a surprising API.
-Chris
___
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.

2017-08-03 Thread Dave Airlie
On 4 August 2017 at 02:25, Chris Wilson  wrote:
> 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).

The interface is consistent for the objects.

With a sync_fd import you import the state into an existing syncobj.

With a syncobj import you import the object into the current process state
(so get a new handle).

I can't think of a use case for anything else, maybe having a sync_fd state
imported into a new syncobj? but not sure it really helps.

Userspace should be using different paths to get to these interfaces.

Dave.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/tinydrm: mipi-dbi: Fix unbalanced DMA access

2017-08-03 Thread David Lechner

On 08/01/2017 03:14 PM, David Lechner wrote:

If we return here and import_attach is true, then dma_buf_end_cpu_access()
will not be called balance dma_buf_begin_cpu_access().

Fix by setting ret instead of returning.

Signed-off-by: David Lechner 
---
  drivers/gpu/drm/tinydrm/mipi-dbi.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c 
b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index c83eeb7..e10fa4b 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -183,7 +183,8 @@ static int mipi_dbi_buf_copy(void *dst, struct 
drm_framebuffer *fb,
dev_err_once(fb->dev->dev, "Format is not supported: %s\n",
 drm_get_format_name(fb->format->format,
 _name));
-   return -EINVAL;
+   ret = -EINVAL;
+   break;
}
  
  	if (import_attach)





I just realized that the next line here can mask ret.


if (import_attach)
ret = dma_buf_end_cpu_access(import_attach->dmabuf,
 DMA_FROM_DEVICE);

So, we should either ignore the return value from 
dma_buf_end_cpu_access() always or add some logic to ignore it if ret is 
already an error.


In some of the other patches I have been sending, we have the same 
situation. I those, I have opted to just ignore the return value from 
dma_buf_end_cpu_access(). e.g...



if (import_attach)
dma_buf_end_cpu_access(import_attach->dmabuf, DMA_FROM_DEVICE);

Is this a reasonable thing to do?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 4/6] drm/tinydrm: add support for LEGO MINDSTORMS EV3 LCD

2017-08-03 Thread David Lechner
LEGO MINDSTORMS EV3 has an LCD with a ST7586 controller. This adds a new
module for the ST7586 controller with parameters for the LEGO MINDSTORMS
EV3 LCD display.

Signed-off-by: David Lechner 
---
 MAINTAINERS  |   6 +
 drivers/gpu/drm/tinydrm/Kconfig  |  10 +
 drivers/gpu/drm/tinydrm/Makefile |   1 +
 drivers/gpu/drm/tinydrm/st7586.c | 466 +++
 4 files changed, 483 insertions(+)
 create mode 100644 drivers/gpu/drm/tinydrm/st7586.c

diff --git a/MAINTAINERS b/MAINTAINERS
index a1e772e..9643f95 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4365,6 +4365,12 @@ S:   Maintained
 F: drivers/gpu/drm/tinydrm/repaper.c
 F: Documentation/devicetree/bindings/display/repaper.txt
 
+DRM DRIVER FOR SITRONIX ST7586 PANELS
+M: David Lechner 
+S: Maintained
+F: drivers/gpu/drm/tinydrm/st7586.c
+F: Documentation/devicetree/bindings/display/st7586.txt
+
 DRM DRIVER FOR RAGE 128 VIDEO CARDS
 S: Orphan / Obsolete
 F: drivers/gpu/drm/r128/
diff --git a/drivers/gpu/drm/tinydrm/Kconfig b/drivers/gpu/drm/tinydrm/Kconfig
index f17c3ca..2e790e7 100644
--- a/drivers/gpu/drm/tinydrm/Kconfig
+++ b/drivers/gpu/drm/tinydrm/Kconfig
@@ -32,3 +32,13 @@ config TINYDRM_REPAPER
  2.71" TFT EPD Panel (E2271CS021)
 
  If M is selected the module will be called repaper.
+
+config TINYDRM_ST7586
+   tristate "DRM support for Sitronix ST7586 display panels"
+   depends on DRM_TINYDRM && SPI
+   select TINYDRM_MIPI_DBI
+   help
+ DRM driver for the following Sitronix ST7586 panels:
+ * LEGO MINDSTORMS EV3
+
+ If M is selected the module will be called st7586.
diff --git a/drivers/gpu/drm/tinydrm/Makefile b/drivers/gpu/drm/tinydrm/Makefile
index 95bb4d4..0c184bd 100644
--- a/drivers/gpu/drm/tinydrm/Makefile
+++ b/drivers/gpu/drm/tinydrm/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_TINYDRM_MIPI_DBI)  += mipi-dbi.o
 # Displays
 obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o
 obj-$(CONFIG_TINYDRM_REPAPER)  += repaper.o
+obj-$(CONFIG_TINYDRM_ST7586)   += st7586.o
diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c
new file mode 100644
index 000..11e226d
--- /dev/null
+++ b/drivers/gpu/drm/tinydrm/st7586.c
@@ -0,0 +1,466 @@
+/*
+ * DRM driver for Sitronix ST7586 panels
+ *
+ * Copyright 2017 David Lechner 
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+/* controller-specific commands */
+#define ST7586_DISP_MODE_GRAY  0x38
+#define ST7586_DISP_MODE_MONO  0x39
+#define ST7586_ENABLE_DDRAM0x3a
+#define ST7586_SET_DISP_DUTY   0xb0
+#define ST7586_SET_PART_DISP   0xb4
+#define ST7586_SET_NLINE_INV   0xb5
+#define ST7586_SET_VOP 0xc0
+#define ST7586_SET_BIAS_SYSTEM 0xc3
+#define ST7586_SET_BOOST_LEVEL 0xc4
+#define ST7586_SET_VOP_OFFSET  0xc7
+#define ST7586_ENABLE_ANALOG   0xd0
+#define ST7586_AUTO_READ_CTRL  0xd7
+#define ST7586_OTP_RW_CTRL 0xe0
+#define ST7586_OTP_CTRL_OUT0xe1
+#define ST7586_OTP_READ0xe3
+
+#define ST7586_DISP_CTRL_MXBIT(6)
+#define ST7586_DISP_CTRL_MYBIT(7)
+
+static void st7586_xrgb_to_gray332(u8 *dst, void *vaddr,
+  struct drm_framebuffer *fb,
+  struct drm_clip_rect *clip)
+{
+   size_t len = (clip->x2 - clip->x1) * (clip->y2 - clip->y1);
+   unsigned int x, y;
+   u8 *src, *buf, val;
+
+   /* 3 pixels per byte, so grow clip to nearest multiple of 3 */
+   clip->x1 = clip->x1 / 3 * 3;
+   clip->x2 = (clip->x2 + 2) / 3 * 3;
+
+   buf = kmalloc(len, GFP_KERNEL);
+   if (!buf)
+   return;
+
+   tinydrm_xrgb_to_gray8(buf, vaddr, fb, clip);
+   src = buf;
+
+   for (y = clip->y1; y < clip->y2; y++) {
+   for (x = clip->x1; x < clip->x2; x += 3) {
+   val = *src++ & 0xc0;
+   if (val & 0xc0)
+   val |= 0x20;
+   val |= (*src++ & 0xc0) >> 3;
+   if (val & 0x18)
+   val |= 0x04;
+   val |= *src++ >> 6;
+   *dst++ = ~val;
+   }
+   }
+
+   /* now adjust the clip so it applies to dst */
+   clip->x1 /= 3;
+   clip->x2 /= 3;
+
+   kfree(buf);
+}
+
+static int st7586_buf_copy(void *dst, struct drm_framebuffer *fb,
+  struct drm_clip_rect *clip)
+{
+   struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+   

[PATCH v3 0/6] Support for LEGO MINDSTORMS EV3 LCD display

2017-08-03 Thread David Lechner
The goal of this series is to get the built-in LCD of the LEGO MINDSTORMS EV3
working.

v2 changes:
* Wrote a new driver for ST7586 instead of combining it with existing drivers
* Don't touch MIPI DBI code (other than the patch suggested by Noralf)
* New defconfig patch

v3 changes:
* New patch to generalize tinydrm_xrgb_to_gray8() so that it can be reused.
* Device tree bindings in separate patch.
* Fixed incorrect device tree binding pin descriptions.
* Added MAINTAINERS entry for drivers/gpu/drm/tinydrm/st7586.c.
* Removed "mipi_dbi_" from function names in st7586.c.
* Moved init and fini to pipe_enable and pipe_disable ops.
* Dropped RGB565 format.
* Made adjustments for the fact the controller cannot be read via SPI.
* Dropped st7586.h - values moved into st7586.c.

David Lechner (6):
  drm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init()
  drm/tinydrm: generalize tinydrm_xrgb_to_gray8()
  dt-bindings: add binding for Sitronix ST7586 display panels
  drm/tinydrm: add support for LEGO MINDSTORMS EV3 LCD
  ARM: dts: da850-lego-ev3: Add node for LCD display
  ARM: davinci_all_defconfig: enable tinydrm and ST7586

 .../bindings/display/sitronix,st7586.txt   |  26 ++
 MAINTAINERS|   6 +
 arch/arm/boot/dts/da850-lego-ev3.dts   |  24 ++
 arch/arm/configs/davinci_all_defconfig |   2 +
 drivers/gpu/drm/tinydrm/Kconfig|  10 +
 drivers/gpu/drm/tinydrm/Makefile   |   1 +
 drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c |  35 +-
 drivers/gpu/drm/tinydrm/mi0283qt.c |   8 +-
 drivers/gpu/drm/tinydrm/mipi-dbi.c |  17 +-
 drivers/gpu/drm/tinydrm/repaper.c  |  21 +-
 drivers/gpu/drm/tinydrm/st7586.c   | 466 +
 include/drm/tinydrm/mipi-dbi.h |   6 +-
 include/drm/tinydrm/tinydrm-helpers.h  |   3 +-
 13 files changed, 582 insertions(+), 43 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/sitronix,st7586.txt
 create mode 100644 drivers/gpu/drm/tinydrm/st7586.c

-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 1/6] drm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init()

2017-08-03 Thread David Lechner
This removes the call to mipi_dbi_init() from mipi_dbi_spi_init() so that
drivers can have a driver-specific implementation if needed.

Suggested-by: Noralf Trønnes 
Signed-off-by: David Lechner 
Reviewed-by: Noralf Trønnes 
---
 drivers/gpu/drm/tinydrm/mi0283qt.c |  8 ++--
 drivers/gpu/drm/tinydrm/mipi-dbi.c | 17 +
 include/drm/tinydrm/mipi-dbi.h |  6 +-
 3 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c 
b/drivers/gpu/drm/tinydrm/mi0283qt.c
index 482ff1c3..7e5bb7d 100644
--- a/drivers/gpu/drm/tinydrm/mi0283qt.c
+++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
@@ -195,8 +195,12 @@ static int mi0283qt_probe(struct spi_device *spi)
 
device_property_read_u32(dev, "rotation", );
 
-   ret = mipi_dbi_spi_init(spi, mipi, dc, _pipe_funcs,
-   _driver, _mode, rotation);
+   ret = mipi_dbi_spi_init(spi, mipi, dc);
+   if (ret)
+   return ret;
+
+   ret = mipi_dbi_init(>dev, mipi, _pipe_funcs,
+   _driver, _mode, rotation);
if (ret)
return ret;
 
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c 
b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index e10fa4b..cba9784 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -777,15 +777,12 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, 
u8 cmd,
 /**
  * mipi_dbi_spi_init - Initialize MIPI DBI SPI interfaced controller
  * @spi: SPI device
- * @dc: D/C gpio (optional)
  * @mipi: _dbi structure to initialize
- * @pipe_funcs: Display pipe functions
- * @driver: DRM driver
- * @mode: Display mode
- * @rotation: Initial rotation in degrees Counter Clock Wise
+ * @dc: D/C gpio (optional)
  *
  * This function sets _dbi->command, enables >read_commands for the
- * usual read commands and initializes @mipi using mipi_dbi_init().
+ * usual read commands. It should be followed by a call to mipi_dbi_init() or
+ * a driver-specific init.
  *
  * If @dc is set, a Type C Option 3 interface is assumed, if not
  * Type C Option 1.
@@ -800,11 +797,7 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, 
u8 cmd,
  * Zero on success, negative error code on failure.
  */
 int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,
- struct gpio_desc *dc,
- const struct drm_simple_display_pipe_funcs *pipe_funcs,
- struct drm_driver *driver,
- const struct drm_display_mode *mode,
- unsigned int rotation)
+ struct gpio_desc *dc)
 {
size_t tx_size = tinydrm_spi_max_transfer_size(spi, 0);
struct device *dev = >dev;
@@ -850,7 +843,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct 
mipi_dbi *mipi,
return -ENOMEM;
}
 
-   return mipi_dbi_init(dev, mipi, pipe_funcs, driver, mode, rotation);
+   return 0;
 }
 EXPORT_SYMBOL(mipi_dbi_spi_init);
 
diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h
index d137b16..83346dd 100644
--- a/include/drm/tinydrm/mipi-dbi.h
+++ b/include/drm/tinydrm/mipi-dbi.h
@@ -62,11 +62,7 @@ mipi_dbi_from_tinydrm(struct tinydrm_device *tdev)
 }
 
 int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,
- struct gpio_desc *dc,
- const struct drm_simple_display_pipe_funcs *pipe_funcs,
- struct drm_driver *driver,
- const struct drm_display_mode *mode,
- unsigned int rotation);
+ struct gpio_desc *dc);
 int mipi_dbi_init(struct device *dev, struct mipi_dbi *mipi,
  const struct drm_simple_display_pipe_funcs *pipe_funcs,
  struct drm_driver *driver,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 6/6] ARM: davinci_all_defconfig: enable tinydrm and ST7586

2017-08-03 Thread David Lechner
This enables the tinydrm and ST7586 panel modules used by the display
on LEGO MINDSTORMS EV3.

Signed-off-by: David Lechner 
---
 arch/arm/configs/davinci_all_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/davinci_all_defconfig 
b/arch/arm/configs/davinci_all_defconfig
index 06e2e2a..27d9720 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -143,6 +143,8 @@ CONFIG_VIDEO_ADV7343=m
 CONFIG_DRM=m
 CONFIG_DRM_TILCDC=m
 CONFIG_DRM_DUMB_VGA_DAC=m
+CONFIG_DRM_TINYDRM=m
+CONFIG_TINYDRM_ST7586=m
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_DA8XX=y
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 3/6] dt-bindings: add binding for Sitronix ST7586 display panels

2017-08-03 Thread David Lechner
This adds a new binding for Sitronix ST7586 display panels.

Using lego as the vendor prefix in the compatible string because the display
panel I am working with is an integral part of the LEGO MINDSTORMS EV3.

Signed-off-by: David Lechner 
---
 .../bindings/display/sitronix,st7586.txt   | 26 ++
 1 file changed, 26 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/sitronix,st7586.txt

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7586.txt 
b/Documentation/devicetree/bindings/display/sitronix,st7586.txt
new file mode 100644
index 000..dfb0b7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/sitronix,st7586.txt
@@ -0,0 +1,26 @@
+Sitronix ST7586 display panel
+
+Required properties:
+- compatible:  "lego,ev3-lcd".
+
+The node for this driver must be a child node of a SPI controller, hence
+all mandatory properties described in ../spi/spi-bus.txt must be specified.
+
+Optional properties:
+- dc-gpios:D/C pin. The presence/absence of this GPIO determines
+   the panel interface operation mode (IF[3:1] pins):
+   - present: IF=011 4-wire 8-bit data serial interface
+   - absent:  IF=010 3-wire 9-bit data serial interface
+- reset-gpios: Reset pin
+- power-supply:A regulator node for the supply voltage.
+- backlight:   phandle of the backlight device attached to the panel
+- rotation:panel rotation in degrees counter clockwise (0,90,180,270)
+
+Example:
+   display@0{
+   compatible = "lego,ev3-lcd";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
+   reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
+   };
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 5/6] ARM: dts: da850-lego-ev3: Add node for LCD display

2017-08-03 Thread David Lechner
This adds a new node for the LEGO MINDSTORMS EV3 LCD display.

Signed-off-by: David Lechner 
---
 arch/arm/boot/dts/da850-lego-ev3.dts | 24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/da850-lego-ev3.dts 
b/arch/arm/boot/dts/da850-lego-ev3.dts
index 45983c0..249b317 100644
--- a/arch/arm/boot/dts/da850-lego-ev3.dts
+++ b/arch/arm/boot/dts/da850-lego-ev3.dts
@@ -249,6 +249,15 @@
0x4c 0x0080 0x00f0
>;
};
+
+   ev3_lcd_pins: pinmux_lcd {
+   pinctrl-single,bits = <
+   /* SIMO, GP2[11], GP2[12], CLK */
+   0x14 0x00188100 0x0000
+   /* GP5[0] */
+   0x30 0x8000 0xf000
+   >;
+   };
 };
 
  {
@@ -357,6 +366,21 @@
};
 };
 
+ {
+   status = "okay";
+   pinctrl-0 = <_lcd_pins>;
+   pinctrl-names = "default";
+   cs-gpios = < 44 GPIO_ACTIVE_LOW>;
+
+   display@0{
+   compatible = "lego,ev3-lcd";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
+   reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
+   };
+};
+
  {
status = "okay";
 };
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 2/6] drm/tinydrm: generalize tinydrm_xrgb8888_to_gray8()

2017-08-03 Thread David Lechner
This adds parameters for vaddr and clip to tinydrm_xrgb_to_gray8() to
make it more generic.

dma_buf_{begin,end}_cpu_access() are moved out to the repaper driver.

Signed-off-by: David Lechner 
---
 drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | 35 ++
 drivers/gpu/drm/tinydrm/repaper.c  | 21 +++-
 include/drm/tinydrm/tinydrm-helpers.h  |  3 ++-
 3 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c 
b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
index 75808bb..5915ba8 100644
--- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
+++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
@@ -185,7 +185,9 @@ EXPORT_SYMBOL(tinydrm_xrgb_to_rgb565);
 /**
  * tinydrm_xrgb_to_gray8 - Convert XRGB to grayscale
  * @dst: 8-bit grayscale destination buffer
+ * @vaddr: XRGB source buffer
  * @fb: DRM framebuffer
+ * @clip: Clip rectangle area to copy
  *
  * Drm doesn't have native monochrome or grayscale support.
  * Such drivers can announce the commonly supported XR24 format to userspace
@@ -199,12 +201,11 @@ EXPORT_SYMBOL(tinydrm_xrgb_to_rgb565);
  * Returns:
  * Zero on success, negative error code on failure.
  */
-int tinydrm_xrgb_to_gray8(u8 *dst, struct drm_framebuffer *fb)
+int tinydrm_xrgb_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb,
+ struct drm_clip_rect *clip)
 {
-   struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
-   struct dma_buf_attachment *import_attach = cma_obj->base.import_attach;
-   unsigned int x, y, pitch = fb->pitches[0];
-   int ret = 0;
+   unsigned int len = (clip->x2 - clip->x1) * sizeof(u32);
+   unsigned int x, y;
void *buf;
u32 *src;
 
@@ -214,22 +215,16 @@ int tinydrm_xrgb_to_gray8(u8 *dst, struct 
drm_framebuffer *fb)
 * The cma memory is write-combined so reads are uncached.
 * Speed up by fetching one line at a time.
 */
-   buf = kmalloc(pitch, GFP_KERNEL);
+   buf = kmalloc(len, GFP_KERNEL);
if (!buf)
return -ENOMEM;
 
-   if (import_attach) {
-   ret = dma_buf_begin_cpu_access(import_attach->dmabuf,
-  DMA_FROM_DEVICE);
-   if (ret)
-   goto err_free;
-   }
-
-   for (y = 0; y < fb->height; y++) {
-   src = cma_obj->vaddr + (y * pitch);
-   memcpy(buf, src, pitch);
+   for (y = clip->y1; y < clip->y2; y++) {
+   src = vaddr + (y * fb->pitches[0]);
+   src += clip->x1;
+   memcpy(buf, src, len);
src = buf;
-   for (x = 0; x < fb->width; x++) {
+   for (x = clip->x1; x < clip->x2; x++) {
u8 r = (*src & 0x00ff) >> 16;
u8 g = (*src & 0xff00) >> 8;
u8 b =  *src & 0x00ff;
@@ -240,13 +235,9 @@ int tinydrm_xrgb_to_gray8(u8 *dst, struct 
drm_framebuffer *fb)
}
}
 
-   if (import_attach)
-   ret = dma_buf_end_cpu_access(import_attach->dmabuf,
-DMA_FROM_DEVICE);
-err_free:
kfree(buf);
 
-   return ret;
+   return 0;
 }
 EXPORT_SYMBOL(tinydrm_xrgb_to_gray8);
 
diff --git a/drivers/gpu/drm/tinydrm/repaper.c 
b/drivers/gpu/drm/tinydrm/repaper.c
index 3343d3f..d34cd9b 100644
--- a/drivers/gpu/drm/tinydrm/repaper.c
+++ b/drivers/gpu/drm/tinydrm/repaper.c
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -525,11 +526,20 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb,
struct drm_clip_rect *clips,
unsigned int num_clips)
 {
+   struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+   struct dma_buf_attachment *import_attach = cma_obj->base.import_attach;
struct tinydrm_device *tdev = fb->dev->dev_private;
struct repaper_epd *epd = epd_from_tinydrm(tdev);
+   struct drm_clip_rect clip;
u8 *buf = NULL;
int ret = 0;
 
+   /* repaper can't do partial updates */
+   clip.x1 = 0;
+   clip.x2 = fb->width;
+   clip.y1 = 0;
+   clip.y2 = fb->height;
+
mutex_lock(>dirty_lock);
 
if (!epd->enabled)
@@ -550,7 +560,16 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb,
goto out_unlock;
}
 
-   ret = tinydrm_xrgb_to_gray8(buf, fb);
+   if (import_attach) {
+   ret = dma_buf_begin_cpu_access(import_attach->dmabuf,
+  DMA_FROM_DEVICE);
+   if (ret)
+   goto out_unlock;
+   }
+
+   ret = tinydrm_xrgb_to_gray8(buf, cma_obj->vaddr, fb, );
+   if (import_attach)
+

[Bug 60879] [radeonsi] Tahiti LE: GFX block is not functional, CP is okay

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=60879

--- Comment #168 from MAD  ---
Created attachment 133233
  --> https://bugs.freedesktop.org/attachment.cgi?id=133233=edit
dmesg radeon kernel 4.10

-- 
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 60879] [radeonsi] Tahiti LE: GFX block is not functional, CP is okay

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=60879

--- Comment #167 from MAD  ---
Created attachment 133232
  --> https://bugs.freedesktop.org/attachment.cgi?id=133232=edit
Xorg.log amdgpu kernel 4.10

-- 
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 60879] [radeonsi] Tahiti LE: GFX block is not functional, CP is okay

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=60879

--- Comment #166 from MAD  ---
Created attachment 133231
  --> https://bugs.freedesktop.org/attachment.cgi?id=133231=edit
dmesg amdgpu kernel 4.10

-- 
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 60879] [radeonsi] Tahiti LE: GFX block is not functional, CP is okay

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=60879

--- Comment #165 from MAD  ---
4.10.0-28-generic
[AMD/ATI] Tahiti LE [Radeon HD 7870 XT]

I have the same problem with this card. 

On amdgpu I got black screen. But monitor remains on. I can log in via ssh and
all.

On radeon first I get screen full of colourful pixels, then black screen, then
monitor says no-signal and goes stand-by. And then pc hangs and I can no longer
log in via ssh.

On radeon there are a lot of 
radeon :01:00.0: ring 3 stalled for more than 10036msec
kinda logs in dmesg. But on amdgpu there is nothing interesting really. It
seems like it almost works, except for the black screen ;)

I think I'm gonna try fresh kernel from padoka ppa next. When I have some free
time.

-- 
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

2017-08-03 Thread Noralf Trønnes


Den 03.08.2017 19.11, skrev Andy Shevchenko:

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



That pdf refers to another one: 
http://wiki.seeed.cc/Grove-OLED_Display_0.96inch/

There's an fbdev driver that supports ssd1305, ssd1306, ssd1307 and ssd1309:
https://www.kernel.org/doc/Documentation/devicetree/bindings/display/ssd1307fb.txt
http://elixir.free-electrons.com/linux/latest/source/drivers/video/fbdev/ssd1307fb.c
Maybe the ssd1308 will work with that driver...

Noralf.

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 99553] Tracker bug for runnning OpenCL applications on Clover

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99553

Jan Vesely  changed:

   What|Removed |Added

 Depends on||102030


Referenced Bugs:

https://bugs.freedesktop.org/show_bug.cgi?id=102030
[Bug 102030] private memory overflow in openCL
-- 
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 1/2] drm/bridge: add Silicon Image SiI9234 driver

2017-08-03 Thread kbuild test robot
Hi Maciej,

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.13-rc3 next-20170803]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Maciej-Purski/add-Silicon-Image-SiI9234-driver/20170803-200255
base:   git://people.freedesktop.org/~airlied/linux.git drm-next


coccinelle warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/bridge/sii9234.c:1010:3-8: No need to set .owner here. The 
>> core will do it.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/bridge: fix platform_no_drv_owner.cocci warnings

2017-08-03 Thread kbuild test robot
drivers/gpu/drm/bridge/sii9234.c:1010:3-8: No need to set .owner here. The core 
will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Fixes: 9d5babbeda8a ("drm/bridge: add Silicon Image SiI9234 driver")
CC: Maciej Purski 
Signed-off-by: Fengguang Wu 
---

 sii9234.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/gpu/drm/bridge/sii9234.c
+++ b/drivers/gpu/drm/bridge/sii9234.c
@@ -1007,7 +1007,6 @@ MODULE_DEVICE_TABLE(i2c, sii9234_id);
 static struct i2c_driver sii9234_driver = {
.driver = {
.name   = "sii9234",
-   .owner  = THIS_MODULE,
.of_match_table = of_match_ptr(sii9234_dt_match),
},
.probe  = sii9234_mhl_tx_i2c_probe,
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: hdlcd: allow HDLCD to be used without interrupt

2017-08-03 Thread Rob Herring
On Wed, Jul 26, 2017 at 11:05:39AM +0100, Russell King wrote:
> Some ARM platforms do not wire the HDLCD interrupt.  Allow hdlcd to
> initialise without an interrupt present.
> 
> Signed-off-by: Russell King 
> ---
>  Documentation/devicetree/bindings/display/arm,hdlcd.txt |  6 +++---

Acked-by: Rob Herring 

>  drivers/gpu/drm/arm/hdlcd_drv.c | 13 -
>  2 files changed, 11 insertions(+), 8 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] i915: Add support for drm syncobjs

2017-08-03 Thread Jason Ekstrand
On Thu, Aug 3, 2017 at 11:15 AM, Chris Wilson 
wrote:

> Quoting Jason Ekstrand (2017-08-03 19:06:02)
> > I'm not concerned about what happens to racy clients.  They get what
> they get.
> > What concerns me is what happens if somehow the fence is replaced and
> deleted
> > before i915_gem_request_await_dma_fence takes it's reference.  Can this
> cause
> > the kernel to segfault?
>
> Gotcha, yup nothing prevents that.
>
> fence = dma_fence_get_rcu_safe(>fence);
> if (!fence)
> return -EINVAL;
>
> err = await_fence();
> dma_fence_put(fence);
> if (err < 0)
> return;
>
> Happy?
>

Assuming dma_fence_get_rcu_safe does what I think it does, then yes.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 102031] xf86drm.c should use readdir() instead of readdir_r()

2017-08-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=102031

Bug ID: 102031
   Summary: xf86drm.c should use readdir() instead of readdir_r()
   Product: DRI
   Version: XOrg git
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: libdrm
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: thomasander...@google.com

readdir_r() has been deprecated in glibc-2.24, so trying to compile libdrm
against those headers will give a deprecation warning.

-- 
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] i915: Add support for drm syncobjs

2017-08-03 Thread Chris Wilson
Quoting Jason Ekstrand (2017-08-03 19:06:02)
> I'm not concerned about what happens to racy clients.  They get what they 
> get. 
> What concerns me is what happens if somehow the fence is replaced and deleted
> before i915_gem_request_await_dma_fence takes it's reference.  Can this cause
> the kernel to segfault?

Gotcha, yup nothing prevents that.

fence = dma_fence_get_rcu_safe(>fence);
if (!fence)
return -EINVAL;

err = await_fence();
dma_fence_put(fence);
if (err < 0)
return;

Happy?
-Chris
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] i915: Add support for drm syncobjs

2017-08-03 Thread Jason Ekstrand
On Thu, Aug 3, 2017 at 10:00 AM, Chris Wilson 
wrote:

> 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.
>

Sorry, not familiar with the kernel...

Signed-off-by: Jason Ekstrand 


> > +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], , 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 >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.
>

I'm not concerned about what happens to racy clients.  They get what they
get.  What concerns me is what happens if somehow the fence is replaced and
deleted before i915_gem_request_await_dma_fence takes it's reference.  Can
this cause the kernel to segfault?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 3/4] drm: rcar-du: Fix race condition when disabling planes at CRTC stop

2017-08-03 Thread Kieran Bingham
Hi Laurent,

On 29/07/17 22:08, Laurent Pinchart wrote:
> When stopping the CRTC the driver must disable all planes and wait for
> the change to take effect at the next vblank. Merely calling
> drm_crtc_wait_one_vblank() is not enough, as the function doesn't
> include any mechanism to handle the race with vblank interrupts.
> 
> Replace the drm_crtc_wait_one_vblank() call with a manual mechanism that
> handles the vblank interrupt race.

This looks like a nasty hidden race
 (though I understand I unintentionally helped make it more prominent  :D )

Fix looks good to me.

> Signed-off-by: Laurent Pinchart 

Reviewed-by: Kieran Bingham 

> ---
>  drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 58 
> ++
>  drivers/gpu/drm/rcar-du/rcar_du_crtc.h |  8 +
>  2 files changed, 60 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c 
> b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> index 17fd1cd5212c..6e5bd0b92dfa 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> @@ -490,23 +490,51 @@ static void rcar_du_crtc_start(struct rcar_du_crtc 
> *rcrtc)
>   rcar_du_group_start_stop(rcrtc->group, true);
>  }
>  
> +static void rcar_du_crtc_disable_planes(struct rcar_du_crtc *rcrtc)
> +{
> + struct rcar_du_device *rcdu = rcrtc->group->dev;
> + struct drm_crtc *crtc = >crtc;
> + u32 status;
> +
> + /* Make sure vblank interrupts are enabled. */
> + drm_crtc_vblank_get(crtc);
> +
> + /*
> +  * Disable planes and calculate how many vertical blanking interrupts we
> +  * have to wait for. If a vertical blanking interrupt has been triggered
> +  * but not processed yet, we don't know whether it occurred before or
> +  * after the planes got disabled. We thus have to wait for two vblank
> +  * interrupts in that case.
> +  */
> + spin_lock_irq(>vblank_lock);
> + rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? DS2PR : DS1PR, 0);
> + status = rcar_du_crtc_read(rcrtc, DSSR);
> + rcrtc->vblank_count = status & DSSR_VBK ? 2 : 1;
> + spin_unlock_irq(>vblank_lock);
> +
> + if (!wait_event_timeout(rcrtc->vblank_wait, rcrtc->vblank_count == 0,
> + msecs_to_jiffies(100)))
> + dev_warn(rcdu->dev, "vertical blanking timeout\n");
> +
> + drm_crtc_vblank_put(crtc);
> +}
> +
>  static void rcar_du_crtc_stop(struct rcar_du_crtc *rcrtc)
>  {
>   struct drm_crtc *crtc = >crtc;
>  
>   /*
>* Disable all planes and wait for the change to take effect. This is
> -  * required as the DSnPR registers are updated on vblank, and no vblank
> -  * will occur once the CRTC is stopped. Disabling planes when starting
> -  * the CRTC thus wouldn't be enough as it would start scanning out
> -  * immediately from old frame buffers until the next vblank.
> +  * required as the plane enable registers are updated on vblank, and no
> +  * vblank will occur once the CRTC is stopped. Disabling planes when
> +  * starting the CRTC thus wouldn't be enough as it would start scanning
> +  * out immediately from old frame buffers until the next vblank.
>*
>* This increases the CRTC stop delay, especially when multiple CRTCs
>* are stopped in one operation as we now wait for one vblank per CRTC.
>* Whether this can be improved needs to be researched.
>*/
> - rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? DS2PR : DS1PR, 0);
> - drm_crtc_wait_one_vblank(crtc);
> + rcar_du_crtc_disable_planes(rcrtc);
>  
>   /*
>* Disable vertical blanking interrupt reporting. We first need to wait
> @@ -695,10 +723,26 @@ static irqreturn_t rcar_du_crtc_irq(int irq, void *arg)
>   irqreturn_t ret = IRQ_NONE;
>   u32 status;
>  
> + spin_lock(>vblank_lock);
> +
>   status = rcar_du_crtc_read(rcrtc, DSSR);
>   rcar_du_crtc_write(rcrtc, DSRCR, status & DSRCR_MASK);
>  
>   if (status & DSSR_VBK) {
> + /*
> +  * Wake up the vblank wait if the counter reaches 0. This must
> +  * be protected by the vblank_lock to avoid races in
> +  * rcar_du_crtc_disable_planes().
> +  */
> + if (rcrtc->vblank_count) {
> + if (--rcrtc->vblank_count == 0)
> + wake_up(>vblank_wait);
> + }
> + }
> +
> + spin_unlock(>vblank_lock);
> +
> + if (status & DSSR_VBK) {
>   drm_crtc_handle_vblank(>crtc);
>  
>   if (rcdu->info->gen < 3)
> @@ -756,6 +800,8 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, 
> unsigned int index)
>   }
>  
>   init_waitqueue_head(>flip_wait);
> + init_waitqueue_head(>vblank_wait);
> + spin_lock_init(>vblank_lock);
>  
>   rcrtc->group = rgrp;
>   

Re: [PATCH 12/29] drm/i915: switch to drm_*{get,put} helpers

2017-08-03 Thread Cihangir Akturk
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! :)

Indeed I used a simple shell script, which I included in the cover
letter. But the cover letter doesn't seem to show up in the mailing
list archives for some reason. I think I have done something wrong.

The script I use is like:
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

I had used the coccinelle in report mode for staging tree. It reported
about staging: vboxvideo driver. In this way I saw there is a need to
change to the new APIs.

I used my own script because I haven't used coccinelle in patch mode
before.

> 
> 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(>base);
> > +   drm_gem_object_get(>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(>base);
> > +   __drm_gem_object_put(>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 @@ 

[PATCH 22/29] drm/tegra: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 drivers/gpu/drm/tegra/drm.c | 12 ++--
 drivers/gpu/drm/tegra/fb.c  |  8 
 drivers/gpu/drm/tegra/gem.c | 10 +-
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 518f4b6..eddea77 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -304,7 +304,7 @@ host1x_bo_lookup(struct drm_file *file, u32 handle)
if (!gem)
return NULL;
 
-   drm_gem_object_unreference_unlocked(gem);
+   drm_gem_object_put_unlocked(gem);
 
bo = to_tegra_bo(gem);
return >base;
@@ -591,7 +591,7 @@ static int tegra_gem_mmap(struct drm_device *drm, void 
*data,
 
args->offset = drm_vma_node_offset_addr(>gem.vma_node);
 
-   drm_gem_object_unreference_unlocked(gem);
+   drm_gem_object_put_unlocked(gem);
 
return 0;
 }
@@ -858,7 +858,7 @@ static int tegra_gem_set_tiling(struct drm_device *drm, 
void *data,
bo->tiling.mode = mode;
bo->tiling.value = value;
 
-   drm_gem_object_unreference_unlocked(gem);
+   drm_gem_object_put_unlocked(gem);
 
return 0;
 }
@@ -898,7 +898,7 @@ static int tegra_gem_get_tiling(struct drm_device *drm, 
void *data,
break;
}
 
-   drm_gem_object_unreference_unlocked(gem);
+   drm_gem_object_put_unlocked(gem);
 
return err;
 }
@@ -923,7 +923,7 @@ static int tegra_gem_set_flags(struct drm_device *drm, void 
*data,
if (args->flags & DRM_TEGRA_GEM_BOTTOM_UP)
bo->flags |= TEGRA_BO_BOTTOM_UP;
 
-   drm_gem_object_unreference_unlocked(gem);
+   drm_gem_object_put_unlocked(gem);
 
return 0;
 }
@@ -945,7 +945,7 @@ static int tegra_gem_get_flags(struct drm_device *drm, void 
*data,
if (bo->flags & TEGRA_BO_BOTTOM_UP)
args->flags |= DRM_TEGRA_GEM_BOTTOM_UP;
 
-   drm_gem_object_unreference_unlocked(gem);
+   drm_gem_object_put_unlocked(gem);
 
return 0;
 }
diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
index 25acb73..80540c1 100644
--- a/drivers/gpu/drm/tegra/fb.c
+++ b/drivers/gpu/drm/tegra/fb.c
@@ -88,7 +88,7 @@ static void tegra_fb_destroy(struct drm_framebuffer 
*framebuffer)
if (bo->pages)
vunmap(bo->vaddr);
 
-   drm_gem_object_unreference_unlocked(>gem);
+   drm_gem_object_put_unlocked(>gem);
}
}
 
@@ -195,7 +195,7 @@ struct drm_framebuffer *tegra_fb_create(struct drm_device 
*drm,
 
 unreference:
while (i--)
-   drm_gem_object_unreference_unlocked([i]->gem);
+   drm_gem_object_put_unlocked([i]->gem);
 
return ERR_PTR(err);
 }
@@ -242,7 +242,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper,
info = drm_fb_helper_alloc_fbi(helper);
if (IS_ERR(info)) {
dev_err(drm->dev, "failed to allocate framebuffer info\n");
-   drm_gem_object_unreference_unlocked(>gem);
+   drm_gem_object_put_unlocked(>gem);
return PTR_ERR(info);
}
 
@@ -251,7 +251,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper,
err = PTR_ERR(fbdev->fb);
dev_err(drm->dev, "failed to allocate DRM framebuffer: %d\n",
err);
-   drm_gem_object_unreference_unlocked(>gem);
+   drm_gem_object_put_unlocked(>gem);
return PTR_ERR(fbdev->fb);
}
 
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 7a39a35..fe77bcd 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -24,7 +24,7 @@ static void tegra_bo_put(struct host1x_bo *bo)
 {
struct tegra_bo *obj = host1x_to_tegra_bo(bo);
 
-   drm_gem_object_unreference_unlocked(>gem);
+   drm_gem_object_put_unlocked(>gem);
 }
 
 static dma_addr_t tegra_bo_pin(struct host1x_bo *bo, struct sg_table **sgt)
@@ -95,7 +95,7 @@ static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo)
 {
struct tegra_bo *obj = host1x_to_tegra_bo(bo);
 
-   drm_gem_object_reference(>gem);
+   drm_gem_object_get(>gem);
 
return bo;
 }
@@ -325,7 +325,7 @@ struct tegra_bo *tegra_bo_create_with_handle(struct 
drm_file *file,
return ERR_PTR(err);
}
 
-   drm_gem_object_unreference_unlocked(>gem);
+   drm_gem_object_put_unlocked(>gem);
 
return bo;
 }
@@ -439,7 +439,7 @@ int tegra_bo_dumb_map_offset(struct drm_file *file, struct 
drm_device *drm,
 
*offset = drm_vma_node_offset_addr(>gem.vma_node);
 
-   

[PATCH 16/29] drm/msm: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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 = _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);
+ 

[PATCH 01/29] drm/amdgpu: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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(>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(>table_lock);
idr_for_each_entry(>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(>object_idr);
spin_unlock(>table_lock);
@@ -275,7 +275,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void 
*data,
 
r = drm_gem_handle_create(filp, gobj, );
/* drop reference from allocate - handle 

[PATCH 06/29] drm/bochs: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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(>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, );
-   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 15/29] drm/mgag200: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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(>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(>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, );
-   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

2017-08-03 Thread 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 
---
 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(_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(_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 12/29] drm/i915: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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(>base);
+   drm_gem_object_get(>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(>base);
+   __drm_gem_object_put(>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 = _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(_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(>unpin_work_count) == 0);
atomic_dec(>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);
-   

[PATCH 27/29] drm/virtio: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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 = >gem_base;
 
/* drop reference from allocate - handle holds it now */
-   drm_gem_object_unreference_unlocked(>gem_base);
+   drm_gem_object_put_unlocked(>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(>gem_base);
+   drm_gem_object_put_unlocked(>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(>gem_base);
+   drm_gem_object_get(>gem_base);
mainbuf.bo = >tbo;
list_add(, _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 25/29] drm/vc4: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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, >base.base, >handle);
-   drm_gem_object_unreference_unlocked(>base.base);
+   drm_gem_object_put_unlocked(>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, >base.base, >handle);
-   drm_gem_object_unreference_unlocked(>base.base);
+   drm_gem_object_put_unlocked(>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(_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, >base.base, >handle);
 
  fail:
-   drm_gem_object_unreference_unlocked(>base.base);
+   drm_gem_object_put_unlocked(>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(>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(>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([i]->bo[j]->base);
+   drm_gem_object_get([i]->bo[j]->base);
kernel_state->bo[j + prev_idx] = [i]->bo[j]->base;
}
 
list_for_each_entry(bo, [i]->unref_list, unref_head) {
-   drm_gem_object_reference(>base.base);
+   drm_gem_object_get(>base.base);
kernel_state->bo[j + prev_idx] = >base.base;
j++;
}
@@ -697,7 +697,7 @@ vc4_cl_lookup_bos(struct drm_device *dev,
spin_unlock(_priv->table_lock);
goto fail;
}
-   

[PATCH 11/29] drm/hisilicon: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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);
 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(>fb);
+   drm_framebuffer_put(>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, );
-   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 _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

2017-08-03 Thread 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 
---
 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(>gem_base);
+   drm_gem_object_put_unlocked(>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(>old_rbo->gem_base);
+   drm_gem_object_put_unlocked(>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(>old_rbo->gem_base);
+   drm_gem_object_put_unlocked(>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 

Re: [PATCH v3 2/4] drm: rcar-du: Wait for flip completion instead of vblank in commit tail

2017-08-03 Thread Kieran Bingham
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 02/29] drm: mali-dp: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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


[PATCH 04/29] drm/ast: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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(>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(>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, );
-   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(>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 17/29] drm/nouveau: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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, >ntfy_vma);
nouveau_bo_unpin(chan->ntfy);
-   drm_gem_object_unreference_unlocked(>ntfy->gem);
+   drm_gem_object_put_unlocked(>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(>nvbo->gem);
+   drm_gem_object_put_unlocked(>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 >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, >gem, >handle);
-   drm_gem_object_unreference_unlocked(>gem);
+   drm_gem_object_put_unlocked(>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.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, _fb->vma);
nouveau_bo_unmap(nouveau_fb->nvbo);
nouveau_bo_unpin(nouveau_fb->nvbo);
-   drm_framebuffer_unreference(_fb->base);
+   drm_framebuffer_put(_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(>gem);
+   drm_gem_object_put_unlocked(>gem);
return ret;
 }
 
@@ -350,7 +350,7 @@ validate_fini_no_ticket(struct validate_op *op, struct 
nouveau_fence *fence,
list_del(>entry);
nvbo->reserved_by = NULL;
ttm_bo_unreserve_ticket(>bo, >ticket);
-   drm_gem_object_unreference_unlocked(>gem);
+   drm_gem_object_put_unlocked(>gem);
}
 }
 
@@ -396,14 +396,14 @@ validate_init(struct nouveau_channel *chan, struct 
drm_file *file_priv,
nvbo = nouveau_gem_object(gem);
if (nvbo == res_bo) {
res_bo = 

[PATCH 14/29] drm/mediatek: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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 _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(_gem->base);
+   drm_gem_object_put_unlocked(_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

2017-08-03 Thread 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 
---
 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(>obj->base);
+   drm_gem_object_put_unlocked(>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(>ufb.obj->base);
+   drm_gem_object_put_unlocked(>ufb.obj->base);
 out:
return ret;
 }
@@ -420,7 +420,7 @@ static void udl_fbdev_destroy(struct drm_device *dev,
drm_fb_helper_fini(>helper);
drm_framebuffer_unregister_private(>ufb.base);
drm_framebuffer_cleanup(>ufb.base);
-   drm_gem_object_unreference_unlocked(>ufb.obj->base);
+   drm_gem_object_put_unlocked(>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(>base);
+   drm_gem_object_put_unlocked(>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(>base.vma_node);
 
 out:
-   drm_gem_object_unreference(>base);
+   drm_gem_object_put(>base);
 unlock:
mutex_unlock(>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 13/29] drm/imx: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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 10/29] drm/gma500: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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(>base);
 
if (psbfb->gtt)
-   drm_gem_object_unreference_unlocked(>gtt->gem);
+   drm_gem_object_put_unlocked(>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(>gem);
+   drm_gem_object_put_unlocked(>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(>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(>gem);
+   drm_gem_object_put_unlocked(>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 07/29] drm/cirrus: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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(>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, );
-   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 19/29] drm/qxl: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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, _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(>gem_base);
+   drm_gem_object_get(>gem_base);
return bo;
 }
 
@@ -316,7 +316,7 @@ void qxl_bo_force_delete(struct qxl_device *qdev)
list_del_init(>list);
mutex_unlock(>gem.mutex);
/* this should unref the ttm bo */
-   drm_gem_object_unreference_unlocked(>gem_base);
+  

Re: [PATCH 17/29] drm/nouveau: switch to drm_*{get,put} helpers

2017-08-03 Thread Tobias Klausmann
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, >ntfy_vma);
>   nouveau_bo_unpin(chan->ntfy);
> - drm_gem_object_unreference_unlocked(>ntfy->gem);
> + drm_gem_object_put_unlocked(>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(>nvbo->gem);
> + drm_gem_object_put_unlocked(>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 >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, >gem, >handle);
> - drm_gem_object_unreference_unlocked(>gem);
> + drm_gem_object_put_unlocked(>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.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, _fb->vma);
>   nouveau_bo_unmap(nouveau_fb->nvbo);
>   nouveau_bo_unpin(nouveau_fb->nvbo);
> - drm_framebuffer_unreference(_fb->base);
> + drm_framebuffer_put(_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(>gem);
> + drm_gem_object_put_unlocked(>gem);
>   return ret;
>  }
>  
> @@ -350,7 +350,7 @@ validate_fini_no_ticket(struct validate_op *op, struct 
> nouveau_fence *fence,
>   list_del(>entry);
>   nvbo->reserved_by = NULL;
>   ttm_bo_unreserve_ticket(>bo, >ticket);
> - drm_gem_object_unreference_unlocked(>gem);
> + 

[PATCH 18/29] drm/omap: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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 = _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 00/29] DRM API conversions

2017-08-03 Thread Cihangir Akturk
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 

[PATCH 09/29] drm/exynos: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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 = _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(_gem[i]->base);
+   drm_gem_object_put_unlocked(_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(>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


Re: [PATCH 12/29] drm/i915: switch to drm_*{get,put} helpers

2017-08-03 Thread Cihangir Akturk
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 03/29] drm/armada: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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);
+   drm_gem_object_put_unlocked(>obj);
return -EINVAL;
}
 
if (obj->obj.size < w * h * 4) {
DRM_ERROR("buffer is too small\n");
-   drm_gem_object_unreference_unlocked(>obj);
+   drm_gem_object_put_unlocked(>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(>cursor_obj->obj);
+   drm_gem_object_put_unlocked(>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(>cursor_obj->obj);
+   drm_gem_object_put_unlocked(>cursor_obj->obj);
 
priv->dcrtc[dcrtc->num] = NULL;
drm_crtc_cleanup(>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;
 
while (kfifo_get(>fb_unref, 

[PATCH 23/29] drm/tilcdc: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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(>mode_config.mutex);
-   drm_framebuffer_unreference(val);
+   drm_framebuffer_put(val);
mutex_unlock(>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 26/29] drm/vgem: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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, >base, handle);
-   drm_gem_object_unreference_unlocked(>base);
+   drm_gem_object_put_unlocked(>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(>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 08/29] drm/etnaviv: switch to drm_*{get,put} helpers

2017-08-03 Thread 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 
---
 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, (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, >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(_obj->base);
+   drm_gem_object_get(_obj->base);
 
mutex_lock(_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(_obj->lock);
 
-   drm_gem_object_unreference_unlocked(_obj->base);
+   drm_gem_object_put_unlocked(_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(_obj->lock);
-   drm_gem_object_unreference_unlocked(_obj->base);
+   drm_gem_object_put_unlocked(_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(_obj->base);
+   drm_gem_object_get(_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, _obj->base, handle);
 unreference:
/* drop reference from allocate - handle holds it now */
-   

Re: [PATCHv5 3/3] ARM:drm ivip Intel FPGA Video and Image Processing Suite

2017-08-03 Thread Randy Dunlap
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

2017-08-03 Thread 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 
---
 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

2017-08-03 Thread 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 
---
 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(>fb_unref_work, old_plane_state->fb);
set_bit(VOP_PENDING_FB_UNREF, >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(>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


Re: [PATCH 3/4] drm: Only lastclose on unload for legacy drivers

2017-08-03 Thread Alex Deucher
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: [PATCH 23/29] drm/tilcdc: switch to drm_*{get,put} helpers

2017-08-03 Thread Jyri Sarha

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 6/6] [v4] drm/i915: Add support for CCS modifiers

2017-08-03 Thread Ben Widawsky

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: [Intel-gfx] [PATCH 6/6] drm/i915: Add support for CCS modifiers

2017-08-03 Thread Ben Widawsky

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 0/6] Support for LEGO MINDSTORMS EV3 LCD display

2017-08-03 Thread Andy Shevchenko
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: [PATCH 0/6] Support for LEGO MINDSTORMS EV3 LCD display

2017-08-03 Thread Andy Shevchenko
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] i915: Add support for drm syncobjs

2017-08-03 Thread Chris Wilson
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], , 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 >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 20/29] drm/radeon: switch to drm_*{get,put} helpers

2017-08-03 Thread Alex Deucher
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(>gem_base);
>> +   drm_gem_object_put_unlocked(>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(>old_rbo->gem_base);
>> +   drm_gem_object_put_unlocked(>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(>old_rbo->gem_base);
>> +   drm_gem_object_put_unlocked(>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);
>> }
>> 

Re: [PATCH 3/5] drm/syncobj: add sync_file interaction.

2017-08-03 Thread Chris Wilson
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


[PATCH v3 1/2] drm/fb-helper: add new drm_setup_crtcs_fb() function

2017-08-03 Thread David Lechner
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(_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


[PATCH v3 2/2] drm/fb-helper: pass physical dimensions to fbdev

2017-08-03 Thread David Lechner
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 0/2] drm/fb-helper: pass physical dimensions to fbdev

2017-08-03 Thread David Lechner
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


Re: Monochrome/greyscale and software dithering in the kernel

2017-08-03 Thread Noralf Trønnes


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


Re: Monochrome/greyscale and software dithering in the kernel

2017-08-03 Thread 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, 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

2017-08-03 Thread Daniel Vetter
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(>mode_config.mutex);
>> - drm_framebuffer_unreference(val);
>> + drm_framebuffer_put(val);
>>   mutex_unlock(>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

2017-08-03 Thread David Lechner

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 0/6] Support for LEGO MINDSTORMS EV3 LCD display

2017-08-03 Thread David Lechner

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


Monochrome/greyscale and software dithering in the kernel

2017-08-03 Thread Noralf Trønnes

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] drm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs.

2017-08-03 Thread Boris Brezillon
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


Re: [PATCH 05/29] drm/atmel-hlcdc: switch to drm_*{get,put} helpers

2017-08-03 Thread Boris Brezillon
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 v13 5/7] vfio: ABI for mdev display dma-buf operation

2017-08-03 Thread Alex Williamson
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

Re: [PATCH 01/29] drm/amdgpu: switch to drm_*{get,put} helpers

2017-08-03 Thread Christian König

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(>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(>table_lock);
idr_for_each_entry(>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(>object_idr);
spin_unlock(>table_lock);
@@ -275,7 +275,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void 
*data,
  
  	r = 

Re: [PATCH 0/6] Support for LEGO MINDSTORMS EV3 LCD display

2017-08-03 Thread Noralf Trønnes


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


[PATCH] drm/vc4: Advertise supported modifiers for planes

2017-08-03 Thread Daniel Stone
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,
   _plane_funcs,
   formats, num_formats,
-  NULL, type, NULL);
+  modifiers, type, NULL);
 
drm_plane_helper_add(plane, _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 02/29] drm: mali-dp: switch to drm_*{get,put} helpers

2017-08-03 Thread Liviu Dudau
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


  1   2   >