linux/drivers/gpu/drm/i915/display/intel_sprite.c

/*
 * Copyright © 2011 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 * Authors:
 *   Jesse Barnes <[email protected]>
 *
 * New plane/sprite handling.
 *
 * The older chips had a separate interface for programming plane related
 * registers; newer ones are much simpler and we can use the new DRM plane
 * support.
 */

#include <linux/string_helpers.h>

#include <drm/drm_atomic_helper.h>
#include <drm/drm_blend.h>
#include <drm/drm_color_mgmt.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_rect.h>

#include "i915_drv.h"
#include "i9xx_plane.h"
#include "intel_atomic_plane.h"
#include "intel_de.h"
#include "intel_display_types.h"
#include "intel_fb.h"
#include "intel_frontbuffer.h"
#include "intel_sprite.h"
#include "intel_sprite_regs.h"

static char sprite_name(struct intel_display *display, enum pipe pipe, int sprite)
{}

static void i9xx_plane_linear_gamma(u16 gamma[8])
{}

static void
chv_sprite_update_csc(const struct intel_plane_state *plane_state)
{}

#define SIN_0
#define COS_0

static void
vlv_sprite_update_clrc(const struct intel_plane_state *plane_state)
{}

static void
vlv_plane_ratio(const struct intel_crtc_state *crtc_state,
		const struct intel_plane_state *plane_state,
		unsigned int *num, unsigned int *den)
{}

int vlv_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
			const struct intel_plane_state *plane_state)
{}

static unsigned int vlv_sprite_min_alignment(struct intel_plane *plane,
					     const struct drm_framebuffer *fb,
					     int color_plane)
{}

static u32 vlv_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
{}

static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state,
			  const struct intel_plane_state *plane_state)
{}

static void vlv_sprite_update_gamma(const struct intel_plane_state *plane_state)
{}

static void
vlv_sprite_update_noarm(struct intel_plane *plane,
			const struct intel_crtc_state *crtc_state,
			const struct intel_plane_state *plane_state)
{}

static void
vlv_sprite_update_arm(struct intel_plane *plane,
		      const struct intel_crtc_state *crtc_state,
		      const struct intel_plane_state *plane_state)
{}

static void
vlv_sprite_disable_arm(struct intel_plane *plane,
		       const struct intel_crtc_state *crtc_state)
{}

static bool
vlv_sprite_get_hw_state(struct intel_plane *plane,
			enum pipe *pipe)
{}

static void ivb_plane_ratio(const struct intel_crtc_state *crtc_state,
			    const struct intel_plane_state *plane_state,
			    unsigned int *num, unsigned int *den)
{}

static void ivb_plane_ratio_scaling(const struct intel_crtc_state *crtc_state,
				    const struct intel_plane_state *plane_state,
				    unsigned int *num, unsigned int *den)
{}

int ivb_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
			const struct intel_plane_state *plane_state)
{}

static int ivb_sprite_min_cdclk(const struct intel_crtc_state *crtc_state,
				const struct intel_plane_state *plane_state)
{}

static void hsw_plane_ratio(const struct intel_crtc_state *crtc_state,
			    const struct intel_plane_state *plane_state,
			    unsigned int *num, unsigned int *den)
{}

int hsw_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
			const struct intel_plane_state *plane_state)
{}

static u32 ivb_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
{}

static bool ivb_need_sprite_gamma(const struct intel_plane_state *plane_state)
{}

static u32 ivb_sprite_ctl(const struct intel_crtc_state *crtc_state,
			  const struct intel_plane_state *plane_state)
{}

static void ivb_sprite_linear_gamma(const struct intel_plane_state *plane_state,
				    u16 gamma[18])
{}

static void ivb_sprite_update_gamma(const struct intel_plane_state *plane_state)
{}

static void
ivb_sprite_update_noarm(struct intel_plane *plane,
			const struct intel_crtc_state *crtc_state,
			const struct intel_plane_state *plane_state)
{}

static void
ivb_sprite_update_arm(struct intel_plane *plane,
		      const struct intel_crtc_state *crtc_state,
		      const struct intel_plane_state *plane_state)
{}

static void
ivb_sprite_disable_arm(struct intel_plane *plane,
		       const struct intel_crtc_state *crtc_state)
{}

static bool
ivb_sprite_get_hw_state(struct intel_plane *plane,
			enum pipe *pipe)
{}

static int g4x_sprite_min_cdclk(const struct intel_crtc_state *crtc_state,
				const struct intel_plane_state *plane_state)
{}

static unsigned int
g4x_sprite_max_stride(struct intel_plane *plane,
		      u32 pixel_format, u64 modifier,
		      unsigned int rotation)
{}

static unsigned int
hsw_sprite_max_stride(struct intel_plane *plane,
		      u32 pixel_format, u64 modifier,
		      unsigned int rotation)
{}

static unsigned int g4x_sprite_min_alignment(struct intel_plane *plane,
					     const struct drm_framebuffer *fb,
					     int color_plane)
{}

static u32 g4x_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
{}

static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
			  const struct intel_plane_state *plane_state)
{}

static void g4x_sprite_update_gamma(const struct intel_plane_state *plane_state)
{}

static void ilk_sprite_linear_gamma(u16 gamma[17])
{}

static void ilk_sprite_update_gamma(const struct intel_plane_state *plane_state)
{}

static void
g4x_sprite_update_noarm(struct intel_plane *plane,
			const struct intel_crtc_state *crtc_state,
			const struct intel_plane_state *plane_state)
{}

static void
g4x_sprite_update_arm(struct intel_plane *plane,
		      const struct intel_crtc_state *crtc_state,
		      const struct intel_plane_state *plane_state)
{}

static void
g4x_sprite_disable_arm(struct intel_plane *plane,
		       const struct intel_crtc_state *crtc_state)
{}

static bool
g4x_sprite_get_hw_state(struct intel_plane *plane,
			enum pipe *pipe)
{}

static bool g4x_fb_scalable(const struct drm_framebuffer *fb)
{}

static int
g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
			 struct intel_plane_state *plane_state)
{}

static int
g4x_sprite_check(struct intel_crtc_state *crtc_state,
		 struct intel_plane_state *plane_state)
{}

int chv_plane_check_rotation(const struct intel_plane_state *plane_state)
{}

static int
vlv_sprite_check(struct intel_crtc_state *crtc_state,
		 struct intel_plane_state *plane_state)
{}

static const u32 g4x_sprite_formats[] =;

static const u32 snb_sprite_formats[] =;

static const u32 vlv_sprite_formats[] =;

static const u32 chv_pipe_b_sprite_formats[] =;

static bool g4x_sprite_format_mod_supported(struct drm_plane *_plane,
					    u32 format, u64 modifier)
{}

static bool snb_sprite_format_mod_supported(struct drm_plane *_plane,
					    u32 format, u64 modifier)
{}

static bool vlv_sprite_format_mod_supported(struct drm_plane *_plane,
					    u32 format, u64 modifier)
{}

static const struct drm_plane_funcs g4x_sprite_funcs =;

static const struct drm_plane_funcs snb_sprite_funcs =;

static const struct drm_plane_funcs vlv_sprite_funcs =;

struct intel_plane *
intel_sprite_plane_create(struct drm_i915_private *dev_priv,
			  enum pipe pipe, int sprite)
{}