Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH v10 4/6] devicetree: Add new SKY81452 backlight binding
From: gyungoh @ 2015-01-23  6:28 UTC (permalink / raw)
  To: sameo, lee.jones, grant.likely, robh+dt, jg1.han, cooloney,
	pawel.moll, mark.rutland, ijc+devicetree, galak, trivial
  Cc: akpm, jic23, thomas.petazzoni, ktsai, hs, stwiss.opensource,
	matti.vaittinen, broonie, jason, heiko, shawn.guo,
	florian.vaussard, andrew, antonynpavlov, hytszk, plagnioj,
	tomi.valkeinen, jack.yoo, linux-fbdev, linux-kernel, devicetree
In-Reply-To: <1421994515-3070-1-git-send-email-jack.yoo@skyworksinc.com>

From: Gyungoh Yoo <jack.yoo@skyworksinc.com>

Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
Acked-by: Bryan Wu <cooloney@gmail.com>
---
Changes v10:
Nothing

Changes v9:
Nothing

Changes v8:
Renamed property names for backlight with vendor prefix
Modified gpio-enable property to generic property for GPIO
Made up the example for backlight DT

Changes v7:
Nothing

Changes v6:
Nothing

Changes v5:
Nothing

Changes v4:
Nothing

Changes v3:
Nothing

Changes v2:
Added reg attribute for I2C slave address

 .../video/backlight/sky81452-backlight.txt         | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt

diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
new file mode 100644
index 0000000..8daebf5
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
@@ -0,0 +1,29 @@
+SKY81452-backlight bindings
+
+Required properties:
+- compatible		: Must be "skyworks,sky81452-backlight"
+
+Optional properties:
+- name			: Name of backlight device. Default is 'lcd-backlight'.
+- gpios			: GPIO to use to EN pin.
+			See Documentation/devicetree/bindings/gpio/gpio.txt
+- skyworks,en-channels	: Enable mask for current sink channel 1 to 6.
+- skyworks,ignore-pwm	: Ignore both PWM input
+- skyworks,dpwm-mode	: Enable DPWM dimming mode, otherwise Analog dimming.
+- skyworks,phase-shift	: Enable phase shift mode
+- skyworks,ovp-level	: Over-voltage protection level.
+			Should be between 14 or 28V.
+- skyworks,short-detection-threshold	: It should be one of 4, 5, 6 and 7V.
+- skyworks,current-limit	: It should be 2300mA or 2750mA.
+
+Example:
+
+	backlight {
+		compatible = "skyworks,sky81452-backlight";
+		name = "pwm-backlight";
+		skyworks,en-channels = <0x3f>;
+		skyworks,ignore-pwm;
+		skyworks,phase-shift;
+		skyworks,ovp-level = <20>;
+		skyworks,current-limit = <2300>;
+	};
-- 
1.9.1


^ permalink raw reply related

* [PATCH v10 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: gyungoh @ 2015-01-23  6:28 UTC (permalink / raw)
  To: sameo-VuQAYsv1563Yd54FQh9/CA, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
	cooloney-Re5JQEeQqe8AvxtiuMwx3w, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, trivial-DgEjT+Ai2ygdnm+yROfE0A
  Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	jic23-DgEjT+Ai2ygdnm+yROfE0A,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	ktsai-GubuWUlQtMwciDkP5Hr2oA, hs-ynQEQJNshbs,
	stwiss.opensource-WBD+wuPFNBhBDgjK7y7TUQ,
	matti.vaittinen-OYasijW0DpE, broonie-DgEjT+Ai2ygdnm+yROfE0A,
	jason-NLaQJdtUoK4Be96aLqz0jA, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	shawn.guo-KZfg59tc24xl57MIdRCFDg, florian.vaussard-p8DiymsW2f8,
	andrew-g2DYL2Zd6BY, antonynpavlov-Re5JQEeQqe8AvxtiuMwx3w,
	hytszk-Re5JQEeQqe8AvxtiuMwx3w, plagnioj-sclMFOaUSTBWk0Htik3J/w,
	tomi.valkeinen-l0cyMroinI0, jack.yoo-tjhQNA90jdKqndwCJWfcng,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1421994515-3070-1-git-send-email-jack.yoo-tjhQNA90jdKqndwCJWfcng@public.gmane.org>

From: Gyungoh Yoo <jack.yoo@skyworksinc.com>

Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
---
Changes v10:
Nothing

Changes v9:
Nothing

Changes v8:
Nothing

Changes v7:
Nothing

Changes v6:
Nothing

Changes v5:
Nothing

Changes v4:
Nothing

Changes v3:
Nothing

Changes v2:
Added vendor prefix for Skyworks Solutions, Inc.

 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index a344ec2..68143f0 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -140,6 +140,7 @@ sii	Seiko Instruments, Inc.
 silergy	Silergy Corp.
 sirf	SiRF Technology, Inc.
 sitronix	Sitronix Technology Corporation
+skyworks	Skyworks Solutions, Inc.
 smsc	Standard Microsystems Corporation
 snps	Synopsys, Inc.
 solidrun	SolidRun
-- 
1.9.1


^ permalink raw reply related

* [PATCH v10 6/6] devicetree: i2c: Add SKY81452 to the Trivial Devices list
From: gyungoh @ 2015-01-23  6:28 UTC (permalink / raw)
  To: sameo, lee.jones, grant.likely, robh+dt, jg1.han, cooloney,
	pawel.moll, mark.rutland, ijc+devicetree, galak, trivial
  Cc: akpm, jic23, thomas.petazzoni, ktsai, hs, stwiss.opensource,
	matti.vaittinen, broonie, jason, heiko, shawn.guo,
	florian.vaussard, andrew, antonynpavlov, hytszk, plagnioj,
	tomi.valkeinen, jack.yoo, linux-fbdev, linux-kernel, devicetree
In-Reply-To: <1421994515-3070-1-git-send-email-jack.yoo@skyworksinc.com>

From: Gyungoh Yoo <jack.yoo@skyworksinc.com>

Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
---
Changes v10:
Nothing

Changes v9:
Nothing

Changes v8:
Nothing

Changes v7:
Nothing

Changes v6:
Nothing

Changes v5:
Nothing

Changes v4:
Nothing

Changes v3:
Nothing

Changes v2:
Add SKY81452 to the Trivial Devices list

 Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index fbde415..122fa1e 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -77,6 +77,7 @@ ramtron,24c64		i2c serial eeprom  (24cxx)
 ricoh,rs5c372a		I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
 samsung,24ad0xd1	S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power)
 sii,s35390a		2-wire CMOS real-time clock
+skyworks,sky81452	Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply
 st-micro,24c256		i2c serial eeprom  (24cxx)
 stm,m41t00		Serial Access TIMEKEEPER
 stm,m41t62		Serial real-time clock (RTC) with alarm
-- 
1.9.1


^ permalink raw reply related

* Re: [PATCH v2 0/7] imx-drm: ipuv3-crtc: Implement mode_fixup
From: Philipp Zabel @ 2015-01-23 10:50 UTC (permalink / raw)
  To: Liu Ying
  Cc: Fabio Estevam, linux-fbdev, Steve Longerbeam, linux-kernel,
	dri-devel, Denis Carikli, Tomi Valkeinen, Steve Longerbeam,
	Russell King, Jean-Christophe Plagniol-Villard
In-Reply-To: <20150123025643.GA11412@victor>

Hi Liu,

Am Freitag, den 23.01.2015, 10:56 +0800 schrieb Liu Ying:
> Hi,
> 
> It looks that the below commit makes my Hannstar XGA LVDS panel stop working
> on the i.MX6DL SabreSD board.  Any idea?
> 
> commit eb10d6355532def3a74aaabd115e2373cca70b9d
> Author: Steve Longerbeam <slongerbeam@gmail.com>
> Date:   Thu Dec 18 18:00:24 2014 -0800
> 
> imx-drm: encoder prepare/mode_set must use adjusted mode
> 
> The encoder ->prepare() and ->mode_set() methods need to use the
> hw adjusted mode, not the original mode.
> 
> Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> 
> Regards,
> Liu Ying

What are this panel timings? The adjustment should increase the vertical
back porch by up to two lines (so it is at least two lines), reducing
the front porch or vsync length by the same amount. Does this panel use
the HSYNC/VSYNC signals embedded in the LVDS stream?

regards
Philipp


^ permalink raw reply

* Re: [PATCH v2 0/7] imx-drm: ipuv3-crtc: Implement mode_fixup
From: Fabio Estevam @ 2015-01-23 14:44 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Fabio Estevam, linux-fbdev@vger.kernel.org, Steve Longerbeam,
	Jean-Christophe Plagniol-Villard, linux-kernel, DRI mailing list,
	Denis Carikli, Tomi Valkeinen, Steve Longerbeam, Russell King
In-Reply-To: <1422010236.3017.12.camel@pengutronix.de>

Hi Philipp,

On Fri, Jan 23, 2015 at 8:50 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:

> What are this panel timings? The adjustment should increase the vertical
> back porch by up to two lines (so it is at least two lines), reducing
> the front porch or vsync length by the same amount. Does this panel use
> the HSYNC/VSYNC signals embedded in the LVDS stream?

The panel on this board is a Hannstar HSD100PXN1. The timings we use
are described in imx6qdl-sabresd.dtsi:

        display-timings {
            native-mode = <&timing0>;
            timing0: hsd100pxn1 {
                clock-frequency = <65000000>;
                hactive = <1024>;
                vactive = <768>;
                hback-porch = <220>;
                hfront-porch = <40>;
                vback-porch = <21>;
                vfront-porch = <7>;
                hsync-len = <60>;
                vsync-len = <10>;
            };

^ permalink raw reply

* Re: [PATCH v2 0/7] imx-drm: ipuv3-crtc: Implement mode_fixup
From: Fabio Estevam @ 2015-01-23 15:06 UTC (permalink / raw)
  To: Liu Ying
  Cc: Fabio Estevam, linux-fbdev@vger.kernel.org, Steve Longerbeam,
	linux-kernel, DRI mailing list, Denis Carikli, Tomi Valkeinen,
	Steve Longerbeam, Russell King, Jean-Christophe Plagniol-Villard
In-Reply-To: <20150123025643.GA11412@victor>

On Fri, Jan 23, 2015 at 12:56 AM, Liu Ying <Ying.Liu@freescale.com> wrote:
> Hi,
>
> It looks that the below commit makes my Hannstar XGA LVDS panel stop working
> on the i.MX6DL SabreSD board.  Any idea?

Yes, with eb10d6355532def3a ("mx-drm: encoder prepare/mode_set must
use adjusted mode") applied
the DI clock is 0:

--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -169,6 +169,8 @@ static void imx_ldb_encoder_prepare(struct
drm_encoder *encoder)
        unsigned long di_clk = mode->clock * 1000;
        int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder);

+       pr_err("********* DI clock is %ld\n", di_clk);
+
        if (ldb->ldb_ctrl & LDB_SPLIT_MODE_EN) {

With eb10d6355532def3a applied:

[    1.493745] ********* DI clock is 0

With eb10d6355532def3a reverted:

[    1.493639] ********* DI clock is 65000000

Should we just go back to the previous usage?

--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -163,12 +163,14 @@ static void imx_ldb_encoder_prepare(struct
drm_encoder *encoder)
 {
        struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
        struct imx_ldb *ldb = imx_ldb_ch->ldb;
-       struct drm_display_mode *mode = &encoder->crtc->hwmode;
+       struct drm_display_mode *mode = &encoder->crtc->mode;
        u32 pixel_fmt;

^ permalink raw reply

* Re: [PATCH v2 0/7] imx-drm: ipuv3-crtc: Implement mode_fixup
From: Philipp Zabel @ 2015-01-23 16:18 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Liu Ying, Fabio Estevam, linux-fbdev@vger.kernel.org,
	Steve Longerbeam, linux-kernel, DRI mailing list, Denis Carikli,
	Tomi Valkeinen, Steve Longerbeam, Russell King,
	Jean-Christophe Plagniol-Villard
In-Reply-To: <CAOMZO5AYKbq34j2VnZKWqSBVfJgoOOhZX+mPgnMwZ1mzBAKGJQ@mail.gmail.com>

Am Freitag, den 23.01.2015, 13:06 -0200 schrieb Fabio Estevam:
> On Fri, Jan 23, 2015 at 12:56 AM, Liu Ying <Ying.Liu@freescale.com> wrote:
> > Hi,
> >
> > It looks that the below commit makes my Hannstar XGA LVDS panel stop working
> > on the i.MX6DL SabreSD board.  Any idea?
> 
> Yes, with eb10d6355532def3a ("mx-drm: encoder prepare/mode_set must
> use adjusted mode") applied
> the DI clock is 0:

My bad, the problem is we are misusing encoder_prepare to enable the
display interface clock needed for the following crtc mode set.

What we really want is to use is adjusted_mode given to
encoder_funcs->mode_set, before the clock is enabled by
crtc_funcs->commit.

How about this patch:

-----8<-----
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index abceb3d..99fe4bb 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -193,22 +193,8 @@ static void imx_ldb_encoder_prepare(struct drm_encoder *encoder)
 {
 	struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
 	struct imx_ldb *ldb = imx_ldb_ch->ldb;
-	struct drm_display_mode *mode = &encoder->crtc->hwmode;
 	u32 pixel_fmt;
-	unsigned long serial_clk;
-	unsigned long di_clk = mode->clock * 1000;
-	int mux = imx_ldb_get_mux_id(imx_ldb_ch);
 
-	if (ldb->ldb_ctrl & LDB_SPLIT_MODE_EN) {
-		/* dual channel LVDS mode */
-		serial_clk = 3500UL * mode->clock;
-		imx_ldb_set_clock(ldb, mux, 0, serial_clk, di_clk);
-		imx_ldb_set_clock(ldb, mux, 1, serial_clk, di_clk);
-	} else {
-		serial_clk = 7000UL * mode->clock;
-		imx_ldb_set_clock(ldb, mux, imx_ldb_ch->chno, serial_clk,
-				di_clk);
-	}
 
 	switch (imx_ldb_ch->chno) {
 	case 0:
@@ -281,6 +267,9 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder,
 	struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
 	struct imx_ldb *ldb = imx_ldb_ch->ldb;
 	int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
+	unsigned long serial_clk;
+	unsigned long di_clk = mode->clock * 1000;
+	int mux = imx_ldb_get_mux_id(imx_ldb_ch);
 
 	if (mode->clock > 170000) {
 		dev_warn(ldb->dev,
@@ -291,6 +280,16 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder,
 			 "%s: mode exceeds 85 MHz pixel clock\n", __func__);
 	}
 
+	if (dual) {
+		serial_clk = 3500UL * mode->clock;
+		imx_ldb_set_clock(ldb, mux, 0, serial_clk, di_clk);
+		imx_ldb_set_clock(ldb, mux, 1, serial_clk, di_clk);
+	} else {
+		serial_clk = 7000UL * mode->clock;
+		imx_ldb_set_clock(ldb, mux, imx_ldb_ch->chno, serial_clk,
+				  di_clk);
+	}
+
 	/* FIXME - assumes straight connections DI0 --> CH0, DI1 --> CH1 */
 	if (imx_ldb_ch = &ldb->channel[0]) {
 		if (mode->flags & DRM_MODE_FLAG_NVSYNC)
-- 
2.1.4
----->8-----

regards
Philipp


^ permalink raw reply related

* Re: [PATCH v2 0/7] imx-drm: ipuv3-crtc: Implement mode_fixup
From: Fabio Estevam @ 2015-01-23 16:27 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Fabio Estevam, linux-fbdev@vger.kernel.org, Steve Longerbeam,
	Jean-Christophe Plagniol-Villard, linux-kernel, DRI mailing list,
	Denis Carikli, Tomi Valkeinen, Steve Longerbeam, Russell King
In-Reply-To: <1422029904.3017.37.camel@pengutronix.de>

Hi Philipp,

On Fri, Jan 23, 2015 at 2:18 PM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> @@ -281,6 +267,9 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder,
>         struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
>         struct imx_ldb *ldb = imx_ldb_ch->ldb;
>         int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
> +       unsigned long serial_clk;
> +       unsigned long di_clk = mode->clock * 1000;
> +       int mux = imx_ldb_get_mux_id(imx_ldb_ch);

I can't find imx_ldb_get_mux_id() on linux-next.

^ permalink raw reply

* Re: [PATCH v2 0/7] imx-drm: ipuv3-crtc: Implement mode_fixup
From: Philipp Zabel @ 2015-01-23 16:39 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Fabio Estevam, linux-fbdev@vger.kernel.org, Steve Longerbeam,
	Jean-Christophe Plagniol-Villard, linux-kernel, DRI mailing list,
	Denis Carikli, Tomi Valkeinen, Steve Longerbeam, Russell King
In-Reply-To: <CAOMZO5D=wXFswNggf7PCK2iWsQEaO0XoUTaTV-vEUMA4VgS_2A@mail.gmail.com>

Am Freitag, den 23.01.2015, 14:27 -0200 schrieb Fabio Estevam:
> Hi Philipp,
> 
> On Fri, Jan 23, 2015 at 2:18 PM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> > @@ -281,6 +267,9 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder,
> >         struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
> >         struct imx_ldb *ldb = imx_ldb_ch->ldb;
> >         int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
> > +       unsigned long serial_clk;
> > +       unsigned long di_clk = mode->clock * 1000;
> > +       int mux = imx_ldb_get_mux_id(imx_ldb_ch);
> 
> I can't find imx_ldb_get_mux_id() on linux-next.

Sorry, that should be

	int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder);

regards
Philipp


^ permalink raw reply

* Re: [PATCH v2 0/7] imx-drm: ipuv3-crtc: Implement mode_fixup
From: Fabio Estevam @ 2015-01-23 16:41 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Liu Ying, Fabio Estevam, linux-fbdev@vger.kernel.org,
	Steve Longerbeam, linux-kernel, DRI mailing list, Denis Carikli,
	Tomi Valkeinen, Steve Longerbeam, Russell King,
	Jean-Christophe Plagniol-Villard
In-Reply-To: <1422031150.3017.39.camel@pengutronix.de>

On Fri, Jan 23, 2015 at 2:39 PM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> Am Freitag, den 23.01.2015, 14:27 -0200 schrieb Fabio Estevam:
>> Hi Philipp,
>>
>> On Fri, Jan 23, 2015 at 2:18 PM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
>> > @@ -281,6 +267,9 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder,
>> >         struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
>> >         struct imx_ldb *ldb = imx_ldb_ch->ldb;
>> >         int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
>> > +       unsigned long serial_clk;
>> > +       unsigned long di_clk = mode->clock * 1000;
>> > +       int mux = imx_ldb_get_mux_id(imx_ldb_ch);
>>
>> I can't find imx_ldb_get_mux_id() on linux-next.
>
> Sorry, that should be
>
>         int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder);

It works fine now, thanks:

Tested-by: Fabio Estevam <fabio.estevam@freescale.com>

^ permalink raw reply

* [RFC PATCH] fbcon: Remove unused vblank cursor code
From: Scot Doyle @ 2015-01-23 22:55 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: linux-fbdev, linux-kernel

commit 1fa0b29f3a43 ("fbdev: Kill Atari vblank cursor blinking")

rendered vbl_cursor_cnt and therefore CURSOR_DRAW_DELAY unused in fbcon.c,
so remove them.

Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
 drivers/video/console/fbcon.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index ea43724..b972106 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -146,9 +146,6 @@ static const struct consw fb_con;
 
 static int fbcon_set_origin(struct vc_data *);
 
-#define CURSOR_DRAW_DELAY		(1)
-
-static int vbl_cursor_cnt;
 static int fbcon_cursor_noblink;
 
 #define divides(a, b)	((!(a) || (b)%(a)) ? 0 : 1)
@@ -1329,7 +1326,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
 
 	ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1),
 		    get_color(vc, info, c, 0));
-	vbl_cursor_cnt = CURSOR_DRAW_DELAY;
 }
 
 static int scrollback_phys_max = 0;
-- 
2.1.4


^ permalink raw reply related

* [RFC PATCH 0/2] fbcon: user-defined cursor blink interval
From: Scot Doyle @ 2015-01-24  1:10 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: linux-fbdev, linux-kernel

Allow users to set fbcon's cursor blink interval. The current interval
of 200 milliseconds is retained as the default.

Tested with intelfb.

Scot Doyle (2):
  fbcon: store cursor blink interval in fbcon_ops
  fbcon: expose cursor blink interval via sysfs

 drivers/video/console/fbcon.c | 80 +++++++++++++++++++++++++++++++++++++++++--
 drivers/video/console/fbcon.h |  1 +
 2 files changed, 79 insertions(+), 2 deletions(-)

-- 
2.1.4


^ permalink raw reply

* [RFC PATCH 1/2] fbcon: store cursor blink interval in fbcon_ops
From: Scot Doyle @ 2015-01-24  1:14 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501240109060.3489@localhost.localdomain>

The fbcon cursor, when set to blink, is hardcoded to toggle display state
five times per second. Move this setting to a the driver's fbdev_ops
structure, retaining the default blink interval.

Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
 drivers/video/console/fbcon.c | 5 +++--
 drivers/video/console/fbcon.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index ea43724..7a2030b 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -405,7 +405,7 @@ static void cursor_timer_handler(unsigned long dev_addr)
 	struct fbcon_ops *ops = info->fbcon_par;
 
 	queue_work(system_power_efficient_wq, &info->queue);
-	mod_timer(&ops->cursor_timer, jiffies + HZ/5);
+	mod_timer(&ops->cursor_timer, jiffies + ops->blink_jiffies);
 }
 
 static void fbcon_add_cursor_timer(struct fb_info *info)
@@ -420,7 +420,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
 
 		init_timer(&ops->cursor_timer);
 		ops->cursor_timer.function = cursor_timer_handler;
-		ops->cursor_timer.expires = jiffies + HZ / 5;
+		ops->cursor_timer.expires = jiffies + ops->blink_jiffies;
 		ops->cursor_timer.data = (unsigned long ) info;
 		add_timer(&ops->cursor_timer);
 		ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
@@ -959,6 +959,7 @@ static const char *fbcon_startup(void)
 	ops->currcon = -1;
 	ops->graphics = 1;
 	ops->cur_rotate = -1;
+	ops->blink_jiffies = msecs_to_jiffies(200);
 	info->fbcon_par = ops;
 	p->con_rotate = initial_rotation;
 	set_blitting_type(vc, info);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 6bd2e0c..642c4e7 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -70,6 +70,7 @@ struct fbcon_ops {
 	struct fb_cursor cursor_state;
 	struct display *p;
         int    currcon;	                /* Current VC. */
+	int    blink_jiffies;
 	int    cursor_flash;
 	int    cursor_reset;
 	int    blank_state;
-- 
2.1.4


^ permalink raw reply related

* [RFC PATCH 2/2] fbcon: expose cursor blink interval via sysfs
From: Scot Doyle @ 2015-01-24  1:19 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501240109060.3489@localhost.localdomain>

The fbcon cursor, when set to blink, is hardcoded to toggle display state
five times per second. Expose this setting via
/sys/class/graphics/fbcon/cursor_blink_ms

Values written to the interface set the approximate time interval in
milliseconds between cursor toggles, from 1 to 32767. Since the interval
is stored internally as a number of jiffies, the millisecond value read
from the interface may not exactly match the entered value.

An outstanding blink timer is reset after a new value is entered.

If the cursor blink is disabled, either via the 'cursor_blink' boolean
setting or some other mechanism, the 'cursor_blink_ms' setting may still
be modified. The new value will be used if the blink is reactivated.

Tested with intelfb.

Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
 drivers/video/console/fbcon.c | 75 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 7a2030b..0ddfcf6 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -3495,11 +3495,86 @@ err:
 	return count;
 }
 
+static ssize_t show_cursor_blink_ms(struct device *device,
+				    struct device_attribute *attr, char *buf)
+{
+	struct fb_info *info;
+	struct fbcon_ops *ops;
+	int idx, ms = -1;
+
+	if (fbcon_has_exited)
+		return 0;
+
+	console_lock();
+	idx = con2fb_map[fg_console];
+
+	if (idx = -1 || registered_fb[idx] = NULL)
+		goto err;
+
+	info = registered_fb[idx];
+	ops = info->fbcon_par;
+
+	if (!ops)
+		goto err;
+
+	ms = jiffies_to_msecs(ops->blink_jiffies);
+
+err:
+	console_unlock();
+	return snprintf(buf, PAGE_SIZE, "%d\n", ms);
+}
+
+static ssize_t store_cursor_blink_ms(struct device *device,
+				     struct device_attribute *attr,
+				     const char *buf, size_t count)
+{
+	struct fb_info *info;
+	struct fbcon_ops *ops;
+	int idx;
+	unsigned long ms;
+
+	if (fbcon_has_exited)
+		return count;
+
+	console_lock();
+	idx = con2fb_map[fg_console];
+
+	if (idx = -1 || registered_fb[idx] = NULL)
+		goto err;
+
+	info = registered_fb[idx];
+
+	if (!info->fbcon_par)
+		goto err;
+
+	ops = info->fbcon_par;
+
+	if (!ops)
+		goto err;
+
+	if (!kstrtoul(buf, 0, &ms)) {
+		ms = min_t(unsigned long, ms, SHRT_MAX);
+		ops->blink_jiffies = max_t(int, msecs_to_jiffies(ms), 1);
+
+		if (info->queue.func = fb_flashcursor &&
+		    ops->flags & FBCON_FLAGS_CURSOR_TIMER) {
+			fbcon_del_cursor_timer(info);
+			fbcon_add_cursor_timer(info);
+		}
+	}
+
+err:
+	console_unlock();
+	return count;
+}
+
 static struct device_attribute device_attrs[] = {
 	__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
 	__ATTR(rotate_all, S_IWUSR, NULL, store_rotate_all),
 	__ATTR(cursor_blink, S_IRUGO|S_IWUSR, show_cursor_blink,
 	       store_cursor_blink),
+	__ATTR(cursor_blink_ms, S_IRUGO|S_IWUSR, show_cursor_blink_ms,
+	       store_cursor_blink_ms),
 };
 
 static int fbcon_init_device(void)
-- 
2.1.4


^ permalink raw reply related

* Re: [RFC PATCH 2/2] fbcon: expose cursor blink interval via sysfs
From: Geert Uytterhoeven @ 2015-01-24 15:50 UTC (permalink / raw)
  To: Scot Doyle
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Linux Fbdev development list, linux-kernel@vger.kernel.org
In-Reply-To: <alpine.DEB.2.11.1501240117400.3639@localhost.localdomain>

On Sat, Jan 24, 2015 at 2:19 AM, Scot Doyle <lkml14@scotdoyle.com> wrote:
> +static ssize_t store_cursor_blink_ms(struct device *device,
> +                                    struct device_attribute *attr,
> +                                    const char *buf, size_t count)
> +{

...

> +       unsigned long ms;

...

> +       if (!kstrtoul(buf, 0, &ms)) {

kstrtos16()?

> +               ms = min_t(unsigned long, ms, SHRT_MAX);
> +               ops->blink_jiffies = max_t(int, msecs_to_jiffies(ms), 1);


Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* [PATCH v2 1/2] fbcon: store cursor blink interval in fbcon_ops
From: Scot Doyle @ 2015-01-24 17:38 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Geert Uytterhoeven, linux-fbdev, linux-kernel
In-Reply-To: <CAMuHMdX2cs_JW4QEC=E=m2Z6gg=kZE5PnHBQYZ5RnFp1E9m_fQ@mail.gmail.com>

The fbcon cursor, when set to blink, is hardcoded to toggle display state
five times per second. Move this setting to a the driver's fbdev_ops
structure, retaining the default blink interval.

Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
 drivers/video/console/fbcon.c | 5 +++--
 drivers/video/console/fbcon.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index ea43724..7a2030b 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -405,7 +405,7 @@ static void cursor_timer_handler(unsigned long dev_addr)
 	struct fbcon_ops *ops = info->fbcon_par;
 
 	queue_work(system_power_efficient_wq, &info->queue);
-	mod_timer(&ops->cursor_timer, jiffies + HZ/5);
+	mod_timer(&ops->cursor_timer, jiffies + ops->blink_jiffies);
 }
 
 static void fbcon_add_cursor_timer(struct fb_info *info)
@@ -420,7 +420,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
 
 		init_timer(&ops->cursor_timer);
 		ops->cursor_timer.function = cursor_timer_handler;
-		ops->cursor_timer.expires = jiffies + HZ / 5;
+		ops->cursor_timer.expires = jiffies + ops->blink_jiffies;
 		ops->cursor_timer.data = (unsigned long ) info;
 		add_timer(&ops->cursor_timer);
 		ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
@@ -959,6 +959,7 @@ static const char *fbcon_startup(void)
 	ops->currcon = -1;
 	ops->graphics = 1;
 	ops->cur_rotate = -1;
+	ops->blink_jiffies = msecs_to_jiffies(200);
 	info->fbcon_par = ops;
 	p->con_rotate = initial_rotation;
 	set_blitting_type(vc, info);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 6bd2e0c..642c4e7 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -70,6 +70,7 @@ struct fbcon_ops {
 	struct fb_cursor cursor_state;
 	struct display *p;
         int    currcon;	                /* Current VC. */
+	int    blink_jiffies;
 	int    cursor_flash;
 	int    cursor_reset;
 	int    blank_state;
-- 
2.1.4


^ permalink raw reply related

* [PATCH v2 2/2] fbcon: expose cursor blink interval via sysfs
From: Scot Doyle @ 2015-01-24 17:41 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Geert Uytterhoeven, linux-fbdev, linux-kernel
In-Reply-To: <CAMuHMdX2cs_JW4QEC=E=m2Z6gg=kZE5PnHBQYZ5RnFp1E9m_fQ@mail.gmail.com>

The fbcon cursor, when set to blink, is hardcoded to toggle display state
five times per second. Expose this setting via
/sys/class/graphics/fbcon/cursor_blink_ms

Values written to the interface set the approximate time interval in
milliseconds between cursor toggles, from 1 to 32767. Since the interval
is stored internally as a number of jiffies, the millisecond value read
from the interface may not exactly match the entered value.

An outstanding blink timer is reset after a new value is entered.

If the cursor blink is disabled, either via the 'cursor_blink' boolean
setting or some other mechanism, the 'cursor_blink_ms' setting may still
be modified. The new value will be used if the blink is reactivated.

Tested with intelfb.

Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
---
v2:  Use kstrtos16() instead of kstrtoul() and min_t(). Thanks Geert!

 drivers/video/console/fbcon.c | 73 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 7a2030b..7b6815d 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -3495,11 +3495,84 @@ err:
 	return count;
 }
 
+static ssize_t show_cursor_blink_ms(struct device *device,
+				    struct device_attribute *attr, char *buf)
+{
+	struct fb_info *info;
+	struct fbcon_ops *ops;
+	int idx, ms = -1;
+
+	if (fbcon_has_exited)
+		return 0;
+
+	console_lock();
+	idx = con2fb_map[fg_console];
+
+	if (idx = -1 || registered_fb[idx] = NULL)
+		goto err;
+
+	info = registered_fb[idx];
+	ops = info->fbcon_par;
+
+	if (!ops)
+		goto err;
+
+	ms = jiffies_to_msecs(ops->blink_jiffies);
+
+err:
+	console_unlock();
+	return snprintf(buf, PAGE_SIZE, "%d\n", ms);
+}
+
+static ssize_t store_cursor_blink_ms(struct device *device,
+				     struct device_attribute *attr,
+				     const char *buf, size_t count)
+{
+	struct fb_info *info;
+	struct fbcon_ops *ops;
+	int idx;
+	short ms;
+
+	if (fbcon_has_exited)
+		return count;
+
+	console_lock();
+	idx = con2fb_map[fg_console];
+
+	if (idx = -1 || registered_fb[idx] = NULL)
+		goto err;
+
+	info = registered_fb[idx];
+
+	if (!info->fbcon_par)
+		goto err;
+
+	ops = info->fbcon_par;
+
+	if (!ops)
+		goto err;
+
+	if (!kstrtos16(buf, 0, &ms)) {
+		ops->blink_jiffies = max_t(int, msecs_to_jiffies(ms), 1);
+		if (info->queue.func = fb_flashcursor &&
+		    ops->flags & FBCON_FLAGS_CURSOR_TIMER) {
+			fbcon_del_cursor_timer(info);
+			fbcon_add_cursor_timer(info);
+		}
+	}
+
+err:
+	console_unlock();
+	return count;
+}
+
 static struct device_attribute device_attrs[] = {
 	__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
 	__ATTR(rotate_all, S_IWUSR, NULL, store_rotate_all),
 	__ATTR(cursor_blink, S_IRUGO|S_IWUSR, show_cursor_blink,
 	       store_cursor_blink),
+	__ATTR(cursor_blink_ms, S_IRUGO|S_IWUSR, show_cursor_blink_ms,
+	       store_cursor_blink_ms),
 };
 
 static int fbcon_init_device(void)
-- 
2.1.4


^ permalink raw reply related

* [PATCH 2/3] hyperv: hyperv_fb.c: fixup-of-wait_for_completion_timeout-return-type
From: Nicholas Mc Guire @ 2015-01-25 11:02 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: Haiyang Zhang, Tomi Valkeinen, devel, linux-fbdev, linux-kernel,
	Nicholas Mc Guire

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---

The return type of wait_for_completion_timeout is unsigned long not
int. This patch fixes up the declarations only.

Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y
CONFIG_HYPERV=m, CONFIG_FB_HYPERV=m

Patch is against 3.19.0-rc5 -next-20150123

 drivers/video/fbdev/hyperv_fb.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
index 4254336..807ee22 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -415,7 +415,8 @@ static int synthvid_negotiate_ver(struct hv_device *hdev, u32 ver)
 	struct fb_info *info = hv_get_drvdata(hdev);
 	struct hvfb_par *par = info->par;
 	struct synthvid_msg *msg = (struct synthvid_msg *)par->init_buf;
-	int t, ret = 0;
+	int ret = 0;
+	unsigned long t;
 
 	memset(msg, 0, sizeof(struct synthvid_msg));
 	msg->vid_hdr.type = SYNTHVID_VERSION_REQUEST;
@@ -488,7 +489,8 @@ static int synthvid_send_config(struct hv_device *hdev)
 	struct fb_info *info = hv_get_drvdata(hdev);
 	struct hvfb_par *par = info->par;
 	struct synthvid_msg *msg = (struct synthvid_msg *)par->init_buf;
-	int t, ret = 0;
+	int ret = 0;
+	unsigned long t;
 
 	/* Send VRAM location */
 	memset(msg, 0, sizeof(struct synthvid_msg));
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH 2/3 v2] hyperv: hyperv_fb.c: match wait_for_completion_timeout return type
From: Nicholas Mc Guire @ 2015-01-25 14:47 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: Haiyang Zhang, Tomi Valkeinen, devel, linux-fbdev, linux-kernel,
	Nicholas Mc Guire

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---

v2: fixed subject line

The return type of wait_for_completion_timeout is unsigned long not
int. This patch fixes up the declarations only.

Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y
CONFIG_HYPERV=m, CONFIG_FB_HYPERV=m

Patch is against 3.19.0-rc5 -next-20150123

 drivers/video/fbdev/hyperv_fb.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
index 4254336..807ee22 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -415,7 +415,8 @@ static int synthvid_negotiate_ver(struct hv_device *hdev, u32 ver)
 	struct fb_info *info = hv_get_drvdata(hdev);
 	struct hvfb_par *par = info->par;
 	struct synthvid_msg *msg = (struct synthvid_msg *)par->init_buf;
-	int t, ret = 0;
+	int ret = 0;
+	unsigned long t;
 
 	memset(msg, 0, sizeof(struct synthvid_msg));
 	msg->vid_hdr.type = SYNTHVID_VERSION_REQUEST;
@@ -488,7 +489,8 @@ static int synthvid_send_config(struct hv_device *hdev)
 	struct fb_info *info = hv_get_drvdata(hdev);
 	struct hvfb_par *par = info->par;
 	struct synthvid_msg *msg = (struct synthvid_msg *)par->init_buf;
-	int t, ret = 0;
+	int ret = 0;
+	unsigned long t;
 
 	/* Send VRAM location */
 	memset(msg, 0, sizeof(struct synthvid_msg));
-- 
1.7.10.4


^ permalink raw reply related

* Re: [PATCH 2/3 v2] hyperv: hyperv_fb.c: match wait_for_completion_timeout return type
From: Tomi Valkeinen @ 2015-01-26 12:03 UTC (permalink / raw)
  To: Nicholas Mc Guire, K. Y. Srinivasan
  Cc: Haiyang Zhang, devel, linux-fbdev, linux-kernel
In-Reply-To: <1422197222-7967-1-git-send-email-der.herr@hofr.at>

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

Hi,

On 25/01/15 16:47, Nicholas Mc Guire wrote:
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> ---
> 
> v2: fixed subject line
> 
> The return type of wait_for_completion_timeout is unsigned long not
> int. This patch fixes up the declarations only.
> 
> Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y
> CONFIG_HYPERV=m, CONFIG_FB_HYPERV=m

Why didn't you set the text above as the patch description (which is
empty at the moment)?

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [RFC PATCH 2/2] fbcon: expose cursor blink interval via sysfs
From: Tomi Valkeinen @ 2015-01-26 12:08 UTC (permalink / raw)
  To: Scot Doyle, Jean-Christophe Plagniol-Villard; +Cc: linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501240117400.3639@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 3474 bytes --]

On 24/01/15 03:19, Scot Doyle wrote:
> The fbcon cursor, when set to blink, is hardcoded to toggle display state
> five times per second. Expose this setting via
> /sys/class/graphics/fbcon/cursor_blink_ms
> 
> Values written to the interface set the approximate time interval in
> milliseconds between cursor toggles, from 1 to 32767. Since the interval
> is stored internally as a number of jiffies, the millisecond value read
> from the interface may not exactly match the entered value.
> 
> An outstanding blink timer is reset after a new value is entered.
> 
> If the cursor blink is disabled, either via the 'cursor_blink' boolean
> setting or some other mechanism, the 'cursor_blink_ms' setting may still
> be modified. The new value will be used if the blink is reactivated.
> 
> Tested with intelfb.
> 
> Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
> ---
>  drivers/video/console/fbcon.c | 75 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 75 insertions(+)
> 
> diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
> index 7a2030b..0ddfcf6 100644
> --- a/drivers/video/console/fbcon.c
> +++ b/drivers/video/console/fbcon.c
> @@ -3495,11 +3495,86 @@ err:
>  	return count;
>  }
>  
> +static ssize_t show_cursor_blink_ms(struct device *device,
> +				    struct device_attribute *attr, char *buf)
> +{
> +	struct fb_info *info;
> +	struct fbcon_ops *ops;
> +	int idx, ms = -1;
> +
> +	if (fbcon_has_exited)
> +		return 0;

Why not return an error here?

> +
> +	console_lock();
> +	idx = con2fb_map[fg_console];
> +
> +	if (idx == -1 || registered_fb[idx] == NULL)
> +		goto err;

Same here?

> +	info = registered_fb[idx];
> +	ops = info->fbcon_par;
> +
> +	if (!ops)
> +		goto err;

And here.

> +
> +	ms = jiffies_to_msecs(ops->blink_jiffies);
> +
> +err:
> +	console_unlock();
> +	return snprintf(buf, PAGE_SIZE, "%d\n", ms);
> +}
> +
> +static ssize_t store_cursor_blink_ms(struct device *device,
> +				     struct device_attribute *attr,
> +				     const char *buf, size_t count)
> +{
> +	struct fb_info *info;
> +	struct fbcon_ops *ops;
> +	int idx;
> +	unsigned long ms;
> +
> +	if (fbcon_has_exited)
> +		return count;
> +
> +	console_lock();
> +	idx = con2fb_map[fg_console];
> +
> +	if (idx == -1 || registered_fb[idx] == NULL)
> +		goto err;
> +
> +	info = registered_fb[idx];
> +
> +	if (!info->fbcon_par)
> +		goto err;
> +
> +	ops = info->fbcon_par;
> +
> +	if (!ops)
> +		goto err;

Here also all the above look like errors to me, so why not return an error?

> +
> +	if (!kstrtoul(buf, 0, &ms)) {
> +		ms = min_t(unsigned long, ms, SHRT_MAX);
> +		ops->blink_jiffies = max_t(int, msecs_to_jiffies(ms), 1);
> +
> +		if (info->queue.func == fb_flashcursor &&
> +		    ops->flags & FBCON_FLAGS_CURSOR_TIMER) {
> +			fbcon_del_cursor_timer(info);
> +			fbcon_add_cursor_timer(info);
> +		}
> +	}
> +
> +err:
> +	console_unlock();
> +	return count;
> +}
> +
>  static struct device_attribute device_attrs[] = {
>  	__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
>  	__ATTR(rotate_all, S_IWUSR, NULL, store_rotate_all),
>  	__ATTR(cursor_blink, S_IRUGO|S_IWUSR, show_cursor_blink,
>  	       store_cursor_blink),
> +	__ATTR(cursor_blink_ms, S_IRUGO|S_IWUSR, show_cursor_blink_ms,
> +	       store_cursor_blink_ms),
>  };
>  
>  static int fbcon_init_device(void)
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [RFC PATCH] fbcon: Remove unused vblank cursor code
From: Tomi Valkeinen @ 2015-01-26 12:11 UTC (permalink / raw)
  To: Scot Doyle, Jean-Christophe Plagniol-Villard; +Cc: linux-fbdev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1501232247340.2377@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]

On 24/01/15 00:55, Scot Doyle wrote:
> commit 1fa0b29f3a43 ("fbdev: Kill Atari vblank cursor blinking")
> 
> rendered vbl_cursor_cnt and therefore CURSOR_DRAW_DELAY unused in fbcon.c,
> so remove them.
> 
> Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
> ---
>  drivers/video/console/fbcon.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
> index ea43724..b972106 100644
> --- a/drivers/video/console/fbcon.c
> +++ b/drivers/video/console/fbcon.c
> @@ -146,9 +146,6 @@ static const struct consw fb_con;
>  
>  static int fbcon_set_origin(struct vc_data *);
>  
> -#define CURSOR_DRAW_DELAY		(1)
> -
> -static int vbl_cursor_cnt;
>  static int fbcon_cursor_noblink;
>  
>  #define divides(a, b)	((!(a) || (b)%(a)) ? 0 : 1)
> @@ -1329,7 +1326,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
>  
>  	ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1),
>  		    get_color(vc, info, c, 0));
> -	vbl_cursor_cnt = CURSOR_DRAW_DELAY;
>  }
>  
>  static int scrollback_phys_max = 0;
> 

Thanks, queued for 3.20.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH] video: fbdev: sis: remove unused variables
From: Tomi Valkeinen @ 2015-01-26 12:37 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Thomas Winischhofer, Jean-Christophe Plagniol-Villard,
	linux-fbdev, linux-kernel
In-Reply-To: <1421940699-20670-1-git-send-email-sudipm.mukherjee@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

On 22/01/15 17:31, Sudip Mukherjee wrote:
> removed some variables which were not used. Few calls to SiS_GetReg()
> were left behind as they are reading from the hardare, removing them
> might affect the overall functionality.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> This patch will generate checkpatch error, to fix that error we need
> to change the style of init.c and init301.c
> 
>  drivers/video/fbdev/sis/init.c     | 33 +++++----------------------------
>  drivers/video/fbdev/sis/init301.c  | 10 ++--------
>  drivers/video/fbdev/sis/sis_main.c |  9 ++++-----
>  3 files changed, 11 insertions(+), 41 deletions(-)

Are you able to test this?

The patch doesn't look too complex, but it's still slightly too complex
for me to comfortably merge it without any testing.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH] OMAPDSS: hdmi5: remove unneeded check
From: Tomi Valkeinen @ 2015-01-26 12:41 UTC (permalink / raw)
  To: Sudip Mukherjee, Jean-Christophe Plagniol-Villard
  Cc: linux-omap, linux-fbdev, linux-kernel
In-Reply-To: <1421167620-17290-1-git-send-email-sudipm.mukherjee@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

On 13/01/15 18:46, Sudip Mukherjee wrote:
> prior to this check we are checking for word_length_16b and if word_length_16b
> is false then we are returning with -EINVAL.
> So at this point word_length_16b can only be true.

True, but it looks to me the code may be extended in the future.

And if it would be clear that it won't be extended in the future, then
there's more code changes needed to reflect that (the whole
word_length_16b can be removed, etc).

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH] video: hgafb: remove unneeded comparison
From: Tomi Valkeinen @ 2015-01-26 12:43 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Ferenc Bakonyi, Jean-Christophe Plagniol-Villard, linux-nvidia,
	linux-fbdev, linux-kernel
In-Reply-To: <1421165699-9033-1-git-send-email-sudipm.mukherjee@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

On 13/01/15 18:14, Sudip Mukherjee wrote:
> var->yoffset is of the type __u32, hence the comparison will always
> be false.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>  drivers/video/fbdev/hgafb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c
> index 5ff9fe2..15d3ccf 100644
> --- a/drivers/video/fbdev/hgafb.c
> +++ b/drivers/video/fbdev/hgafb.c
> @@ -417,8 +417,7 @@ static int hgafb_pan_display(struct fb_var_screeninfo *var,
>  			     struct fb_info *info)
>  {
>  	if (var->vmode & FB_VMODE_YWRAP) {
> -		if (var->yoffset < 0 || 
> -		    var->yoffset >= info->var.yres_virtual ||
> +		if (var->yoffset >= info->var.yres_virtual ||
>  		    var->xoffset)
>  			return -EINVAL;
>  	} else {
> 

Thanks, queued for 3.20.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox