-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: fb: convert docs to ReST and rename to *.rst
The conversion is actually: - add blank lines and identation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Also, removed the Maintained by, as requested by Geert. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
- Loading branch information
Mauro Carvalho Chehab
authored and
Jonathan Corbet
committed
Jun 14, 2019
1 parent
10ffebb
commit ab42b81
Showing
47 changed files
with
1,952 additions
and
1,665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 30 additions & 27 deletions
57
Documentation/fb/cmap_xfbdev.txt → Documentation/fb/cmap_xfbdev.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,56 @@ | ||
========================== | ||
Understanding fbdev's cmap | ||
-------------------------- | ||
========================== | ||
|
||
These notes explain how X's dix layer uses fbdev's cmap structures. | ||
|
||
*. example of relevant structures in fbdev as used for a 3-bit grayscale cmap | ||
struct fb_var_screeninfo { | ||
.bits_per_pixel = 8, | ||
.grayscale = 1, | ||
.red = { 4, 3, 0 }, | ||
.green = { 0, 0, 0 }, | ||
.blue = { 0, 0, 0 }, | ||
} | ||
struct fb_fix_screeninfo { | ||
.visual = FB_VISUAL_STATIC_PSEUDOCOLOR, | ||
} | ||
for (i = 0; i < 8; i++) | ||
- example of relevant structures in fbdev as used for a 3-bit grayscale cmap:: | ||
|
||
struct fb_var_screeninfo { | ||
.bits_per_pixel = 8, | ||
.grayscale = 1, | ||
.red = { 4, 3, 0 }, | ||
.green = { 0, 0, 0 }, | ||
.blue = { 0, 0, 0 }, | ||
} | ||
struct fb_fix_screeninfo { | ||
.visual = FB_VISUAL_STATIC_PSEUDOCOLOR, | ||
} | ||
for (i = 0; i < 8; i++) | ||
info->cmap.red[i] = (((2*i)+1)*(0xFFFF))/16; | ||
memcpy(info->cmap.green, info->cmap.red, sizeof(u16)*8); | ||
memcpy(info->cmap.blue, info->cmap.red, sizeof(u16)*8); | ||
memcpy(info->cmap.green, info->cmap.red, sizeof(u16)*8); | ||
memcpy(info->cmap.blue, info->cmap.red, sizeof(u16)*8); | ||
|
||
*. X11 apps do something like the following when trying to use grayscale. | ||
for (i=0; i < 8; i++) { | ||
- X11 apps do something like the following when trying to use grayscale:: | ||
|
||
for (i=0; i < 8; i++) { | ||
char colorspec[64]; | ||
memset(colorspec,0,64); | ||
sprintf(colorspec, "rgb:%x/%x/%x", i*36,i*36,i*36); | ||
if (!XParseColor(outputDisplay, testColormap, colorspec, &wantedColor)) | ||
printf("Can't get color %s\n",colorspec); | ||
XAllocColor(outputDisplay, testColormap, &wantedColor); | ||
grays[i] = wantedColor; | ||
} | ||
} | ||
|
||
There's also named equivalents like gray1..x provided you have an rgb.txt. | ||
|
||
Somewhere in X's callchain, this results in a call to X code that handles the | ||
colormap. For example, Xfbdev hits the following: | ||
|
||
xc-011010/programs/Xserver/dix/colormap.c: | ||
xc-011010/programs/Xserver/dix/colormap.c:: | ||
|
||
FindBestPixel(pentFirst, size, prgb, channel) | ||
FindBestPixel(pentFirst, size, prgb, channel) | ||
|
||
dr = (long) pent->co.local.red - prgb->red; | ||
dg = (long) pent->co.local.green - prgb->green; | ||
db = (long) pent->co.local.blue - prgb->blue; | ||
sq = dr * dr; | ||
UnsignedToBigNum (sq, &sum); | ||
BigNumAdd (&sum, &temp, &sum); | ||
dr = (long) pent->co.local.red - prgb->red; | ||
dg = (long) pent->co.local.green - prgb->green; | ||
db = (long) pent->co.local.blue - prgb->blue; | ||
sq = dr * dr; | ||
UnsignedToBigNum (sq, &sum); | ||
BigNumAdd (&sum, &temp, &sum); | ||
|
||
co.local.red are entries that were brought in through FBIOGETCMAP which come | ||
directly from the info->cmap.red that was listed above. The prgb is the rgb | ||
that the app wants to match to. The above code is doing what looks like a least | ||
squares matching function. That's why the cmap entries can't be set to the left | ||
hand side boundaries of a color range. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.