[RFC/PATCH 08/10] [ARM] tegra: Add framebuffer driver

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Mar 18 04:47:43 EDT 2010


On Mon, Mar 15, 2010 at 11:41:26PM -0700, konkers at google.com wrote:
> +static int tegra_fb_set_par(struct fb_info *info)
> +{
> +	struct tegra_fb_info *tegra_fb = info->par;
> +	struct fb_var_screeninfo *var = &info->var;
> +	struct fb_fix_screeninfo *fix = &info->fix;
> +	u32 color_depth;
> +	unsigned int h_dda;
> +	unsigned int v_dda;
> +
> +	/* we only support RGB ordering for now */
> +	switch (var->bits_per_pixel) {
> +	case 32:
> +	case 24:
> +		var->red.offset = 0;
> +		var->red.length = 8;
> +		var->green.offset = 8;
> +		var->green.length = 8;
> +		var->blue.offset = 16;
> +		var->blue.length = 8;
> +		color_depth = DC_COLOR_DEPTH_B8G8R8A8;
> +		break;
> +	case 16:
> +		var->red.offset = 11;
> +		var->red.length = 5;
> +		var->green.offset = 5;
> +		var->green.length = 6;
> +		var->blue.offset = 0;
> +		var->blue.length = 5;
> +		color_depth = DC_COLOR_DEPTH_B5G6R5;
> +		break;
> +	default:
> +		return -1;

Is this really -EPERM, "Operation not permitted"?  Please use a proper
errno code rather than just thinking "Oh, I'll use -1 because its easier".




More information about the linux-arm-kernel mailing list