Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39047 )
Change subject: gfx: Move drivers/generic/gfx to drivers/gfx/generic ......................................................................
gfx: Move drivers/generic/gfx to drivers/gfx/generic
This change creates gfx directory under drivers/ so that all drivers handling gfx devices can be located in the same place. In follow-up CLs, we will be adding another driver that handles gfx devices.
This change also updates the names used within the driver from *generic_gfx* to *gfx_generic*. In addition to that, mainboard drallion using this driver is updated to match the correct path and Kconfig name.
TEST=Verified that drallion still builds.
Change-Id: I377743e0f6d770eed143c7b6041dab2a101e6252 Signed-off-by: Furquan Shaikh furquan@google.com --- D src/drivers/generic/gfx/Makefile.inc R src/drivers/gfx/generic/Kconfig A src/drivers/gfx/generic/Makefile.inc R src/drivers/gfx/generic/chip.h R src/drivers/gfx/generic/generic.c M src/mainboard/google/drallion/Kconfig M src/mainboard/google/drallion/variants/drallion/devicetree.cb 7 files changed, 21 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/39047/1
diff --git a/src/drivers/generic/gfx/Makefile.inc b/src/drivers/generic/gfx/Makefile.inc deleted file mode 100644 index c31986b..0000000 --- a/src/drivers/generic/gfx/Makefile.inc +++ /dev/null @@ -1 +0,0 @@ -ramstage-$(CONFIG_DRIVERS_GENERIC_GFX) += gfx.c diff --git a/src/drivers/generic/gfx/Kconfig b/src/drivers/gfx/generic/Kconfig similarity index 80% rename from src/drivers/generic/gfx/Kconfig rename to src/drivers/gfx/generic/Kconfig index 1152f5b..dcd1a8b 100644 --- a/src/drivers/generic/gfx/Kconfig +++ b/src/drivers/gfx/generic/Kconfig @@ -1,4 +1,4 @@ -config DRIVERS_GENERIC_GFX +config DRIVERS_GFX_GENERIC bool default n depends on HAVE_ACPI_TABLES diff --git a/src/drivers/gfx/generic/Makefile.inc b/src/drivers/gfx/generic/Makefile.inc new file mode 100644 index 0000000..4ffe8dc --- /dev/null +++ b/src/drivers/gfx/generic/Makefile.inc @@ -0,0 +1 @@ +ramstage-$(CONFIG_DRIVERS_GFX_GENERIC) += generic.c diff --git a/src/drivers/generic/gfx/chip.h b/src/drivers/gfx/generic/chip.h similarity index 81% rename from src/drivers/generic/gfx/chip.h rename to src/drivers/gfx/generic/chip.h index ee5bd1f..5e855e3 100644 --- a/src/drivers/generic/gfx/chip.h +++ b/src/drivers/gfx/generic/chip.h @@ -13,11 +13,11 @@ * GNU General Public License for more details. */
-#ifndef __DRIVERS_GENERIC_GFX_CHIP_H__ -#define __DRIVERS_GENERIC_GFX_CHIP_H__ +#ifndef __DRIVERS_GFX_GENERIC_CHIP_H__ +#define __DRIVERS_GFX_GENERIC_CHIP_H__
/* Config for electronic privacy screen */ -struct drivers_generic_gfx_privacy_screen_config { +struct drivers_gfx_generic_privacy_screen_config { /* Is privacy screen available on this graphics device */ int enabled; /* ACPI namespace path to privacy screen detection function */ @@ -31,17 +31,17 @@ };
/* Config for an output device as defined in section A.5 of the ACPI spec */ -struct drivers_generic_gfx_device_config { +struct drivers_gfx_generic_device_config { /* ACPI device name of the output device */ const char *name; /* The address of the output device. See section A.3.2 */ unsigned int addr; /* Electronic privacy screen specific config */ - struct drivers_generic_gfx_privacy_screen_config privacy; + struct drivers_gfx_generic_privacy_screen_config privacy; };
/* Config for an ACPI video device defined in Appendix A of the ACPI spec */ -struct drivers_generic_gfx_config { +struct drivers_gfx_generic_config { /* * ACPI device name of the graphics card, "GFX0" will be used if name is * not set @@ -50,7 +50,7 @@ /* The number of output devices defined */ int device_count; /* Config for output devices */ - struct drivers_generic_gfx_device_config device[5]; + struct drivers_gfx_generic_device_config device[5]; };
-#endif /* __DRIVERS_GENERIC_GFX_CHIP_H__ */ +#endif /* __DRIVERS_GFX_GENERIC_CHIP_H__ */ diff --git a/src/drivers/generic/gfx/gfx.c b/src/drivers/gfx/generic/generic.c similarity index 83% rename from src/drivers/generic/gfx/gfx.c rename to src/drivers/gfx/generic/generic.c index 0386e9b..8488040 100644 --- a/src/drivers/generic/gfx/gfx.c +++ b/src/drivers/gfx/generic/generic.c @@ -26,7 +26,7 @@
static void privacy_screen_detect_cb(void *arg) { - struct drivers_generic_gfx_privacy_screen_config *config = arg; + struct drivers_gfx_generic_privacy_screen_config *config = arg;
acpigen_write_store(); acpigen_emit_namestring(config->detect_function); @@ -37,20 +37,20 @@ } static void privacy_screen_get_status_cb(void *arg) { - struct drivers_generic_gfx_privacy_screen_config *config = arg; + struct drivers_gfx_generic_privacy_screen_config *config = arg;
acpigen_emit_byte(RETURN_OP); acpigen_emit_namestring(config->status_function); } static void privacy_screen_enable_cb(void *arg) { - struct drivers_generic_gfx_privacy_screen_config *config = arg; + struct drivers_gfx_generic_privacy_screen_config *config = arg;
acpigen_emit_namestring(config->enable_function); } static void privacy_screen_disable_cb(void *arg) { - struct drivers_generic_gfx_privacy_screen_config *config = arg; + struct drivers_gfx_generic_privacy_screen_config *config = arg;
acpigen_emit_namestring(config->disable_function); } @@ -65,7 +65,7 @@ static void gfx_fill_ssdt_generator(struct device *dev) { size_t i; - struct drivers_generic_gfx_config *config = dev->chip_info; + struct drivers_gfx_generic_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
@@ -103,7 +103,7 @@
static const char *gfx_acpi_name(const struct device *dev) { - struct drivers_generic_gfx_config *config = dev->chip_info; + struct drivers_gfx_generic_config *config = dev->chip_info;
return config->name ? : "GFX0"; } @@ -115,7 +115,7 @@
static void gfx_enable(struct device *dev) { - struct drivers_generic_gfx_config *config = dev->chip_info; + struct drivers_gfx_generic_config *config = dev->chip_info;
if (!config) return; @@ -123,7 +123,7 @@ dev->ops = &gfx_ops; }
-struct chip_operations drivers_generic_gfx_ops = { - CHIP_NAME("Graphics Device") +struct chip_operations drivers_gfx_generic_ops = { + CHIP_NAME("Generic Graphics Device") .enable_dev = gfx_enable }; diff --git a/src/mainboard/google/drallion/Kconfig b/src/mainboard/google/drallion/Kconfig index a006858..61bae2b 100644 --- a/src/mainboard/google/drallion/Kconfig +++ b/src/mainboard/google/drallion/Kconfig @@ -2,7 +2,7 @@ config BOARD_GOOGLE_BASEBOARD_DRALLION def_bool n select BOARD_ROMSIZE_KB_32768 - select DRIVERS_GENERIC_GFX + select DRIVERS_GFX_GENERIC select DRIVERS_I2C_GENERIC select DRIVERS_I2C_HID select DRIVERS_INTEL_ISH diff --git a/src/mainboard/google/drallion/variants/drallion/devicetree.cb b/src/mainboard/google/drallion/variants/drallion/devicetree.cb index cdb6288..d0006d6 100644 --- a/src/mainboard/google/drallion/variants/drallion/devicetree.cb +++ b/src/mainboard/google/drallion/variants/drallion/devicetree.cb @@ -226,7 +226,7 @@ device domain 0 on device pci 00.0 on end # Host Bridge device pci 02.0 on - chip drivers/generic/gfx + chip drivers/gfx/generic register "device_count" = "1" register "device[0].name" = ""LCD"" # Address is set following the ACPI spec section A.3.2
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39047 )
Change subject: gfx: Move drivers/generic/gfx to drivers/gfx/generic ......................................................................
Patch Set 1: Code-Review+2
Mathew King has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39047 )
Change subject: gfx: Move drivers/generic/gfx to drivers/gfx/generic ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39047 )
Change subject: gfx: Move drivers/generic/gfx to drivers/gfx/generic ......................................................................
gfx: Move drivers/generic/gfx to drivers/gfx/generic
This change creates gfx directory under drivers/ so that all drivers handling gfx devices can be located in the same place. In follow-up CLs, we will be adding another driver that handles gfx devices.
This change also updates the names used within the driver from *generic_gfx* to *gfx_generic*. In addition to that, mainboard drallion using this driver is updated to match the correct path and Kconfig name.
TEST=Verified that drallion still builds.
Change-Id: I377743e0f6d770eed143c7b6041dab2a101e6252 Signed-off-by: Furquan Shaikh furquan@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/39047 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org Reviewed-by: Mathew King mathewk@chromium.org --- D src/drivers/generic/gfx/Makefile.inc R src/drivers/gfx/generic/Kconfig A src/drivers/gfx/generic/Makefile.inc R src/drivers/gfx/generic/chip.h R src/drivers/gfx/generic/generic.c M src/mainboard/google/drallion/Kconfig M src/mainboard/google/drallion/variants/drallion/devicetree.cb 7 files changed, 21 insertions(+), 21 deletions(-)
Approvals: build bot (Jenkins): Verified Mathew King: Looks good to me, approved Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/drivers/generic/gfx/Makefile.inc b/src/drivers/generic/gfx/Makefile.inc deleted file mode 100644 index c31986b..0000000 --- a/src/drivers/generic/gfx/Makefile.inc +++ /dev/null @@ -1 +0,0 @@ -ramstage-$(CONFIG_DRIVERS_GENERIC_GFX) += gfx.c diff --git a/src/drivers/generic/gfx/Kconfig b/src/drivers/gfx/generic/Kconfig similarity index 80% rename from src/drivers/generic/gfx/Kconfig rename to src/drivers/gfx/generic/Kconfig index 1152f5b..dcd1a8b 100644 --- a/src/drivers/generic/gfx/Kconfig +++ b/src/drivers/gfx/generic/Kconfig @@ -1,4 +1,4 @@ -config DRIVERS_GENERIC_GFX +config DRIVERS_GFX_GENERIC bool default n depends on HAVE_ACPI_TABLES diff --git a/src/drivers/gfx/generic/Makefile.inc b/src/drivers/gfx/generic/Makefile.inc new file mode 100644 index 0000000..4ffe8dc --- /dev/null +++ b/src/drivers/gfx/generic/Makefile.inc @@ -0,0 +1 @@ +ramstage-$(CONFIG_DRIVERS_GFX_GENERIC) += generic.c diff --git a/src/drivers/generic/gfx/chip.h b/src/drivers/gfx/generic/chip.h similarity index 81% rename from src/drivers/generic/gfx/chip.h rename to src/drivers/gfx/generic/chip.h index ee5bd1f..5e855e3 100644 --- a/src/drivers/generic/gfx/chip.h +++ b/src/drivers/gfx/generic/chip.h @@ -13,11 +13,11 @@ * GNU General Public License for more details. */
-#ifndef __DRIVERS_GENERIC_GFX_CHIP_H__ -#define __DRIVERS_GENERIC_GFX_CHIP_H__ +#ifndef __DRIVERS_GFX_GENERIC_CHIP_H__ +#define __DRIVERS_GFX_GENERIC_CHIP_H__
/* Config for electronic privacy screen */ -struct drivers_generic_gfx_privacy_screen_config { +struct drivers_gfx_generic_privacy_screen_config { /* Is privacy screen available on this graphics device */ int enabled; /* ACPI namespace path to privacy screen detection function */ @@ -31,17 +31,17 @@ };
/* Config for an output device as defined in section A.5 of the ACPI spec */ -struct drivers_generic_gfx_device_config { +struct drivers_gfx_generic_device_config { /* ACPI device name of the output device */ const char *name; /* The address of the output device. See section A.3.2 */ unsigned int addr; /* Electronic privacy screen specific config */ - struct drivers_generic_gfx_privacy_screen_config privacy; + struct drivers_gfx_generic_privacy_screen_config privacy; };
/* Config for an ACPI video device defined in Appendix A of the ACPI spec */ -struct drivers_generic_gfx_config { +struct drivers_gfx_generic_config { /* * ACPI device name of the graphics card, "GFX0" will be used if name is * not set @@ -50,7 +50,7 @@ /* The number of output devices defined */ int device_count; /* Config for output devices */ - struct drivers_generic_gfx_device_config device[5]; + struct drivers_gfx_generic_device_config device[5]; };
-#endif /* __DRIVERS_GENERIC_GFX_CHIP_H__ */ +#endif /* __DRIVERS_GFX_GENERIC_CHIP_H__ */ diff --git a/src/drivers/generic/gfx/gfx.c b/src/drivers/gfx/generic/generic.c similarity index 83% rename from src/drivers/generic/gfx/gfx.c rename to src/drivers/gfx/generic/generic.c index 0386e9b..8488040 100644 --- a/src/drivers/generic/gfx/gfx.c +++ b/src/drivers/gfx/generic/generic.c @@ -26,7 +26,7 @@
static void privacy_screen_detect_cb(void *arg) { - struct drivers_generic_gfx_privacy_screen_config *config = arg; + struct drivers_gfx_generic_privacy_screen_config *config = arg;
acpigen_write_store(); acpigen_emit_namestring(config->detect_function); @@ -37,20 +37,20 @@ } static void privacy_screen_get_status_cb(void *arg) { - struct drivers_generic_gfx_privacy_screen_config *config = arg; + struct drivers_gfx_generic_privacy_screen_config *config = arg;
acpigen_emit_byte(RETURN_OP); acpigen_emit_namestring(config->status_function); } static void privacy_screen_enable_cb(void *arg) { - struct drivers_generic_gfx_privacy_screen_config *config = arg; + struct drivers_gfx_generic_privacy_screen_config *config = arg;
acpigen_emit_namestring(config->enable_function); } static void privacy_screen_disable_cb(void *arg) { - struct drivers_generic_gfx_privacy_screen_config *config = arg; + struct drivers_gfx_generic_privacy_screen_config *config = arg;
acpigen_emit_namestring(config->disable_function); } @@ -65,7 +65,7 @@ static void gfx_fill_ssdt_generator(struct device *dev) { size_t i; - struct drivers_generic_gfx_config *config = dev->chip_info; + struct drivers_gfx_generic_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
@@ -103,7 +103,7 @@
static const char *gfx_acpi_name(const struct device *dev) { - struct drivers_generic_gfx_config *config = dev->chip_info; + struct drivers_gfx_generic_config *config = dev->chip_info;
return config->name ? : "GFX0"; } @@ -115,7 +115,7 @@
static void gfx_enable(struct device *dev) { - struct drivers_generic_gfx_config *config = dev->chip_info; + struct drivers_gfx_generic_config *config = dev->chip_info;
if (!config) return; @@ -123,7 +123,7 @@ dev->ops = &gfx_ops; }
-struct chip_operations drivers_generic_gfx_ops = { - CHIP_NAME("Graphics Device") +struct chip_operations drivers_gfx_generic_ops = { + CHIP_NAME("Generic Graphics Device") .enable_dev = gfx_enable }; diff --git a/src/mainboard/google/drallion/Kconfig b/src/mainboard/google/drallion/Kconfig index a006858..61bae2b 100644 --- a/src/mainboard/google/drallion/Kconfig +++ b/src/mainboard/google/drallion/Kconfig @@ -2,7 +2,7 @@ config BOARD_GOOGLE_BASEBOARD_DRALLION def_bool n select BOARD_ROMSIZE_KB_32768 - select DRIVERS_GENERIC_GFX + select DRIVERS_GFX_GENERIC select DRIVERS_I2C_GENERIC select DRIVERS_I2C_HID select DRIVERS_INTEL_ISH diff --git a/src/mainboard/google/drallion/variants/drallion/devicetree.cb b/src/mainboard/google/drallion/variants/drallion/devicetree.cb index cdb6288..d0006d6 100644 --- a/src/mainboard/google/drallion/variants/drallion/devicetree.cb +++ b/src/mainboard/google/drallion/variants/drallion/devicetree.cb @@ -226,7 +226,7 @@ device domain 0 on device pci 00.0 on end # Host Bridge device pci 02.0 on - chip drivers/generic/gfx + chip drivers/gfx/generic register "device_count" = "1" register "device[0].name" = ""LCD"" # Address is set following the ACPI spec section A.3.2