Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1299958 > unrolled thread
| Started by | Samuel Thibault <samuel.thibault@ens-lyon.org> |
|---|---|
| First post | 2016-01-01 18:30 +0100 |
| Last post | 2016-01-01 23:00 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] Staging: speakup: read scrolled-back VT Samuel Thibault <samuel.thibault@ens-lyon.org> - 2016-01-01 18:30 +0100
Re: [PATCH] Staging: speakup: read scrolled-back VT One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-01 18:40 +0100
Re: [PATCH] Staging: speakup: read scrolled-back VT covici@ccs.covici.com - 2016-01-01 23:00 +0100
| From | Samuel Thibault <samuel.thibault@ens-lyon.org> |
|---|---|
| Date | 2016-01-01 18:30 +0100 |
| Subject | [PATCH] Staging: speakup: read scrolled-back VT |
| Message-ID | <qMbGz-5lD-43@gated-at.bofh.it> |
Previously, speakup would always read the bottom part of the screen,
even when the VT is scrolled back with shift-page. This patch makes
vt.c export screen_pos so that speakup can use it to properly access
the content of the scrolled-back VT.
This was tested with both vgacon and fbcon.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -4250,6 +4250,7 @@ unsigned short *screen_pos(struct vc_dat
{
return screenpos(vc, 2 * w_offset, viewed);
}
+EXPORT_SYMBOL_GPL(screen_pos);
void getconsxy(struct vc_data *vc, unsigned char *p)
{
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -264,8 +264,9 @@ static struct notifier_block vt_notifier
.notifier_call = vt_notifier_call,
};
-static unsigned char get_attributes(u16 *pos)
+static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
{
+ pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, 1);
return (u_char) (scr_readw(pos) >> 8);
}
@@ -275,7 +276,7 @@ static void speakup_date(struct vc_data
spk_y = spk_cy = vc->vc_y;
spk_pos = spk_cp = vc->vc_pos;
spk_old_attr = spk_attr;
- spk_attr = get_attributes((u_short *) spk_pos);
+ spk_attr = get_attributes(vc, (u_short *)spk_pos);
}
static void bleep(u_short val)
@@ -469,8 +470,12 @@ static u16 get_char(struct vc_data *vc,
u16 ch = ' ';
if (vc && pos) {
- u16 w = scr_readw(pos);
- u16 c = w & 0xff;
+ u16 w;
+ u16 c;
+
+ pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, 1);
+ w = scr_readw(pos);
+ c = w & 0xff;
if (w & vc->vc_hi_font_mask)
c |= 0x100;
@@ -746,7 +751,7 @@ static int get_line(struct vc_data *vc)
u_char tmp2;
spk_old_attr = spk_attr;
- spk_attr = get_attributes((u_short *) spk_pos);
+ spk_attr = get_attributes(vc, (u_short *)spk_pos);
for (i = 0; i < vc->vc_cols; i++) {
buf[i] = (u_char) get_char(vc, (u_short *) tmp, &tmp2);
tmp += 2;
@@ -811,7 +816,7 @@ static int say_from_to(struct vc_data *v
u_short saved_punc_mask = spk_punc_mask;
spk_old_attr = spk_attr;
- spk_attr = get_attributes((u_short *) from);
+ spk_attr = get_attributes(vc, (u_short *)from);
while (from < to) {
buf[i++] = (char)get_char(vc, (u_short *) from, &tmp);
from += 2;
@@ -886,7 +891,7 @@ static int get_sentence_buf(struct vc_da
sentmarks[bn][0] = &sentbuf[bn][0];
i = 0;
spk_old_attr = spk_attr;
- spk_attr = get_attributes((u_short *) start);
+ spk_attr = get_attributes(vc, (u_short *)start);
while (start < end) {
sentbuf[bn][i] = (char)get_char(vc, (u_short *) start, &tmp);
@@ -1585,7 +1590,7 @@ static int count_highlight_color(struct
u16 *ptr;
for (ptr = start; ptr < end; ptr++) {
- ch = get_attributes(ptr);
+ ch = get_attributes(vc, ptr);
bg = (ch & 0x70) >> 4;
speakup_console[vc_num]->ht.bgcount[bg]++;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> |
|---|---|
| Date | 2016-01-01 18:40 +0100 |
| Message-ID | <qMbQe-5ph-7@gated-at.bofh.it> |
| In reply to | #1299958 |
On Fri, 1 Jan 2016 18:20:39 +0100 Samuel Thibault <samuel.thibault@ens-lyon.org> wrote: > Previously, speakup would always read the bottom part of the screen, > even when the VT is scrolled back with shift-page. This patch makes > vt.c export screen_pos so that speakup can use it to properly access > the content of the scrolled-back VT. > > This was tested with both vgacon and fbcon. > > Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> I know the policy was that we don't put core code hooks in for staging stuff but I hope in this case we do. Reviewed-by: Alan Cox <alan@linux.intel.com> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | covici@ccs.covici.com |
|---|---|
| Date | 2016-01-01 23:00 +0100 |
| Message-ID | <qMfTR-7Sa-17@gated-at.bofh.it> |
| In reply to | #1299958 |
Tested on 4.1.15 and it seems to work fine -- thanks a lot.
Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> Previously, speakup would always read the bottom part of the screen,
> even when the VT is scrolled back with shift-page. This patch makes
> vt.c export screen_pos so that speakup can use it to properly access
> the content of the scrolled-back VT.
>
> This was tested with both vgacon and fbcon.
>
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
>
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -4250,6 +4250,7 @@ unsigned short *screen_pos(struct vc_dat
> {
> return screenpos(vc, 2 * w_offset, viewed);
> }
> +EXPORT_SYMBOL_GPL(screen_pos);
>
> void getconsxy(struct vc_data *vc, unsigned char *p)
> {
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -264,8 +264,9 @@ static struct notifier_block vt_notifier
> .notifier_call = vt_notifier_call,
> };
>
> -static unsigned char get_attributes(u16 *pos)
> +static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
> {
> + pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, 1);
> return (u_char) (scr_readw(pos) >> 8);
> }
>
> @@ -275,7 +276,7 @@ static void speakup_date(struct vc_data
> spk_y = spk_cy = vc->vc_y;
> spk_pos = spk_cp = vc->vc_pos;
> spk_old_attr = spk_attr;
> - spk_attr = get_attributes((u_short *) spk_pos);
> + spk_attr = get_attributes(vc, (u_short *)spk_pos);
> }
>
> static void bleep(u_short val)
> @@ -469,8 +470,12 @@ static u16 get_char(struct vc_data *vc,
> u16 ch = ' ';
>
> if (vc && pos) {
> - u16 w = scr_readw(pos);
> - u16 c = w & 0xff;
> + u16 w;
> + u16 c;
> +
> + pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, 1);
> + w = scr_readw(pos);
> + c = w & 0xff;
>
> if (w & vc->vc_hi_font_mask)
> c |= 0x100;
> @@ -746,7 +751,7 @@ static int get_line(struct vc_data *vc)
> u_char tmp2;
>
> spk_old_attr = spk_attr;
> - spk_attr = get_attributes((u_short *) spk_pos);
> + spk_attr = get_attributes(vc, (u_short *)spk_pos);
> for (i = 0; i < vc->vc_cols; i++) {
> buf[i] = (u_char) get_char(vc, (u_short *) tmp, &tmp2);
> tmp += 2;
> @@ -811,7 +816,7 @@ static int say_from_to(struct vc_data *v
> u_short saved_punc_mask = spk_punc_mask;
>
> spk_old_attr = spk_attr;
> - spk_attr = get_attributes((u_short *) from);
> + spk_attr = get_attributes(vc, (u_short *)from);
> while (from < to) {
> buf[i++] = (char)get_char(vc, (u_short *) from, &tmp);
> from += 2;
> @@ -886,7 +891,7 @@ static int get_sentence_buf(struct vc_da
> sentmarks[bn][0] = &sentbuf[bn][0];
> i = 0;
> spk_old_attr = spk_attr;
> - spk_attr = get_attributes((u_short *) start);
> + spk_attr = get_attributes(vc, (u_short *)start);
>
> while (start < end) {
> sentbuf[bn][i] = (char)get_char(vc, (u_short *) start, &tmp);
> @@ -1585,7 +1590,7 @@ static int count_highlight_color(struct
> u16 *ptr;
>
> for (ptr = start; ptr < end; ptr++) {
> - ch = get_attributes(ptr);
> + ch = get_attributes(vc, ptr);
> bg = (ch & 0x70) >> 4;
> speakup_console[vc_num]->ht.bgcount[bg]++;
> }
> _______________________________________________
> Speakup mailing list
> Speakup@linux-speakup.org
> http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup
>
--
Your life is like a penny. You're going to lose it. The question is:
How do
you spend it?
John Covici
covici@ccs.covici.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web