[PATCH] ipvs: Avoid unnecessary calls to skb_is_gso_sctp

2024-05-23 Thread Ismael Luceno
In the context of the SCTP SNAT/DNAT handler, these calls can only
return true.

Ref: e10d3ba4d434 ("ipvs: Fix checksumming on GSO of SCTP packets")
Signed-off-by: Ismael Luceno 
CC: Pablo Neira Ayuso 
CC: Michal Kubeček 
CC: Simon Horman 
CC: Julian Anastasov 
CC: lvs-de...@vger.kernel.org
CC: netfilter-de...@vger.kernel.org
CC: net...@vger.kernel.org
CC: coret...@netfilter.org
---
 net/netfilter/ipvs/ip_vs_proto_sctp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c 
b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index 1e689c714127..83e452916403 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -126,7 +126,7 @@ sctp_snat_handler(struct sk_buff *skb, struct 
ip_vs_protocol *pp,
if (sctph->source != cp->vport || payload_csum ||
skb->ip_summed == CHECKSUM_PARTIAL) {
sctph->source = cp->vport;
-   if (!skb_is_gso(skb) || !skb_is_gso_sctp(skb))
+   if (!skb_is_gso(skb))
sctp_nat_csum(skb, sctph, sctphoff);
} else {
skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -175,7 +175,7 @@ sctp_dnat_handler(struct sk_buff *skb, struct 
ip_vs_protocol *pp,
(skb->ip_summed == CHECKSUM_PARTIAL &&
 !(skb_dst(skb)->dev->features & NETIF_F_SCTP_CRC))) {
sctph->dest = cp->dport;
-   if (!skb_is_gso(skb) || !skb_is_gso_sctp(skb))
+   if (!skb_is_gso(skb))
sctp_nat_csum(skb, sctph, sctphoff);
} else if (skb->ip_summed != CHECKSUM_PARTIAL) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
-- 
2.44.0




[PATCH v3] ipvs: Fix checksumming on GSO of SCTP packets

2024-04-25 Thread Ismael Luceno
It was observed in the wild that pairs of consecutive packets would leave
the IPVS with the same wrong checksum, and the issue only went away when
disabling GSO.

IPVS needs to avoid computing the SCTP checksum when using GSO.

Fixes: 90017accff61 ("sctp: Add GSO support", 2016-06-02)
Co-developed-by: Firo Yang 
Signed-off-by: Ismael Luceno 
Tested-by: Andreas Taschner 
CC: Michal Kubeček 
CC: Simon Horman 
CC: Julian Anastasov 
CC: lvs-de...@vger.kernel.org
CC: netfilter-de...@vger.kernel.org
CC: net...@vger.kernel.org
CC: coret...@netfilter.org
---

Notes:
Changes since v2:
* Use only skb_is_gso, no need to check for GSO type

Changes since v1:
* Added skb_is_gso before skb_is_gso_sctp.
* Added "Fixes" tag.

 net/netfilter/ipvs/ip_vs_proto_sctp.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c 
b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index a0921adc31a9..83e452916403 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -126,7 +126,8 @@ sctp_snat_handler(struct sk_buff *skb, struct 
ip_vs_protocol *pp,
if (sctph->source != cp->vport || payload_csum ||
skb->ip_summed == CHECKSUM_PARTIAL) {
sctph->source = cp->vport;
-   sctp_nat_csum(skb, sctph, sctphoff);
+   if (!skb_is_gso(skb))
+   sctp_nat_csum(skb, sctph, sctphoff);
} else {
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
@@ -174,7 +175,8 @@ sctp_dnat_handler(struct sk_buff *skb, struct 
ip_vs_protocol *pp,
(skb->ip_summed == CHECKSUM_PARTIAL &&
 !(skb_dst(skb)->dev->features & NETIF_F_SCTP_CRC))) {
sctph->dest = cp->dport;
-   sctp_nat_csum(skb, sctph, sctphoff);
+   if (!skb_is_gso(skb))
+   sctp_nat_csum(skb, sctph, sctphoff);
} else if (skb->ip_summed != CHECKSUM_PARTIAL) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
-- 
2.43.0




Re: [PATCH] ipvs: Fix checksumming on GSO of SCTP packets

2024-04-21 Thread Ismael Luceno
On 21/Apr/2024 14:01, Julian Anastasov wrote:
<...>
>   Thanks for the fix, I'll accept this but skb_is_gso_sctp()
> has comment for pre-condition: skb_is_gso(skb). Can you send v2
> with it?

Thanks; sent!

>   I'm guessing what should be the Fixes line, may be?:
> 
> Fixes: 90017accff61 ("sctp: Add GSO support")

This seems like the right one.

>   because SCTP GSO was added after the IPVS code? Or the
> more recent commit d02f51cbcf12 which adds skb_is_gso_sctp ?

That doesn't seem related at all.

Do we need to check .gso_type in cases like this?



[PATCH v2] ipvs: Fix checksumming on GSO of SCTP packets

2024-04-21 Thread Ismael Luceno
It was observed in the wild that pairs of consecutive packets would leave
the IPVS with the same wrong checksum, and the issue only went away when
disabling GSO.

IPVS needs to avoid computing the SCTP checksum when using GSO.

Fixes: 90017accff61 ("sctp: Add GSO support", 2016-06-02)
Co-developed-by: Firo Yang 
Signed-off-by: Ismael Luceno 
Tested-by: Andreas Taschner 
CC: Michal Kubeček 
CC: Simon Horman 
CC: Julian Anastasov 
CC: lvs-de...@vger.kernel.org
CC: netfilter-de...@vger.kernel.org
CC: net...@vger.kernel.org
CC: coret...@netfilter.org
---

Notes:
Changes since v1:
* Added skb_is_gso before skb_is_gso_sctp.
* Added "Fixes" tag.

 net/netfilter/ipvs/ip_vs_proto_sctp.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c 
b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index a0921adc31a9..1e689c714127 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -126,7 +126,8 @@ sctp_snat_handler(struct sk_buff *skb, struct 
ip_vs_protocol *pp,
if (sctph->source != cp->vport || payload_csum ||
skb->ip_summed == CHECKSUM_PARTIAL) {
sctph->source = cp->vport;
-   sctp_nat_csum(skb, sctph, sctphoff);
+   if (!skb_is_gso(skb) || !skb_is_gso_sctp(skb))
+   sctp_nat_csum(skb, sctph, sctphoff);
} else {
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
@@ -174,7 +175,8 @@ sctp_dnat_handler(struct sk_buff *skb, struct 
ip_vs_protocol *pp,
(skb->ip_summed == CHECKSUM_PARTIAL &&
 !(skb_dst(skb)->dev->features & NETIF_F_SCTP_CRC))) {
sctph->dest = cp->dport;
-   sctp_nat_csum(skb, sctph, sctphoff);
+   if (!skb_is_gso(skb) || !skb_is_gso_sctp(skb))
+   sctp_nat_csum(skb, sctph, sctphoff);
} else if (skb->ip_summed != CHECKSUM_PARTIAL) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
-- 
2.43.0




[PATCH] ipvs: Fix checksumming on GSO of SCTP packets

2024-04-18 Thread Ismael Luceno
It was observed in the wild that pairs of consecutive packets would leave
the IPVS with the same wrong checksum, and the issue only went away when
disabling GSO.

IPVS needs to avoid computing the SCTP checksum when using GSO.

Co-developed-by: Firo Yang 
Signed-off-by: Ismael Luceno 
Tested-by: Andreas Taschner 
CC: Michal Kubeček 
CC: Simon Horman 
CC: Julian Anastasov 
CC: lvs-de...@vger.kernel.org
CC: netfilter-de...@vger.kernel.org
CC: net...@vger.kernel.org
CC: coret...@netfilter.org
---
 net/netfilter/ipvs/ip_vs_proto_sctp.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c 
b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index a0921adc31a9..3205b45ce161 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -126,7 +126,8 @@ sctp_snat_handler(struct sk_buff *skb, struct 
ip_vs_protocol *pp,
if (sctph->source != cp->vport || payload_csum ||
skb->ip_summed == CHECKSUM_PARTIAL) {
sctph->source = cp->vport;
-   sctp_nat_csum(skb, sctph, sctphoff);
+   if (!skb_is_gso_sctp(skb))
+   sctp_nat_csum(skb, sctph, sctphoff);
} else {
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
@@ -174,7 +175,8 @@ sctp_dnat_handler(struct sk_buff *skb, struct 
ip_vs_protocol *pp,
(skb->ip_summed == CHECKSUM_PARTIAL &&
 !(skb_dst(skb)->dev->features & NETIF_F_SCTP_CRC))) {
sctph->dest = cp->dport;
-   sctp_nat_csum(skb, sctph, sctphoff);
+   if (!skb_is_gso_sctp(skb))
+   sctp_nat_csum(skb, sctph, sctphoff);
} else if (skb->ip_summed != CHECKSUM_PARTIAL) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
-- 
2.43.0




Re: [PATCH] media: solo6x10: remove useless function

2021-04-13 Thread Ismael Luceno
NACK; before removing any of these functions the fields should be
documented somewhere else, so that no information is lost.

On 13/Apr/2021 15:23, Jiapeng Chong wrote:
> Fix the following clang warning:
> 
> drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c:394:19: warning: unused
> function 'vop_interlaced' [-Wunused-function].
> 
> Reported-by: Abaci Robot 
> Signed-off-by: Jiapeng Chong 
> ---
>  drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 5 -
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c 
> b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
> index 0abcad4..8c4fae7 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
> @@ -391,11 +391,6 @@ static int solo_send_desc(struct solo_enc_dev *solo_enc, 
> int skip,
>  }
>  
>  /* Extract values from VOP header - VE_STATUSxx */
> -static inline int vop_interlaced(const vop_header *vh)
> -{
> - return (__le32_to_cpu((*vh)[0]) >> 30) & 1;
> -}
> -
>  static inline u8 vop_channel(const vop_header *vh)
>  {
>   return (__le32_to_cpu((*vh)[0]) >> 24) & 0x1F;
> -- 
> 1.8.3.1
> 

-- 
Ismael Luceno
http://iodev.co.uk/


[PATCH] docs: reporting-issues: Remove reference to oldnoconfig

2021-03-31 Thread Ismael Luceno
Replace it with olddefconfig. oldnoconfig didn't do what the document
suggests (it aliased to olddefconfig), and isn't available since 4.19.

Ref: 04c459d20448 ("kconfig: remove oldnoconfig target")
Ref: 312ee68752fa ("kconfig: announce removal of oldnoconfig if used")
Signed-off-by: Ismael Luceno 
---
 Documentation/admin-guide/reporting-issues.rst | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/reporting-issues.rst 
b/Documentation/admin-guide/reporting-issues.rst
index 07879d01fe68..ffa0d4c6e450 100644
--- a/Documentation/admin-guide/reporting-issues.rst
+++ b/Documentation/admin-guide/reporting-issues.rst
@@ -1000,8 +1000,7 @@ In the whole process keep in mind: an issue only 
qualifies as regression if the
 older and the newer kernel got built with a similar configuration. The best way
 to archive this: copy the configuration file (``.config``) from the old working
 kernel freshly to each newer kernel version you try. Afterwards run ``make
-oldnoconfig`` to adjust it for the needs of the new version without enabling
-any new feature, as those are allowed to cause regressions.
+olddefconfig`` to adjust it for the needs of the new version.
 
 
 Write and send the report
-- 
2.31.1



[PATCH] checkpatch: Use python3 by default with spdxcheck.py

2021-03-28 Thread Ismael Luceno
Allow to override this via the PYTHON environment variable.

Some systems still provide Python 2.x under the python name for
compatibility reasons; plus the spdxcheck.py script already specifies
python3 as it's interpreter.

Signed-off-by: Ismael Luceno 
---
 scripts/checkpatch.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index df8b23dc1eb0..3f7516e262b3 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -68,6 +68,7 @@ my $allow_c99_comments = 1; # Can be overridden by --ignore 
C99_COMMENT_TOLERANC
 my $git_command ='export LANGUAGE=en_US.UTF-8; git';
 my $tabsize = 8;
 my ${CONFIG_} = "CONFIG_";
+my $python = $ENV{'PYTHON'} || 'python3';
 
 sub help {
my ($exitcode) = @_;
@@ -1000,10 +1001,10 @@ sub is_maintained_obsolete {
 sub is_SPDX_License_valid {
my ($license) = @_;
 
-   return 1 if (!$tree || which("python") eq "" || !(-e 
"$root/scripts/spdxcheck.py") || !(-e "$gitroot"));
+   return 1 if (!$tree || which($python) eq "" || !(-e 
"$root/scripts/spdxcheck.py") || !(-e "$gitroot"));
 
my $root_path = abs_path($root);
-   my $status = `cd "$root_path"; echo "$license" | python 
scripts/spdxcheck.py -`;
+   my $status = `cd "$root_path"; echo "$license" | "$python" 
scripts/spdxcheck.py -`;
return 0 if ($status ne "");
return 1;
 }
-- 
2.31.0



Re: [PATCH] media: solo6x10: switch from 'pci_' to 'dma_' API

2020-11-28 Thread Ismael Luceno
_head(&solo_dev->ring_thread_wait);
>  
>   solo_dev->vh_size = sizeof(vop_header);
> - solo_dev->vh_buf = pci_alloc_consistent(solo_dev->pdev,
> - solo_dev->vh_size,
> - &solo_dev->vh_dma);
> + solo_dev->vh_buf = dma_alloc_coherent(&solo_dev->pdev->dev,
> +           solo_dev->vh_size,
> +   &solo_dev->vh_dma, GFP_KERNEL);
>   if (solo_dev->vh_buf == NULL)
>   return -ENOMEM;
>  
> @@ -1363,8 +1364,8 @@ int solo_enc_v4l2_init(struct solo_dev *solo_dev, 
> unsigned nr)
>  
>   while (i--)
>   solo_enc_free(solo_dev->v4l2_enc[i]);
> - pci_free_consistent(solo_dev->pdev, solo_dev->vh_size,
> - solo_dev->vh_buf, solo_dev->vh_dma);
> + dma_free_coherent(&solo_dev->pdev->dev, solo_dev->vh_size,
> +   solo_dev->vh_buf, solo_dev->vh_dma);
>   solo_dev->vh_buf = NULL;
>   return ret;
>   }
> @@ -1391,6 +1392,6 @@ void solo_enc_v4l2_exit(struct solo_dev *solo_dev)
>   solo_enc_free(solo_dev->v4l2_enc[i]);
>  
>   if (solo_dev->vh_buf)
> - pci_free_consistent(solo_dev->pdev, solo_dev->vh_size,
> - solo_dev->vh_buf, solo_dev->vh_dma);
> + dma_free_coherent(&solo_dev->pdev->dev, solo_dev->vh_size,
> +   solo_dev->vh_buf, solo_dev->vh_dma);
>  }
> -- 
> 2.27.0
> 

Signed-off-by: Ismael Luceno 


Re: [PATCH] media: solo6x10: fix missing snd_card_free in error handling case

2020-11-11 Thread Ismael Luceno
On 11/Nov/2020 11:22, Qinglang Miao wrote:
> Fix to goto snd_error in error handling case when fails
> to do snd_ctl_add, as done elsewhere in this function.
> 
> Fixes: 28cae868cd24 ("[media] solo6x10: move out of staging into 
> drivers/media/pci.")
> Reported-by: Hulk Robot 
> Signed-off-by: Qinglang Miao 
> ---
>  drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c 
> b/drivers/media/pci/solo6x10/solo6x10-g723.c
> index 906ce86437ae..d137b94869d8 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> @@ -385,7 +385,7 @@ int solo_g723_init(struct solo_dev *solo_dev)
>  
>   ret = snd_ctl_add(card, snd_ctl_new1(&kctl, solo_dev));
>   if (ret < 0)
> - return ret;
> + goto snd_error;
>  
>   ret = solo_snd_pcm_init(solo_dev);
>   if (ret < 0)
> -- 
> 2.23.0
> 

Signed-off-by: Ismael Luceno 


Re: [PATCH] Replace HTTP links with HTTPS ones: SOFTLOGIC 6x10 MPEG CODEC

2020-07-08 Thread Ismael Luceno
/media/pci/solo6x10/solo6x10-v4l2-enc.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-or-later
>  /*
> - * Copyright (C) 2010-2013 Bluecherry, LLC <http://www.bluecherrydvr.com>
> + * Copyright (C) 2010-2013 Bluecherry, LLC <https://www.bluecherrydvr.com>
>   *
>   * Original author:
>   * Ben Collins 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2.c 
> b/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> index 54434f3c428d..24ef0c446bef 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-or-later
>  /*
> - * Copyright (C) 2010-2013 Bluecherry, LLC <http://www.bluecherrydvr.com>
> + * Copyright (C) 2010-2013 Bluecherry, LLC <https://www.bluecherrydvr.com>
>   *
>   * Original author:
>   * Ben Collins 
> diff --git a/drivers/media/pci/solo6x10/solo6x10.h 
> b/drivers/media/pci/solo6x10/solo6x10.h
> index 9f2314688cec..126f6fb7b755 100644
> --- a/drivers/media/pci/solo6x10/solo6x10.h
> +++ b/drivers/media/pci/solo6x10/solo6x10.h
> @@ -1,6 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0-or-later */
>  /*
> - * Copyright (C) 2010-2013 Bluecherry, LLC <http://www.bluecherrydvr.com>
> + * Copyright (C) 2010-2013 Bluecherry, LLC <https://www.bluecherrydvr.com>
>   *
>   * Original author:
>   * Ben Collins 
> -- 
> 2.27.0
> 

Signed-off-by: Ismael Luceno 


Re: [PATCH 3/8] [media] solo6x10: use ktime_get_ts64() for time sync

2017-11-27 Thread Ismael Luceno
On 27/Nov/2017 14:19, Arnd Bergmann wrote:
> solo6x10 correctly deals with time stamps and will never
> suffer from overflows, but it uses the deprecated 'struct timespec'
> type and 'ktime_get_ts()' interface to read the monotonic clock.
> 
> This changes it to use ktime_get_ts64() instead, so we can
> eventually remove ktime_get_ts().
> 
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/media/pci/solo6x10/solo6x10-core.c | 17 +
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-core.c 
> b/drivers/media/pci/solo6x10/solo6x10-core.c
> index ca0873e47bea..19ffd2ed3cc7 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-core.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-core.c
> @@ -47,18 +47,19 @@ MODULE_PARM_DESC(full_eeprom, "Allow access to full 128B 
> EEPROM (dangerous)");
>  
>  static void solo_set_time(struct solo_dev *solo_dev)
>  {
> - struct timespec ts;
> + struct timespec64 ts;
>  
> - ktime_get_ts(&ts);
> + ktime_get_ts64(&ts);
>  
> - solo_reg_write(solo_dev, SOLO_TIMER_SEC, ts.tv_sec);
> - solo_reg_write(solo_dev, SOLO_TIMER_USEC, ts.tv_nsec / NSEC_PER_USEC);
> + /* no overflow because we use monotonic timestamps */
> + solo_reg_write(solo_dev, SOLO_TIMER_SEC, (u32)ts.tv_sec);
> + solo_reg_write(solo_dev, SOLO_TIMER_USEC, (u32)ts.tv_nsec / 
> NSEC_PER_USEC);
>  }
>  
>  static void solo_timer_sync(struct solo_dev *solo_dev)
>  {
>   u32 sec, usec;
> - struct timespec ts;
> + struct timespec64 ts;
>   long diff;
>  
>   if (solo_dev->type != SOLO_DEV_6110)
> @@ -72,11 +73,11 @@ static void solo_timer_sync(struct solo_dev *solo_dev)
>   sec = solo_reg_read(solo_dev, SOLO_TIMER_SEC);
>   usec = solo_reg_read(solo_dev, SOLO_TIMER_USEC);
>  
> - ktime_get_ts(&ts);
> + ktime_get_ts64(&ts);
>  
> - diff = (long)ts.tv_sec - (long)sec;
> + diff = (s32)ts.tv_sec - (s32)sec;
>   diff = (diff * 100)
> - + ((long)(ts.tv_nsec / NSEC_PER_USEC) - (long)usec);
> + + ((s32)(ts.tv_nsec / NSEC_PER_USEC) - (s32)usec);
>  
>   if (diff > 1000 || diff < -1000) {
>   solo_set_time(solo_dev);
> -- 
> 2.9.0
> 

Signed-off-by: Ismael Luceno 


signature.asc
Description: PGP signature


Re: [PATCH] [media] solo6x10: hide unused variable

2017-09-15 Thread Ismael Luceno
On 15/Sep/2017 21:52, Arnd Bergmann wrote:
> When building without CONFIG_GPIOLIB, we get a harmless
> warning about an unused variable:
> 
> drivers/media/pci/solo6x10/solo6x10-gpio.c: In function 'solo_gpio_init':
> drivers/media/pci/solo6x10/solo6x10-gpio.c:165:6: error: unused variable 
> 'ret' [-Werror=unused-variable]
> 
> This adds another #ifdef around the declaration.
> 
> Fixes: d3202d1981dc ("media: solo6x10: export hardware GPIO pins 8:31 to 
> gpiolib interface")
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/media/pci/solo6x10/solo6x10-gpio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-gpio.c 
> b/drivers/media/pci/solo6x10/solo6x10-gpio.c
> index 3d0d1aa2f6a8..7b4641a2cb84 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-gpio.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-gpio.c
> @@ -162,7 +162,9 @@ static void solo_gpiochip_set(struct gpio_chip *chip,
>  
>  int solo_gpio_init(struct solo_dev *solo_dev)
>  {
> +#ifdef CONFIG_GPIOLIB
>   int ret;
> +#endif
>  
>   solo_gpio_config(solo_dev);
>  #ifdef CONFIG_GPIOLIB
> -- 
> 2.9.0
> 

Signed-off-by: Ismael Luceno 


Re: [PATCH v2] [media] pci: make video_device const

2017-08-28 Thread Ismael Luceno
On 26/Aug/2017 18:38, Bhumika Goyal wrote:
> Make these const as they are either used during a copy operation or
> passed to a const argument of the function cx88_vdev_init.
> 
> Signed-off-by: Bhumika Goyal 
> ---
> * Combine the patch series sent for drivers/media/pci/ into a
> single patch.
> 
>  drivers/media/pci/cx88/cx88-blackbird.c | 2 +-
>  drivers/media/pci/dt3155/dt3155.c   | 2 +-
>  drivers/media/pci/meye/meye.c   | 2 +-
>  drivers/media/pci/saa7134/saa7134-empress.c | 2 +-
>  drivers/media/pci/solo6x10/solo6x10-v4l2.c  | 2 +-
>  drivers/media/pci/sta2x11/sta2x11_vip.c | 2 +-
>  drivers/media/pci/tw68/tw68-video.c | 2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/pci/cx88/cx88-blackbird.c 
> b/drivers/media/pci/cx88/cx88-blackbird.c
> index aa49c95..e3101f0 100644
> --- a/drivers/media/pci/cx88/cx88-blackbird.c
> +++ b/drivers/media/pci/cx88/cx88-blackbird.c
> @@ -1075,7 +1075,7 @@ static int vidioc_s_std(struct file *file, void *priv, 
> v4l2_std_id id)
>   .vidioc_unsubscribe_event= v4l2_event_unsubscribe,
>  };
>  
> -static struct video_device cx8802_mpeg_template = {
> +static const struct video_device cx8802_mpeg_template = {
>   .name = "cx8802",
>   .fops = &mpeg_fops,
>   .ioctl_ops= &mpeg_ioctl_ops,
> diff --git a/drivers/media/pci/dt3155/dt3155.c 
> b/drivers/media/pci/dt3155/dt3155.c
> index 6a21969..1775c36 100644
> --- a/drivers/media/pci/dt3155/dt3155.c
> +++ b/drivers/media/pci/dt3155/dt3155.c
> @@ -499,7 +499,7 @@ static int dt3155_init_board(struct dt3155_priv *pd)
>   return 0;
>  }
>  
> -static struct video_device dt3155_vdev = {
> +static const struct video_device dt3155_vdev = {
>   .name = DT3155_NAME,
>   .fops = &dt3155_fops,
>   .ioctl_ops = &dt3155_ioctl_ops,
> diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
> index 0fe76be..49e047e 100644
> --- a/drivers/media/pci/meye/meye.c
> +++ b/drivers/media/pci/meye/meye.c
> @@ -1533,7 +1533,7 @@ static int meye_mmap(struct file *file, struct 
> vm_area_struct *vma)
>   .vidioc_default = vidioc_default,
>  };
>  
> -static struct video_device meye_template = {
> +static const struct video_device meye_template = {
>   .name   = "meye",
>   .fops   = &meye_fops,
>   .ioctl_ops  = &meye_ioctl_ops,
> diff --git a/drivers/media/pci/saa7134/saa7134-empress.c 
> b/drivers/media/pci/saa7134/saa7134-empress.c
> index b1d3648..66acfd3 100644
> --- a/drivers/media/pci/saa7134/saa7134-empress.c
> +++ b/drivers/media/pci/saa7134/saa7134-empress.c
> @@ -205,7 +205,7 @@ static int empress_try_fmt_vid_cap(struct file *file, 
> void *priv,
>  
>  /* --- */
>  
> -static struct video_device saa7134_empress_template = {
> +static const struct video_device saa7134_empress_template = {
>   .name  = "saa7134-empress",
>   .fops  = &ts_fops,
>   .ioctl_ops = &ts_ioctl_ops,
> diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2.c 
> b/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> index 3266fc2..99ffd1e 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> @@ -630,7 +630,7 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl)
>   .vidioc_unsubscribe_event   = v4l2_event_unsubscribe,
>  };
>  
> -static struct video_device solo_v4l2_template = {
> +static const struct video_device solo_v4l2_template = {
>   .name   = SOLO6X10_NAME,
>   .fops   = &solo_v4l2_fops,
>   .ioctl_ops  = &solo_v4l2_ioctl_ops,
> diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c 
> b/drivers/media/pci/sta2x11/sta2x11_vip.c
> index 6343d24..eb5a9ea 100644
> --- a/drivers/media/pci/sta2x11/sta2x11_vip.c
> +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
> @@ -754,7 +754,7 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void 
> *priv,
>   .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
>  };
>  
> -static struct video_device video_dev_template = {
> +static const struct video_device video_dev_template = {
>   .name = KBUILD_MODNAME,
>   .release = video_device_release_empty,
>   .fops = &vip_fops,
> diff --git a/drivers/media/pci/tw68/tw68-video.c 
> b/drivers/media/pci/tw68/tw68-video.c
> index 58c4dd7..8c1f4a0 100644
> --- a/drivers/media/pci/tw68/tw68-video.c
> +++ b/drivers/media/pci/tw68/tw68-video.c
> @@ -916,7 +916,7 @@ static int vidioc_s_register(struct file *file, void 
> *priv,
>  #endif
>  };
>  
> -static struct video_device tw68_video_template = {
> +static const struct video_device tw68_video_template = {
>   .name   = "tw68_video",
>   .fops   = &video_fops,
>   .ioctl_ops  = &video_ioctl_ops,
> -- 
> 1.9.1

Signed-off-by: Ismael Luceno 



Re: [PATCH 3/5] [media] solo6x10: make video_device const

2017-08-28 Thread Ismael Luceno
On 26/Aug/2017 16:43, Bhumika Goyal wrote:
> Make this const as it is only used in a copy operation.
> 
> Signed-off-by: Bhumika Goyal 
> ---
>  drivers/media/pci/solo6x10/solo6x10-v4l2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2.c 
> b/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> index 3266fc2..99ffd1e 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> @@ -630,7 +630,7 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl)
>   .vidioc_unsubscribe_event   = v4l2_event_unsubscribe,
>  };
>  
> -static struct video_device solo_v4l2_template = {
> +static const struct video_device solo_v4l2_template = {
>   .name   = SOLO6X10_NAME,
>   .fops   = &solo_v4l2_fops,
>   .ioctl_ops      = &solo_v4l2_ioctl_ops,
> -- 
> 1.9.1
> 

Signed-off-by: Ismael Luceno 


Re: [PATCH 2/2] [media] solo6x10: make snd_kcontrol_new const

2017-08-21 Thread Ismael Luceno
On 16/Aug/2017 14:47, Bhumika Goyal wrote:
> Make this const as it is only used during a copy operation.
> Done using Coccinelle.
> 
> Signed-off-by: Bhumika Goyal 
> ---
>  drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c 
> b/drivers/media/pci/solo6x10/solo6x10-g723.c
> index 3ca9470..81be1b8 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> @@ -319,7 +319,7 @@ static int snd_solo_capture_volume_put(struct 
> snd_kcontrol *kcontrol,
>   return 1;
>  }
>  
> -static struct snd_kcontrol_new snd_solo_capture_volume = {
> +static const struct snd_kcontrol_new snd_solo_capture_volume = {
>   .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
>   .name = "Capture Volume",
>   .info = snd_solo_capture_volume_info,
> -- 
> 1.9.1
> 

Signed-off-by: Ismael Luceno 


signature.asc
Description: PGP signature


Re: [PATCH] [media] solo6x10: export hardware GPIO pins 8:31 to gpiolib interface

2017-08-02 Thread Ismael Luceno
PIOLIB
> + if (solo_dev->gpio_dev.label) {
> + gpiochip_remove(&solo_dev->gpio_dev);
> + solo_dev->gpio_dev.label = NULL;
> + }
> +#endif
>   solo_gpio_clear(solo_dev, 0x30);
>   solo_gpio_config(solo_dev);
>  }
> diff --git a/drivers/media/pci/solo6x10/solo6x10.h 
> b/drivers/media/pci/solo6x10/solo6x10.h
> index 3f8da5e8c430..3a1893ae2dad 100644
> --- a/drivers/media/pci/solo6x10/solo6x10.h
> +++ b/drivers/media/pci/solo6x10/solo6x10.h
> @@ -31,6 +31,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> @@ -199,6 +200,10 @@ struct solo_dev {
>   u32 irq_mask;
>   u32 motion_mask;
>   struct v4l2_device  v4l2_dev;
> +#ifdef CONFIG_GPIOLIB
> + /* GPIO */
> + struct gpio_chipgpio_dev;
> +#endif
>  
>   /* tw28xx accounting */
>   u8  tw2865, tw2864, tw2815;
> -- 
> 2.13.0
> 

Signed-off-by: Ismael Luceno 


Re: [PATCH] [media] solo6x10: make const array saa7128_regs_ntsc static

2017-07-11 Thread Ismael Luceno
On 10/Jul/2017 19:51, Colin King wrote:
> From: Colin Ian King 
> 
> Don't populate const array saa7128_regs_ntsc on the stack but insteaed make
> it static.  Makes the object code smaller and saves nearly 840 bytes
> 
> Before:
>text  data bss dec hex filename
>9218   360   09578256a solo6x10-tw28.o
> 
> After:
>text  data bss dec hex filename
>8237   504   087412225 solo6x10-tw28.o
> 
> Signed-off-by: Colin Ian King 
> ---
>  drivers/media/pci/solo6x10/solo6x10-tw28.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-tw28.c 
> b/drivers/media/pci/solo6x10/solo6x10-tw28.c
> index 0632d3f7c73c..1c013a03d851 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-tw28.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-tw28.c
> @@ -532,7 +532,7 @@ static void saa712x_write_regs(struct solo_dev *dev, 
> const u8 *vals,
>  static void saa712x_setup(struct solo_dev *dev)
>  {
>   const int reg_start = 0x26;
> - const u8 saa7128_regs_ntsc[] = {
> + static const u8 saa7128_regs_ntsc[] = {
>   /* :0x26 */
>   0x0d, 0x00,
>   /* :0x28 */

Signed-off-by: Ismael Luceno 


Re: [PATCH] [media] solo6x10: release vb2 buffers in solo_stop_streaming()

2017-03-09 Thread Ismael Luceno
On 08/Mar/2017 21:59, Andrey Utkin wrote:
> Signed-off-by: Andrey Utkin 
> Signed-off-by: Andrey Utkin 
> 
> Please welcome Anton who is now in charge of solo6x10 and tw5864 support
> and development in Bluecherry company, I have sent out to him the
> hardware samples I possessed. (We will prepare the patch updating
> MAINTAINERS file soon.)
> 
> If anybody has any outstanding complains, concerns or tasks regarding
> solo6x10 and tw5864 drivers, I think now is good occasion to let us know
> about it.

Welcome Anton!

The first issue that comes to mind is that quantization matrices
need to be adjusted since forever. Also it needs more realistic
buffer sizes.


Re: [PATCH v2] [media] solo6x10: release vb2 buffers in solo_stop_streaming()

2017-03-09 Thread Ismael Luceno

On 09/Mar/2017 17:46, Anton Sviridenko wrote:
> v2: removed var dbg_buf_cnt, left-over from debugging
> 
> Fixes warning that appears in dmesg after closing V4L2 userspace
> application that plays video from the display device
> (first device from V4L2 device nodes provided by solo, usually /dev/video0
> when no other V4L2 devices are present). Encoder device nodes are not
> affected. Can be reproduced by starting and closing
> 
> ffplay -f video4linux2  /dev/video0
> 
> [ 8130.281251] [ cut here ]
> [ 8130.281256] WARNING: CPU: 1 PID: 20414 at 
> drivers/media/v4l2-core/videobuf2-core.c:1651 __vb2_queue_cancel+0x14b/0x230
> [ 8130.281257] Modules linked in: ipt_MASQUERADE nf_nat_masquerade_ipv4 
> iptable_nat solo6x10 x86_pkg_temp_thermal vboxpci(O) vboxnetadp(O) 
> vboxnetflt(O) vboxdrv(O)
> [ 8130.281264] CPU: 1 PID: 20414 Comm: ffplay Tainted: G   O
> 4.10.0-gentoo #1
> [ 8130.281264] Hardware name: ASUS All Series/B85M-E, BIOS 2301 03/30/2015
> [ 8130.281265] Call Trace:
> [ 8130.281267]  dump_stack+0x4f/0x72
> [ 8130.281270]  __warn+0xc7/0xf0
> [ 8130.281271]  warn_slowpath_null+0x18/0x20
> [ 8130.281272]  __vb2_queue_cancel+0x14b/0x230
> [ 8130.281273]  vb2_core_streamoff+0x23/0x90
> [ 8130.281275]  vb2_streamoff+0x24/0x50
> [ 8130.281276]  vb2_ioctl_streamoff+0x3d/0x50
> [ 8130.281278]  v4l_streamoff+0x15/0x20
> [ 8130.281279]  __video_do_ioctl+0x25e/0x2f0
> [ 8130.281280]  video_usercopy+0x279/0x520
> [ 8130.281282]  ? v4l_enum_fmt+0x1330/0x1330
> [ 8130.281285]  ? unmap_region+0xdf/0x110
> [ 8130.281285]  video_ioctl2+0x10/0x20
> [ 8130.281286]  v4l2_ioctl+0xce/0xe0
> [ 8130.281289]  do_vfs_ioctl+0x8b/0x5b0
> [ 8130.281290]  ? __fget+0x72/0xa0
> [ 8130.281291]  SyS_ioctl+0x74/0x80
> [ 8130.281294]  entry_SYSCALL_64_fastpath+0x13/0x94
> [ 8130.281295] RIP: 0033:0x7ff86fee6b27
> [ 8130.281296] RSP: 002b:7ffe467f6a08 EFLAGS: 0246 ORIG_RAX: 
> 0010
> [ 8130.281297] RAX: ffda RBX: d1a4d788 RCX: 
> 7ff86fee6b27
> [ 8130.281297] RDX: 7ffe467f6a14 RSI: 40045613 RDI: 
> 0006
> [ 8130.281298] RBP: 0373f8d0 R08:  R09: 
> 7ff860001140
> [ 8130.281298] R10: 0243 R11: 0246 R12: 
> 
> [ 8130.281299] R13: 00a0 R14: 7ffe467f6530 R15: 
> 01f32228
> [ 8130.281300] ---[ end trace 00695dc96be646e7 ]---
> 
> Signed-off-by: Anton Sviridenko 
> ---
>  drivers/media/pci/solo6x10/solo6x10-v4l2.c | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2.c 
> b/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> index 896bec6..3266fc2 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2.c
> @@ -341,6 +341,17 @@ static void solo_stop_streaming(struct vb2_queue *q)
>   struct solo_dev *solo_dev = vb2_get_drv_priv(q);
>  
>   solo_stop_thread(solo_dev);
> +
> + spin_lock(&solo_dev->slock);
> + while (!list_empty(&solo_dev->vidq_active)) {
> + struct solo_vb2_buf *buf = list_entry(
> + solo_dev->vidq_active.next,
> + struct solo_vb2_buf, list);
> +
> + list_del(&buf->list);
> + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
> + }
> + spin_unlock(&solo_dev->slock);
>   INIT_LIST_HEAD(&solo_dev->vidq_active);
>  }
>  

Signed-off-by: Ismael Luceno 

Please move the patch changelog out of the commit message!


signature.asc
Description: PGP signature


Re: [PATCH 0505/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Ismael Luceno
On 02/Ago/2016 19:18, Baole Ni wrote:
> I find that the developers often just specified the numeric value
> when calling a macro which is defined with a parameter for access permission.
> As we know, these numeric value for access permission have had the 
> corresponding macro,
> and that using macro can improve the robustness and readability of the code,
> thus, I suggest replacing the numeric parameter with the macro.

That's very subjective; I don't agree.

IMO numbers are better in this context.


Re: [Intel-gfx] [PATCH] drm/i915: Fix screen flickering on X

2015-05-08 Thread Ismael Luceno
On Fri, 8 May 2015 12:10:15 -0300
Ismael Luceno  wrote:
> On Thu, 07 May 2015 16:41:48 +0300
> Jani Nikula  wrote:
> > On Thu, 07 May 2015, Matt Roper  wrote:
> > > On Thu, May 07, 2015 at 12:12:18PM +0300, Jani Nikula wrote:
> > >> On Thu, 23 Apr 2015, Chris Wilson 
> > >> wrote:
> > >> > [cc'ing the authors]
> > >> 
> > >> This has been posted earlier [1] and it has review to be
> > >> addressed [2].
> > >> 
> > >> BR,
> > >> Jani.
> > >
> > > I agree with Ander's response in [2]...we can't call
> > > intel_update_watermarks() in the commit function because we're
> > > under vblank evasion.  We should already be flagging the
> > > transaction as needing a watermark update in
> > > intel_check_cursor_plane(), and that flag will be acted upon
> > > immediately after the commit functions are done running, once
> > > we've re-enabled interrupts.
> > >
> > > Note that our current codebase looks a bit different since we've
> > > dropped intel_crtc->cursor_{width,height}.  So the relevant check
> > > in intel_check_cursor_plane() now looks like:
> > >
> > > if (plane->state->crtc_w != state->base.crtc_w)
> > > intel_crtc->atomic.update_wm = true;
> > >
> > > Is there a bugzilla open on this issue with more details?
> > 
> > Not that I know of. Ismael?
> 
> Didn't found one at the time.
> 
> I apologize for the lack of communication, have been too busy job
> hunting these weeks.
> 
> Chris comments prompted me to double-check. It seems one of Matt's
> commits solves the issue [0], it just didn't hit mainline until April
> 20 [1], long after v4.0.
> 
> [0] 3dd512fbda0d87d1c3fb44bf878b262baee98fb6 
> [1] 14aa02449064541217836b9f3d3295e241d5ae9c

Sorry, meant Matt's comment about the current codebase; my brain seems
not to be working well today.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Intel-gfx] [PATCH] drm/i915: Fix screen flickering on X

2015-05-08 Thread Ismael Luceno
On Thu, 07 May 2015 16:41:48 +0300
Jani Nikula  wrote:
> On Thu, 07 May 2015, Matt Roper  wrote:
> > On Thu, May 07, 2015 at 12:12:18PM +0300, Jani Nikula wrote:
> >> On Thu, 23 Apr 2015, Chris Wilson  wrote:
> >> > [cc'ing the authors]
> >> 
> >> This has been posted earlier [1] and it has review to be addressed
> >> [2].
> >> 
> >> BR,
> >> Jani.
> >
> > I agree with Ander's response in [2]...we can't call
> > intel_update_watermarks() in the commit function because we're under
> > vblank evasion.  We should already be flagging the transaction as
> > needing a watermark update in intel_check_cursor_plane(), and that
> > flag will be acted upon immediately after the commit functions are
> > done running, once we've re-enabled interrupts.
> >
> > Note that our current codebase looks a bit different since we've
> > dropped intel_crtc->cursor_{width,height}.  So the relevant check in
> > intel_check_cursor_plane() now looks like:
> >
> > if (plane->state->crtc_w != state->base.crtc_w)
> > intel_crtc->atomic.update_wm = true;
> >
> > Is there a bugzilla open on this issue with more details?
> 
> Not that I know of. Ismael?

Didn't found one at the time.

I apologize for the lack of communication, have been too busy job
hunting these weeks.

Chris comments prompted me to double-check. It seems one of Matt's
commits solves the issue [0], it just didn't hit mainline until April
20 [1], long after v4.0.

[0] 3dd512fbda0d87d1c3fb44bf878b262baee98fb6 
[1] 14aa02449064541217836b9f3d3295e241d5ae9c
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Intel-gfx] [PATCH] drm/i915: Fix screen flickering on X

2015-05-07 Thread Ismael Luceno
On Thu, 7 May 2015 15:18:27 +0100
Chris Wilson  wrote:
> On Thu, May 07, 2015 at 04:41:48PM +0300, Jani Nikula wrote:
> > On Thu, 07 May 2015, Matt Roper  wrote:
> > > On Thu, May 07, 2015 at 12:12:18PM +0300, Jani Nikula wrote:
> > >> On Thu, 23 Apr 2015, Chris Wilson 
> > >> wrote:
> > >> > [cc'ing the authors]
> > >> 
> > >> This has been posted earlier [1] and it has review to be
> > >> addressed [2].
> > >> 
> > >> BR,
> > >> Jani.
> > >
> > > I agree with Ander's response in [2]...we can't call
> > > intel_update_watermarks() in the commit function because we're
> > > under vblank evasion.  We should already be flagging the
> > > transaction as needing a watermark update in
> > > intel_check_cursor_plane(), and that flag will be acted upon
> > > immediately after the commit functions are done running, once
> > > we've re-enabled interrupts.
> > >
> > > Note that our current codebase looks a bit different since we've
> > > dropped intel_crtc->cursor_{width,height}.  So the relevant check
> > > in intel_check_cursor_plane() now looks like:
> > >
> > > if (plane->state->crtc_w != state->base.crtc_w)
> > > intel_crtc->atomic.update_wm = true;
> > >
> > > Is there a bugzilla open on this issue with more details?
> > 
> > Not that I know of. Ismael?
> > 
> 
> Probably:
> https://bugs.freedesktop.org/show_bug.cgi?id=88944
> https://bugzilla.redhat.com/show_bug.cgi?id=1199890
> are related.
> -Chris
> 

I am experiencing neither of those things.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drm/i915: Fix screen flickering on X

2015-04-11 Thread Ismael Luceno
A bisect showed that commit 32b7eeec4d1e861230b09d437e95d76c86ff4a68
introduced the issue.

The issue starts as soon as X takes control of the screen, even if just
a plain X doing nothing, so based on the code touched by the commit I
thought it had to be related to the so called "hardware cursor". I
confirmed it when hiding the cursor made the flickering go away.

The aforementioned commit removed some suspicious code, and the
Programmer's Reference Manual confirmed my suspicion:

"Incorrectly programmed watermark values can result in screen corruption.

The watermarks should be calculated and programmed when any of the
watermark calculation inputs change. This includes planes enabling or
disabling, plane source format or size changing, etc."

So I'm re-adding the few lines that update the watermarks after a cursor
size change.

Signed-off-by: Ismael Luceno 
---
 drivers/gpu/drm/i915/intel_display.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index f75173c..e23f062 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12258,6 +12258,7 @@ intel_commit_cursor_plane(struct drm_plane *plane,
struct intel_crtc *intel_crtc;
struct intel_plane *intel_plane = to_intel_plane(plane);
struct drm_i915_gem_object *obj = intel_fb_obj(state->base.fb);
+   unsigned old_width;
uint32_t addr;
 
crtc = crtc ? crtc : plane->crtc;
@@ -12282,11 +12283,15 @@ intel_commit_cursor_plane(struct drm_plane *plane,
intel_crtc->cursor_addr = addr;
intel_crtc->cursor_bo = obj;
 update:
+   old_width = intel_crtc->cursor_width;
intel_crtc->cursor_width = state->base.crtc_w;
intel_crtc->cursor_height = state->base.crtc_h;
 
-   if (intel_crtc->active)
+   if (intel_crtc->active) {
+   if (old_width != intel_crtc->cursor_width)
+   intel_update_watermarks(crtc);
intel_crtc_update_cursor(crtc, state->visible);
+   }
 }
 
 static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,
-- 
2.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Update MAINTAINERS for solo6x10

2014-11-26 Thread Ismael Luceno
On Mon, 17 Nov 2014 20:59:23 +0400
Andrey Utkin  wrote:
> Signed-off-by: Andrey Utkin 
> ---
>  MAINTAINERS | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index bb38f02..f5cef1b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -8787,7 +8787,9 @@ S:  Maintained
>  F:   drivers/leds/leds-net48xx.c
>  
>  SOFTLOGIC 6x10 MPEG CODEC
> -M:   Ismael Luceno 
> +M:   Bluecherry Maintainers 
> +M:   Andrey Utkin 
> +M:   Andrey Utkin 
>  L:   linux-me...@vger.kernel.org
>  S:   Supported
>  F:   drivers/media/pci/solo6x10/

Please do not remove me, I'm still here, just a little tight on
the schedule.

Though my corp.bluecherry.net address stopped working again...


pgprxRZ5IDnxP.pgp
Description: OpenPGP digital signature


Re: [PATCH] [media] staging/solo6x10: SOLO6X10 should select BITREVERSE

2014-07-10 Thread Ismael Luceno
On Sun,  6 Jul 2014 10:58:41 +0200
Geert Uytterhoeven  wrote:
> If CONFIG_SOLO6X10=y, but CONFIG_BITREVERSE=m:
> 
> drivers/built-in.o: In function `solo_osd_print':
> (.text+0x1c7a1f): undefined reference to `byte_rev_table'
> make: *** [vmlinux] Error 1
> 
> Reported-by: kbuild test robot 
> Signed-off-by: Geert Uytterhoeven 
> ---
>  drivers/staging/media/solo6x10/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/media/solo6x10/Kconfig
> b/drivers/staging/media/solo6x10/Kconfig index
> 6a1906fa1117..1ce2819efcb4 100644 ---
> a/drivers/staging/media/solo6x10/Kconfig +++
> b/drivers/staging/media/solo6x10/Kconfig @@ -1,6 +1,7 @@
>  config SOLO6X10
>   tristate "Bluecherry / Softlogic 6x10 capture cards
> (MPEG-4/H.264)" depends on PCI && VIDEO_DEV && SND && I2C
> + select BITREVERSE
>   select FONT_SUPPORT
>   select FONT_8x16
>   select VIDEOBUF2_DMA_SG

Signed-off-by: Ismael Luceno 


signature.asc
Description: PGP signature


Re: [PATCH 5/6] staging/media/solo6x10: use module_pci_driver macro

2012-07-17 Thread Ismael Luceno
On Tue, Jul 10, 2012 at 3:45 AM, Devendra Naga  wrote:
> the driver duplicates the module_pci_driver code,
> how?
> module_pci_driver is used for those drivers whose
> init and exit paths does only register and unregister
> to pci API and nothing else.
>
> so use the module_pci_driver macro instead
>
> Signed-off-by: Devendra Naga 
> ---
>  drivers/staging/media/solo6x10/core.c |   13 +
>  1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/staging/media/solo6x10/core.c 
> b/drivers/staging/media/solo6x10/core.c
> index d2fd842..3ee9b12 100644
> --- a/drivers/staging/media/solo6x10/core.c
> +++ b/drivers/staging/media/solo6x10/core.c
> @@ -318,15 +318,4 @@ static struct pci_driver solo_pci_driver = {
> .remove = solo_pci_remove,
>  };
>
> -static int __init solo_module_init(void)
> -{
> -   return pci_register_driver(&solo_pci_driver);
> -}
> -
> -static void __exit solo_module_exit(void)
> -{
> -   pci_unregister_driver(&solo_pci_driver);
> -}
> -
> -module_init(solo_module_init);
> -module_exit(solo_module_exit);
> +module_pci_driver(solo_pci_driver);

Acked-by: Ismael Luceno 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/