Skip to content
Snippets Groups Projects
Select Git revision
  • 1e99cfa8de0f0879091e33cd65fd60418d006ad9
  • drm-misc-templates default
  • wip/final/kci-gitlab-lava-v1
  • wip/vignesh/kci-lava-gitlab-runner
  • kci-gitlab-igt-v8
  • kci-gitlab-igt-v4
  • drm-misc-fixes-2024-10-02
  • drm-misc-next-2024-09-26
  • drm-misc-fixes-2024-09-26
  • drm-misc-next-2024-09-20
  • drm-misc-fixes-2024-09-12
  • drm-misc-fixes-2024-09-05
  • drm-misc-next-fixes-2024-09-05
  • drm-misc-fixes-2024-08-29
  • drm-misc-next-2024-08-29
  • drm-misc-next-2024-08-22
  • drm-misc-fixes-2024-08-22
  • drm-misc-next-2024-08-16
  • drm-misc-fixes-2024-08-15
  • drm-misc-next-2024-08-09
  • drm-misc-fixes-2024-08-08
  • drm-misc-next-2024-08-01
  • drm-misc-fixes-2024-08-01
  • drm-misc-next-fixes-2024-07-25
  • drm-misc-next-fixes-2024-07-19
  • drm-misc-next-fixes-2024-07-11
26 results

ast_mode.c

Blame
  • ast_mode.c 33.85 KiB
    /*
     * Copyright 2012 Red Hat Inc.
     * Parts based on xf86-video-ast
     * Copyright (c) 2005 ASPEED Technology Inc.
     *
     * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL
     * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
     *
     * The above copyright notice and this permission notice (including the
     * next paragraph) shall be included in all copies or substantial portions
     * of the Software.
     *
     */
    /*
     * Authors: Dave Airlie <airlied@redhat.com>
     */
    #include <linux/export.h>
    #include <drm/drmP.h>
    #include <drm/drm_crtc.h>
    #include <drm/drm_crtc_helper.h>
    #include "ast_drv.h"
    
    #include "ast_tables.h"
    
    static struct ast_i2c_chan *ast_i2c_create(struct drm_device *dev);
    static void ast_i2c_destroy(struct ast_i2c_chan *i2c);
    static int ast_cursor_set(struct drm_crtc *crtc,
    			  struct drm_file *file_priv,
    			  uint32_t handle,
    			  uint32_t width,
    			  uint32_t height);
    static int ast_cursor_move(struct drm_crtc *crtc,
    			   int x, int y);
    
    static inline void ast_load_palette_index(struct ast_private *ast,
    				     u8 index, u8 red, u8 green,
    				     u8 blue)
    {
    	ast_io_write8(ast, AST_IO_DAC_INDEX_WRITE, index);
    	ast_io_read8(ast, AST_IO_SEQ_PORT);
    	ast_io_write8(ast, AST_IO_DAC_DATA, red);
    	ast_io_read8(ast, AST_IO_SEQ_PORT);
    	ast_io_write8(ast, AST_IO_DAC_DATA, green);
    	ast_io_read8(ast, AST_IO_SEQ_PORT);
    	ast_io_write8(ast, AST_IO_DAC_DATA, blue);
    	ast_io_read8(ast, AST_IO_SEQ_PORT);
    }
    
    static void ast_crtc_load_lut(struct drm_crtc *crtc)
    {
    	struct ast_private *ast = crtc->dev->dev_private;
    	struct ast_crtc *ast_crtc = to_ast_crtc(crtc);
    	int i;
    
    	if (!crtc->enabled)
    		return;